Skip to content

Commit aadda8f

Browse files
authored
Merge branch 'master' into mlsr/mirror-tags-branches
2 parents 1e78855 + d0d59e3 commit aadda8f

File tree

12 files changed

+96
-71
lines changed

12 files changed

+96
-71
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ import (
158158
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The gitea code is divided into the following parts:
159159

160160
- **integration:** Integrations tests
161-
- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependecies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
161+
- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
162162
- **models/fixtures:** Sample model data used in integration tests.
163163
- **models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.
164164
- **modules:** Different modules to handle specific functionality in Gitea.
@@ -181,16 +181,16 @@ The same applies to status responses. If you notice a problem, feel free to leav
181181
All expected results (errors, success, fail messages) should be documented
182182
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L319-L327)).
183183

184-
All JSON input types must be defined as a struct in `models/structs/`
184+
All JSON input types must be defined as a struct in [modules/structs/](modules/structs/)
185185
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91))
186186
and referenced in
187187
[routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go).
188188
They can then be used like the following:
189189
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318)).
190190

191-
All JSON responses must be defined as a struct in `models/structs/`
191+
All JSON responses must be defined as a struct in [modules/structs/](modules/structs/)
192192
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L36-L68))
193-
and referenced in its category in `routers/api/v1/swagger/`
193+
and referenced in its category in [routers/api/v1/swagger/](routers/api/v1/swagger/)
194194
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16))
195195
They can be used like the following:
196196
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279))
@@ -199,7 +199,7 @@ In general, HTTP methods are chosen as follows:
199199
* **GET** endpoints return requested object and status **OK (200)**
200200
* **DELETE** endpoints return status **No Content (204)**
201201
* **POST** endpoints return status **Created (201)**, used to **create** new objects (e.g. a User)
202-
* **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Obejcts (e.g. User) to something (e.g. Org-Team)
202+
* **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Objects (e.g. User) to something (e.g. Org-Team)
203203
* **PATCH** endpoints return changed object and status **OK (200)**, used to **edit/change** an existing object
204204

205205

build/generate-svg.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ function exit(err) {
1414
process.exit(err ? 1 : 0);
1515
}
1616

