Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display archived labels specially when listing labels #26820

Merged
merged 51 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
530806f
Added archived label for org labels and added into issue filter list.
puni9869 Aug 30, 2023
9bf387a
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Aug 30, 2023
9b94b4f
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Aug 30, 2023
14d4646
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Aug 31, 2023
6f61aef
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Aug 31, 2023
404f4dd
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Aug 31, 2023
d8866d7
Ui fixes and changing archived label hint and ui
puni9869 Aug 31, 2023
fcee97b
Translations change
puni9869 Aug 31, 2023
f1168a4
Reordering the archive hint in org labels
puni9869 Aug 31, 2023
32f3917
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Aug 31, 2023
6e137e5
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Sep 1, 2023
df8ab39
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 1, 2023
541f1a4
Styling the label in label page and issue filter
puni9869 Sep 1, 2023
4b51542
Linter
puni9869 Sep 1, 2023
7b7a140
Linter
puni9869 Sep 1, 2023
e21e8d8
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 1, 2023
616eebd
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 1, 2023
5e97317
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 1, 2023
461c7a2
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 1, 2023
23b085b
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Sep 2, 2023
d54b658
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 2, 2023
a5dc43f
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 3, 2023
c81196b
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Sep 4, 2023
8a6193d
Removing all helper classes css
puni9869 Sep 4, 2023
3c993c3
Fixing linter
puni9869 Sep 4, 2023
434d51e
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 4, 2023
c07d039
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Sep 7, 2023
c171049
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 8, 2023
2209ad2
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 8, 2023
cd3aa05
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Sep 12, 2023
e3bf479
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 12, 2023
bf2c9ba
Adding archived template
puni9869 Sep 12, 2023
0243ab7
Adding archived template
puni9869 Sep 12, 2023
2ad4b8a
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 12, 2023
e3dd978
Adding archived template
puni9869 Sep 12, 2023
e538f73
Linter fix in css
puni9869 Sep 12, 2023
0e6ebfd
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 12, 2023
30db06d
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 13, 2023
0d497af
Remove the extra styles
puni9869 Sep 13, 2023
b0a427a
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 13, 2023
3658703
Adding height to archived box
puni9869 Sep 13, 2023
5bcd313
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 16, 2023
8687cff
Adding ui label basic mini
puni9869 Sep 16, 2023
bad0bd1
Merge branch 'go-gitea:main' into punit/Showing-archive-label-issue-f…
puni9869 Sep 16, 2023
64d0d12
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 16, 2023
147706b
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 16, 2023
c9516ed
Trying to add similar style in issue label filter
puni9869 Sep 16, 2023
3682eb8
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 17, 2023
1e01b58
override problematic style
silverwind Sep 17, 2023
b5919f3
Merge branch 'main' into punit/Showing-archive-label-issue-filter
puni9869 Sep 18, 2023
6117f22
Merge branch 'main' into punit/Showing-archive-label-issue-filter
GiteaBot Sep 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ unpin = Unpin

artifacts = Artifacts

archived = Archived

concept_system_global = Global
concept_user_individual = Individual
concept_code_repository = Repository
Expand Down Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion templates/repo/issue/filters.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@
<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 .}}
{{if .IsArchived}}
<span class="archived-label gt-ml-auto gt-font-12 gt-p-2 gt-border-secondary gt-rounded gt-jc gt-cursor-default">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have a .archived-label CSS selector for styles, why there are so many gt- helpers .....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reusability of helper class.
I can put all styles in that one class.
It will more clean that wise.

{{$.locale.Tr "archived"}}
</span>
{{end}}
</a>
{{end}}
</div>
</div>
Expand Down
38 changes: 23 additions & 15 deletions templates/repo/issue/labels/label_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -47,14 +42,21 @@
<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">
{{if .IsArchived}}
<span class="archived-label gt-font-12 gt-p-2 gt-border-secondary gt-rounded gt-jc gt-cursor-default" data-tooltip-content="{{$.locale.Tr "repo.issues.label_archive_tooltip"}}">
{{$.locale.Tr "archived"}}
</span>
{{end}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be suited for a new subtemplate.
Would reduce the changes from written thrice to once.
Plus, the first one is currently missing the tooltip.

<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}}
Expand All @@ -78,9 +80,15 @@
{{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">
{{if .IsArchived}}
<span class="archived-label gt-font-12 gt-p-2 gt-border-secondary gt-rounded gt-jc gt-cursor-default" data-tooltip-content="{{$.locale.Tr "repo.issues.label_archive_tooltip"}}">
{{$.locale.Tr "archived"}}
</span>
{{end}}
</div>
<div class="label-operation"></div>
</li>
{{end}}
{{end}}
Expand Down
9 changes: 8 additions & 1 deletion web_src/css/repo/issue-label.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

.issue-label-list .item .label-operation {
width: 33%;
text-align: right;
}

.issue-label-list .item a {
Expand All @@ -42,3 +41,11 @@
.issue-label-list .item.org-label {
opacity: 0.7;
}

.archived-label {
display: inline-flex;
width: fit-content;
height: fit-content;
color: var(--color-text-light);
background: var(--color-button);
}
Loading