diff options
author | puni9869 <80308335+puni9869@users.noreply.github.com> | 2023-09-18 10:24:05 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-18 04:54:05 +0000 |
commit | a50d9af876435d007e6052c6ef8ebc838dd9709f (patch) | |
tree | 1e2d3b90ccfdcf307acab33577b3452b4b704918 | |
parent | e97baed800ed9b83c5634492205318ab0c820719 (diff) | |
download | gitea-a50d9af876435d007e6052c6ef8ebc838dd9709f.tar.gz gitea-a50d9af876435d007e6052c6ef8ebc838dd9709f.zip |
Display archived labels specially when listing labels (#26820)
Follow up https://github.com/go-gitea/gitea/pull/26741
Changes:
Added archived label for org labels and added into issue filter list.
Part of https://github.com/go-gitea/gitea/issues/25237
---------
Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
-rw-r--r-- | options/locale/locale_en-US.ini | 3 | ||||
-rw-r--r-- | templates/repo/issue/filters.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/issue/labels/label_archived.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/issue/labels/label_list.tmpl | 30 | ||||
-rw-r--r-- | web_src/css/base.css | 3 | ||||
-rw-r--r-- | web_src/css/repo/issue-label.css | 5 |
6 files changed, 32 insertions, 19 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e11d5167aa..74b8931de8 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -123,6 +123,8 @@ unpin = Unpin artifacts = Artifacts +archived = Archived + concept_system_global = Global concept_user_individual = Individual concept_code_repository = Repository @@ -317,7 +319,6 @@ filter_by_team_repositories = Filter by team repositories feed_of = Feed of "%s" show_archived = Archived -archived = Archived show_both_archived_unarchived = Showing both archived and unarchived show_only_archived = Showing only archived show_only_unarchived = Showing only unarchived diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl index b482e471e1..3bfced90d6 100644 --- a/templates/repo/issue/filters.tmpl +++ b/templates/repo/issue/filters.tmpl @@ -29,7 +29,10 @@ <div class="divider"></div> {{end}} {{$previousExclusiveScope = $exclusiveScope}} - <a class="item label-filter-item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}" data-label-id="{{.ID}}">{{if .IsExcluded}}{{svg "octicon-circle-slash"}}{{else if .IsSelected}}{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}{{end}} {{RenderLabel $.Context .}}</a> + <a class="item label-filter-item gt-df gt-ac" {{if .IsArchived}}data-is-archived{{end}} href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}" data-label-id="{{.ID}}">{{if .IsExcluded}}{{svg "octicon-circle-slash"}}{{else if .IsSelected}}{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}{{end}} + {{RenderLabel $.Context .}} + <p class="gt-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p> + </a> {{end}} </div> </div> diff --git a/templates/repo/issue/labels/label_archived.tmpl b/templates/repo/issue/labels/label_archived.tmpl new file mode 100644 index 0000000000..feaf77e456 --- /dev/null +++ b/templates/repo/issue/labels/label_archived.tmpl @@ -0,0 +1,5 @@ +{{if .IsArchived}} + <span class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}"> + {{ctx.Locale.Tr "archived"}} + </span> +{{end}} diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl index b29e606baa..d9addb439b 100644 --- a/templates/repo/issue/labels/label_list.tmpl +++ b/templates/repo/issue/labels/label_list.tmpl @@ -33,11 +33,6 @@ <li class="item"> <div class="label-title"> {{RenderLabel $.Context .}} - {{if not .ArchivedUnix.IsZero}} - <span class="gt-ml-3 gt-cursor-default gt-italic" data-tooltip-content="{{$.locale.Tr "repo.issues.label_archive_tooltip"}}"> - {{$.locale.Tr "home.archived"}} - </span> - {{end}} {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}} </div> <div class="label-issues"> @@ -47,14 +42,17 @@ <a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> {{end}} </div> - <div class="label-operation"> - {{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}} - <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a> - <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a> - {{else if $.PageIsOrgSettingsLabels}} - <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a> - <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a> - {{end}} + <div class="label-operation gt-df"> + {{template "repo/issue/labels/label_archived" .}} + <div class="gt-df gt-ml-auto"> + {{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}} + <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a> + <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a> + {{else if $.PageIsOrgSettingsLabels}} + <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a> + <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a> + {{end}} + </div> </div> </li> {{end}} @@ -78,9 +76,11 @@ {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}} </div> <div class="label-issues"> - <a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a> + <a class="open-issues" {{if .IsArchived}}data-is-archived{{end}} href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a> + </div> + <div class="label-operation"> + {{template "repo/issue/labels/label_archived" .}} </div> - <div class="label-operation"></div> </li> {{end}} {{end}} diff --git a/web_src/css/base.css b/web_src/css/base.css index b41bfc6942..a305701332 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1969,7 +1969,8 @@ a.ui.ui.ui.basic.primary.label:hover { } .ui.basic.labels .label, -.ui.basic.label { +.ui.basic.label, +.ui.secondary.labels .ui.basic.label { background: var(--color-button); border-color: var(--color-light-border); color: var(--color-text-light); diff --git a/web_src/css/repo/issue-label.css b/web_src/css/repo/issue-label.css index a2eb0344a5..1f83e81d96 100644 --- a/web_src/css/repo/issue-label.css +++ b/web_src/css/repo/issue-label.css @@ -30,7 +30,6 @@ .issue-label-list .item .label-operation { width: 33%; - text-align: right; } .issue-label-list .item a { @@ -42,3 +41,7 @@ .issue-label-list .item.org-label { opacity: 0.7; } + +.label-operation .label { + height: fit-content; +} |