17-
async function processFile(file, {prefix = ''} = {}) {
18-
let name = parse(file).name;
19-
if (prefix) name = `${prefix}-${name}`;
20-
if (prefix === 'octicon') name = name.replace(/-[0-9]+$/, ''); // chop of '-16' on octicons
17+
async function processFile(file, {prefix, fullName} = {}) {
18+
let name;
19+
20+
if (fullName) {
21+
name = fullName;
22+
} else {
23+
name = parse(file).name;
24+
if (prefix) name = `${prefix}-${name}`;
25+
if (prefix === 'octicon') name = name.replace(/-[0-9]+$/, ''); // chop of '-16' on octicons
26+
}
2127

2228
const svgo = new Svgo({
2329
plugins: [
@@ -47,18 +53,20 @@ async function processFile(file, {prefix = ''} = {}) {
4753
await writeFile(resolve(outputDir, `${name}.svg`), data);
4854
}
4955

56+
function processFiles(pattern, opts) {
57+
return glob(pattern).map((file) => processFile(file, opts));
58+
}
59+
5060
async function main() {
5161
try {
5262
await mkdir(outputDir);
5363
} catch {}
5464

55-
for (const file of glob('../node_modules/@primer/octicons/build/svg/*-16.svg')) {
56-
await processFile(file, {prefix: 'octicon'});
57-
}
58-
59-
for (const file of glob('../web_src/svg/*.svg')) {
60-
await processFile(file);
61-
}
65+
await Promise.all([
66+
...processFiles('../node_modules/@primer/octicons/build/svg/*-16.svg', {prefix: 'octicon'}),
67+
...processFiles('../web_src/svg/*.svg'),
68+
...processFiles('../assets/logo.svg', {fullName: 'gitea-gitea'}),
69+
]);
6270
}
6371

6472
main().then(exit).catch(exit);

public/img/svg/gitea-gitea.svg

Lines changed: 1 addition & 1 deletion
Loading

templates/repo/migrate/migrate.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
<div class="column">
55
<div class="ui three stackable cards">
66
{{range .Services}}
7-
<div class="ui card">
8-
<a class="image" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}">
9-
{{svg (Printf "gitea-%s" .Name) 184}}
10-
</a>
7+
<a class="ui card df ac" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}">
8+
{{svg (Printf "gitea-%s" .Name) 184}}
119
<div class="content">
12-
<a class="header" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}">{{.Title}}</a>
13-
<div class="description">
10+
<div class="header tc">
11+
{{.Title}}
12+
</div>
13+
<div class="description tc">
1414
{{(Printf "repo.migrate.%s.description" .Name) | $.i18n.Tr }}
1515
</div>
1616
</div>
17-
</div>
17+
</a>
1818
{{end}}
1919
</div>
2020
</div>

web_src/less/_admin.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
}
5656

5757
dt {
58-
font-weight: 500;
58+
font-weight: 600;
5959
float: left;
6060
width: 285px;
6161
clear: left;

web_src/less/_base.less

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@
9494
--color-hover: #0000000a;
9595
--color-active: #00000010;
9696
--color-menu: #ffffff;
97+
--color-card: #ffffff;
9798
--color-markdown-table-row: #00000008;
9899
--color-markdown-code-block: #00000010;
99100
--color-button: #ffffff;
100101
--color-code-bg: #ffffff;
102+
--color-shadow: #00000024;
101103
}
102104

103105
:root:lang(ja) {
@@ -144,10 +146,7 @@ samp {
144146
}
145147

146148
b,
147-
strong {
148-
font-weight: 500;
149-
}
150-
149+
strong,
151150
h1,
152151
h2,
153152
h3,
@@ -374,6 +373,48 @@ a.muted:hover,
374373
box-shadow: -1px -1px 0 0 var(--color-secondary);
375374
}
376375

376+
.ui.cards > .card,
377+
.ui.card {
378+
background: var(--color-card);
379+
border: 1px solid var(--color-secondary);
380+
box-shadow: none;
381+
}
382+
383+
.ui.cards > .card > .content,
384+
.ui.card > .content {
385+
border-color: var(--color-secondary);
386+
}
387+
388+
.ui.cards > .card > .extra,
389+
.ui.card > .extra,
390+
.ui.cards > .card > .extra a:not(.ui),
391+
.ui.card > .extra a:not(.ui) {
392+
color: var(--color-text);
393+
}
394+
395+
.ui.cards > .card > .extra a:not(.ui):hover,
396+
.ui.card > .extra a:not(.ui):hover {
397+
color: var(--color-primary);
398+
}
399+
400+
.ui.cards > .card > .content > .header,
401+
.ui.card > .content > .header {
402+
color: var(--color-text);
403+
}
404+
405+
.ui.cards > .card > .content > .description,
406+
.ui.card > .content > .description {
407+
color: var(--color-text);
408+
}
409+
410+
.ui.cards a.card:hover,
411+
.ui.link.cards .card:not(.icon):hover,
412+
a.ui.card:hover,
413+
.ui.link.card:hover {
414+
border: 1px solid var(--color-secondary);
415+
background: var(--color-card);
416+
}
417+
377418
.ui.progress[data-percent="0"] .bar .progress {
378419
color: var(--color-text);
379420
}
@@ -702,7 +743,7 @@ a.muted:hover,
702743
}
703744

704745
&.bold {
705-
font-weight: 500;
746+
font-weight: 600;
706747
}
707748

708749
&.italic {
@@ -737,7 +778,6 @@ a.muted:hover,
737778
}
738779

