Skip to content

Commit 9d14e78

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Update documentation for the new YAML label file format (go-gitea#23020) Remove unnecessary space on link (go-gitea#23334) Fix incorrect redirect link of delete org project (go-gitea#23327) Fix incorrect project links and use symlink icon for org-wide projects (go-gitea#23325) Fix PR view misalignment caused by long name file (go-gitea#23321) Add ActionRunStatus component (go-gitea#23259) Scoped labels: don't require holding alt key to remove (go-gitea#23303)
2 parents 306ba96 + 84a2993 commit 9d14e78

File tree

15 files changed

+85
-43
lines changed

15 files changed

+85
-43
lines changed

docs/content/doc/advanced/customizing-gitea.en-us.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,22 @@ To add custom .gitignore, add a file with existing [.gitignore rules](https://gi
282282

283283
### Labels
284284

285-
To add a custom label set, add a file that follows the [label format](https://github.com/go-gitea/gitea/blob/main/options/label/Default) to `$GITEA_CUSTOM/options/label`
285+
Starting with Gitea 1.19, you can add a file that follows the [YAML label format](https://github.com/go-gitea/gitea/blob/main/options/label/Advanced.yaml) to `$GITEA_CUSTOM/options/label`:
286+
287+
```yaml
288+
labels:
289+
- name: "foo/bar" # name of the label that will appear in the dropdown
290+
exclusive: true # whether to use the exclusive namespace for scoped labels. scoped delimiter is /
291+
color: aabbcc # hex colour coding
292+
description: Some label # long description of label intent
293+
```
294+
295+
The [legacy file format](https://github.com/go-gitea/gitea/blob/main/options/label/Default) can still be used following the format below, however we strongly recommend using the newer YAML format instead.
296+
286297
`#hex-color label name ; label description`
287298

299+
For more information, see the [labels documentation]({{< relref "doc/usage/labels.en-us.md" >}}).
300+
288301
### Licenses
289302

290303
To add a custom license, add a file with the license text to `$GITEA_CUSTOM/options/license`

routers/web/org/projects.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func DeleteProject(ctx *context.Context) {
205205
}
206206

207207
ctx.JSON(http.StatusOK, map[string]interface{}{
208-
"redirect": ctx.Repo.RepoLink + "/projects",
208+
"redirect": ctx.ContextUser.HomeLink() + "/-/projects",
209209
})
210210
}
211211

templates/org/menu.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
55
</a>
66
<a class="{{if .PageIsViewProjects}}active {{end}}item" href="{{$.Org.HomeLink}}/-/projects">
7-
{{svg "octicon-project"}} {{.locale.Tr "user.projects"}}
7+
{{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
88
</a>
99
{{if .IsPackageEnabled}}
1010
<a class="item" href="{{$.Org.HomeLink}}/-/packages">

templates/projects/list.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{{template "base/alert" .}}
1313
<div class="ui compact tiny menu">
1414
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=open">
15-
{{svg "octicon-project" 16 "gt-mr-3"}}
15+
{{svg "octicon-project-symlink" 16 "gt-mr-3"}}
1616
{{JsPrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
1717
</a>
1818
<a class="item{{if .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=closed">
@@ -38,7 +38,7 @@
3838
<div class="milestone list">
3939
{{range .Projects}}
4040
<li class="item">
41-
{{svg "octicon-project"}} <a href="{{$.Link}}/{{.ID}}">{{.Title}}</a>
41+
{{svg "octicon-project-symlink"}} <a href="{{.Link}}">{{.Title}}</a>
4242
<div class="meta">
4343
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
4444
{{if .IsClosed}}

templates/repo/actions/runs_list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="issue-item-main gt-f1 gt-fc gt-df">
88
<div class="issue-item-top-row">
99
<a class="index gt-ml-0 gt-mr-2" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
10-
{{.Title}}
10+
{{- .Title -}}
1111
</a>
1212
<span class="ui label">
1313
{{if .RefLink}}

templates/repo/diff/box.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
{{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
8080
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} gt-mt-3" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
8181
<h4 class="diff-file-header sticky-2nd-row ui top attached normal header gt-df gt-ac gt-sb">
82-
<div class="gt-df gt-ac">
82+
<div class="diff-file-name gt-df gt-ac gt-mr-3">
8383
<a role="button" class="fold-file muted gt-mr-2" {{if not $isExpandable}}style="visibility: hidden"{{end}}>
8484
{{if $file.ShouldBeHidden}}
8585
{{svg "octicon-chevron-right" 18}}
@@ -96,7 +96,7 @@
9696
{{template "repo/diff/stats" dict "file" . "root" $}}
9797
{{end}}
9898
</div>
99-
<span class="file gt-mono"><a class="muted" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} &rarr; {{end}}{{$file.Name}}</a>{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}}</span>
99+
<span class="file gt-mono"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} &rarr; {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} &rarr; {{end}}{{$file.Name}}</a>{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}}</span>
100100
{{if $file.IsGenerated}}
101101
<span class="ui label gt-ml-3">{{$.locale.Tr "repo.diff.generated"}}</span>
102102
{{end}}

templates/repo/issue/new_form.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@
176176
{{.locale.Tr "repo.issues.new.open_projects"}}
177177
</div>
178178
{{range .OpenProjects}}
179-
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{$.RepoLink}}/projects/{{.ID}}">
180-
{{svg "octicon-project" 18 "gt-mr-3"}}
179+
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
180+
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
181181
{{.Title}}
182182
</a>
183183
{{end}}
@@ -188,8 +188,8 @@
188188
{{.locale.Tr "repo.issues.new.closed_projects"}}
189189
</div>
190190
{{range .ClosedProjects}}
191-
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{$.RepoLink}}/projects/{{.ID}}">
192-
{{svg "octicon-project" 18 "gt-mr-3"}}
191+
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
192+
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
193193
{{.Title}}
194194
</a>
195195
{{end}}
@@ -201,8 +201,8 @@
201201
<span class="no-select item {{if .Project}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span>
202202
<div class="selected">
203203
{{if .Project}}
204-
<a class="item muted sidebar-item-link" href="{{.RepoLink}}/projects/{{.Project.ID}}">
205-
{{svg "octicon-project" 18 "gt-mr-3"}}
204+
<a class="item muted sidebar-item-link" href="{{.Project.Link}}">
205+
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
206206
{{.Project.Title}}
207207
</a>
208208
{{end}}

templates/repo/projects/list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<div class="milestone list">
4141
{{range .Projects}}
4242
<li class="item">
43-
{{svg "octicon-project"}} <a href="{{$.RepoLink}}/projects/{{.ID}}">{{.Title}}</a>
43+
{{svg "octicon-project"}} <a href="{{.Link}}">{{.Title}}</a>
4444
<div class="meta">
4545
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
4646
{{if .IsClosed}}

templates/shared/issuelist.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
</a>
8888
{{end}}
8989
{{if .Project}}
90-
<a class="project" {{if $.RepoLink}}href="{{$.RepoLink}}/projects/{{.Project.ID}}"{{else}}href="{{.Repo.Link}}/projects/{{.Project.ID}}"{{end}}>
91-
{{svg "octicon-project" 14 "gt-mr-2"}}{{.Project.Title}}
90+
<a class="project" href="{{.Project.Link}}">
91+
{{if .Project.IsOrganizationProject}}{{svg "octicon-project-symlink" 14 "gt-mr-2"}}{{else}}{{svg "octicon-project" 14 "gt-mr-2"}}{{end}}{{.Project.Title}}
9292
</a>
9393
{{end}}
9494
{{if .Ref}}

templates/user/overview/header.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
2424
</a>
2525
<a href="{{.ContextUser.HomeLink}}/-/projects" class="{{if .PageIsViewProjects}}active {{end}}item">
26-
{{svg "octicon-project"}} {{.locale.Tr "user.projects"}}
26+
{{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
2727
</a>
2828
{{if (not .UnitPackagesGlobalDisabled)}}
2929
<a href="{{.ContextUser.HomeLink}}/-/packages" class="{{if .IsPackagesPage}}active {{end}}item">

templates/user/profile.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
108108
</a>
109109
<a href="{{.Owner.HomeLink}}/-/projects" class="{{if eq .TabName "projects"}}active {{end}}item">
110-
{{svg "octicon-project"}} {{.locale.Tr "user.projects"}}
110+
{{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
111111
</a>
112112
{{if .IsPackageEnabled}}
113113
<a class='{{if eq .TabName "packages"}}active {{end}}item' href="{{.Owner.HomeLink}}/-/packages">
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<SvgIcon name="octicon-check-circle-fill" class="green" :size="size" :class-name="className" v-if="status === 'success'"/>
3+
<SvgIcon name="octicon-skip" class="ui text grey" :size="size" :class-name="className" v-else-if="status === 'skipped'"/>
4+
<SvgIcon name="octicon-clock" class="ui text yellow" :size="size" :class-name="className" v-else-if="status === 'waiting'"/>
5+
<SvgIcon name="octicon-blocked" class="ui text yellow" :size="size" :class-name="className" v-else-if="status === 'blocked'"/>
6+
<SvgIcon name="octicon-meter" class="ui text yellow" :size="size" :class-name="'job-status-rotate ' + className" v-else-if="status === 'running'"/>
7+
<SvgIcon name="octicon-x-circle-fill" class="red" :size="size" v-else/>
8+
</template>
9+
10+
<script>
11+
import {SvgIcon} from '../svg.js';
12+
13+
export default {
14+
components: {SvgIcon},
15+
props: {
16+
status: {
17+
type: String,
18+
required: true
19+
},
20+
size: {
21+
type: Number,
22+
default: 16
23+
},
24+
className: {
25+
type: String,
26+
default: ''
27+
}
28+
},
29+
};
30+
</script>

web_src/js/components/RepoActionView.vue

+5-16
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
<div class="action-view-container">
33
<div class="action-view-header">
44
<div class="action-info-summary">
5-
<SvgIcon name="octicon-check-circle-fill" size="20" class="green" v-if="run.status === 'success'"/>
6-
<SvgIcon name="octicon-clock" size="20" class="ui text yellow" v-else-if="run.status === 'waiting'"/>
7-
<SvgIcon name="octicon-meter" size="20" class="ui text yellow" class-name="job-status-rotate" v-else-if="run.status === 'running'"/>
8-
<SvgIcon name="octicon-x-circle-fill" size="20" class="red" v-else/>
5+
<ActionRunStatus :status="run.status" :size="20"/>
96
<div class="action-title">
107
{{ run.title }}
118
</div>
@@ -23,12 +20,7 @@
2320
<div class="job-brief-list">
2421
<div class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id">
2522
<a class="job-brief-link" :href="run.link+'/jobs/'+index">
26-
<SvgIcon name="octicon-check-circle-fill" class="green" v-if="job.status === 'success'"/>
27-
<SvgIcon name="octicon-skip" class="ui text grey" v-else-if="job.status === 'skipped'"/>
28-
<SvgIcon name="octicon-clock" class="ui text yellow" v-else-if="job.status === 'waiting'"/>
29-
<SvgIcon name="octicon-blocked" class="ui text yellow" v-else-if="job.status === 'blocked'"/>
30-
<SvgIcon name="octicon-meter" class="ui text yellow" class-name="job-status-rotate" v-else-if="job.status === 'running'"/>
31-
<SvgIcon name="octicon-x-circle-fill" class="red" v-else/>
23+
<ActionRunStatus :status="job.status"/>
3224
<span class="ui text">{{ job.name }}</span>
3325
</a>
3426
<button class="job-brief-rerun" @click="rerunJob(index)" v-if="job.canRerun">
@@ -54,12 +46,7 @@
5446
<SvgIcon name="octicon-chevron-down" class="gt-mr-3" v-show="currentJobStepsStates[i].expanded"/>
5547
<SvgIcon name="octicon-chevron-right" class="gt-mr-3" v-show="!currentJobStepsStates[i].expanded"/>
5648

57-
<SvgIcon name="octicon-check-circle-fill" class="green gt-mr-3" v-if="jobStep.status === 'success'"/>
58-
<SvgIcon name="octicon-skip" class="ui text grey gt-mr-3" v-else-if="jobStep.status === 'skipped'"/>
59-
<SvgIcon name="octicon-clock" class="ui text yellow gt-mr-3" v-else-if="jobStep.status === 'waiting'"/>
60-
<SvgIcon name="octicon-blocked" class="ui text yellow gt-mr-3" v-else-if="jobStep.status === 'blocked'"/>
61-
<SvgIcon name="octicon-meter" class="ui text yellow gt-mr-3" class-name="job-status-rotate" v-else-if="jobStep.status === 'running'"/>
62-
<SvgIcon name="octicon-x-circle-fill" class="red gt-mr-3 " v-else/>
49+
<ActionRunStatus :status="jobStep.status" class="gt-mr-3"/>
6350

6451
<span class="step-summary-msg">{{ jobStep.summary }}</span>
6552
<span class="step-summary-dur">{{ jobStep.duration }}</span>
@@ -76,6 +63,7 @@
7663

7764
<script>
7865
import {SvgIcon} from '../svg.js';
66+
import ActionRunStatus from './ActionRunStatus.vue';
7967
import {createApp} from 'vue';
8068
import AnsiToHTML from 'ansi-to-html';
8169
@@ -85,6 +73,7 @@ const sfc = {
8573
name: 'RepoActionView',
8674
components: {
8775
SvgIcon,
76+
ActionRunStatus,
8877
},
8978
props: {
9079
runIndex: String,

web_src/js/features/repo-legacy.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,14 @@ export function initRepoCommentForm() {
145145

146146
const clickedItem = $(this);
147147
const scope = $(this).attr('data-scope');
148-
const canRemoveScope = e.altKey;
149148

150149
$(this).parent().find('.item').each(function () {
151150
if (scope) {
152151
// Enable only clicked item for scoped labels
153152
if ($(this).attr('data-scope') !== scope) {
154153
return true;
155154
}
156-
if ($(this).is(clickedItem)) {
157-
if (!canRemoveScope && $(this).hasClass('checked')) {
158-
return true;
159-
}
160-
} else if (!$(this).hasClass('checked')) {
155+
if (!$(this).is(clickedItem) && !$(this).hasClass('checked')) {
161156
return true;
162157
}
163158
} else if (!$(this).is(clickedItem)) {

web_src/less/_repository.less

+17-2
Original file line numberDiff line numberDiff line change
@@ -1670,8 +1670,14 @@
16701670
align-items: center;
16711671

16721672
.file {
1673-
flex: 1;
1674-
word-break: break-all;
1673+
min-width: 0;
1674+
.file-link {
1675+
max-width: fit-content;
1676+
display: -webkit-box;
1677+
-webkit-box-orient: vertical;
1678+
-webkit-line-clamp: 2;
1679+
overflow: hidden;
1680+
}
16751681
}
16761682

16771683
.button {
@@ -3283,6 +3289,15 @@ td.blob-excerpt {
32833289
position: static;
32843290
}
32853291
}
3292+
3293+
.diff-file-header-actions {
3294+
flex-shrink: 0;
3295+
}
3296+
3297+
.diff-file-name {
3298+
flex: auto;
3299+
min-width: 100px;
3300+
}
32863301
}
32873302

32883303
.diff-file-body {

0 commit comments

Comments
 (0)