739780
&.bottom.attached.message {
740-
font-weight: 500;
741781
text-align: left;
742782
color: black;
743783

@@ -998,7 +1038,7 @@ a.muted:hover,
9981038

9991039
.scrolling.menu {
10001040
.item.selected {
1001-
font-weight: 500 !important;
1041+
font-weight: 600 !important;
10021042
}
10031043
}
10041044

web_src/less/_chroma.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
/* GenericStrong */
353353

354354
.chroma .gs {
355-
font-weight: 500;
355+
font-weight: 600;
356356
}
357357
/* GenericSubheading */
358358

web_src/less/_repository.less

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@
969969
}
970970

971971
.author {
972-
font-weight: 500;
972+
font-weight: 600;
973973
}
974974

975975
.comment-form-reply .footer {
@@ -3206,6 +3206,13 @@ td.blob-excerpt {
32063206
}
32073207
}
32083208

3209-
.migrate .cards .card {
3210-
text-align: center;
3209+
.repository.migrate .card {
3210+
transition: all .1s ease-in-out;
3211+
box-shadow: none !important;
3212+
border: 1px solid var(--color-secondary);
3213+
}
3214+
3215+
.repository.migrate .card:hover {
3216+
transform: scale(105%);
3217+
box-shadow: 0 .5rem 1rem var(--color-shadow) !important;
32113218
}

web_src/less/_user.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
.header {
12-
font-weight: 500;
12+
font-weight: 600;
1313
font-size: 1.3rem;
1414
margin-top: -.2rem;
1515
line-height: 1.3rem;

web_src/less/helpers.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.df { display: flex !important; }
22
.dif { display: inline-flex !important; }
33
.ac { align-items: center !important; }
4+
.tc { text-align: center !important; }
45
.jc { justify-content: center !important; }
56
.js { justify-content: flex-start !important; }
67
.je { justify-content: flex-end !important; }

web_src/less/themes/theme-arc-green.less

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@
8989
--color-hover: #ffffff0d;
9090
--color-active: #ffffff14;
9191
--color-menu: #2e323e;
92+
--color-card: #2e323e;
9293
--color-markdown-table-row: #ffffff06;
9394
--color-markdown-code-block: #2a2e3a;
9495
--color-button: #353846;
9596
--color-code-bg: #2a2e3a;
97+
--color-shadow: #00000060;
9698
}
9799

98100
/* LineTableTD */
@@ -445,7 +447,7 @@
445447
/* GenericStrong */
446448

447449
.chroma .gs {
448-
font-weight: 500;
450+
font-weight: 600;
449451
}
450452
/* GenericSubheading */
451453

@@ -817,22 +819,6 @@ td.blob-hunk {
817819
background: #353945;
818820
}
819821

820-
.ui.card,
821-
.ui.cards > .card {
822-
background: #353945;
823-
box-shadow: 0 0 0 1px var(--color-secondary);
824-
}
825-
826-
.ui.card > .content > .header,
827-
.ui.cards > .card > .content > .header {
828-
color: #dbdbdb;
829-
}
830-
831-
.ui.card > .extra a:not(.ui),
832-
.ui.cards > .card > .extra a:not(.ui) {
833-
color: #87ab63;
834-
}
835-
836822
.ui .text.black {
837823
color: var(--color-secondary-dark-6);
838824
}
@@ -1366,19 +1352,3 @@ img[src$="/img/matrix.svg"] {
13661352
border: 1px solid rgba(121, 71, 66, .5) !important;
13671353
border-bottom: none !important;
13681354
}
1369-
1370-
.migrate .cards .card {
1371-
text-align: center;
1372-
}
1373-
1374-
.migrate .cards .card .content a {
1375-
color: rgb(158, 158, 158) !important;
1376-
}
1377-
1378-
.migrate .cards .card .content a:hover {
1379-
color: rgb(255, 255, 255) !important;
1380-
}
1381-
1382-
.migrate .cards .card .content .description {
1383-
color: rgb(158, 158, 158);
1384-
}

web_src/svg/gitea-gitea.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)