-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Archive labels UI #26502
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
Archive labels UI #26502
Changes from all commits
c4b1cd1
3a87634
f6684fc
1cb8b30
9cf9b5d
99fadb9
197a603
c5447e5
f0752e0
44d24ac
903a794
fe05e02
b2cc90c
ce44b9a
5a78bd9
2008377
1957b88
39b135b
0786a6f
24fb5c8
1418372
d97c86e
fe2c4da
af7db84
7fa50dd
9502271
c9e2b53
129c231
9f59b74
35f1025
6576804
6cea026
0edd269
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -113,10 +113,10 @@ func (l *Label) CalOpenIssues() { | |||||
|
||||||
// SetArchived set the label as archived | ||||||
func (l *Label) SetArchived(isArchived bool) { | ||||||
if isArchived && l.ArchivedUnix.IsZero() { | ||||||
l.ArchivedUnix = timeutil.TimeStampNow() | ||||||
} else { | ||||||
if !isArchived { | ||||||
l.ArchivedUnix = timeutil.TimeStamp(0) | ||||||
} else if isArchived && l.ArchivedUnix.IsZero() { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
l.ArchivedUnix = timeutil.TimeStampNow() | ||||||
} | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm… I've thought about what the best design for it is. <h4 class="ui top attached header gt-df">
<span class="gt-f1">18 labels</span>
<label class="gt-f1"><input type="checkbox" class="show-archived-labels-checkbox"> Show archived labels</label>
<div class="gt-f1">…
</h4> ) document.querySelector('.show-archived-labels-checkbox').addEventListener('input',
e => for(const archivedLabel of document.querySelectorAll('.archived-label'))
toggleElem(archivedLabel, e.target.checked)
)
); We should highlight the archived labels, i.e. by using a different background for them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That way, we don't need a separate page, hide unnecessary information by default, add no technical debt but still allow configuring anything the user wants to configure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, this UI is good and easy to use. here is the implementation https://github.com/go-gitea/gitea/pull/26511/files |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,28 @@ | ||||||||||||||||||
<h4 class="ui top attached header"> | ||||||||||||||||||
{{.locale.Tr "repo.issues.label_count" .NumLabels}} | ||||||||||||||||||
{{if eq .NumLabels 0}} | ||||||||||||||||||
{{.locale.Tr "repo.issues.label_count" .NumLabels}} | ||||||||||||||||||
{{else}} | ||||||||||||||||||
<span> | ||||||||||||||||||
<a class="text light" href="{{.Link}}">{{.locale.Tr "repo.issues.active_label_count" .NumNonArchivedLabels}}</a> | ||||||||||||||||||
</span> | ||||||||||||||||||
{{if gt .NumArchivedLabels 0}} | ||||||||||||||||||
<span class="gt-ml-2"> | ||||||||||||||||||
<a class="text light" href="{{.Link}}?archived_label=true">{{.locale.Tr "repo.issues.archived_label_count" .NumArchivedLabels}}</a> | ||||||||||||||||||
</span> | ||||||||||||||||||
<i class="gt-dif gt-ml-1 gt-mt-3" data-tooltip-content={{.locale.Tr "repo.issues.label_archive_tooltip"}}> | ||||||||||||||||||
{{svg "octicon-info" 12}} | ||||||||||||||||||
</i> | ||||||||||||||||||
{{end}} | ||||||||||||||||||
{{end}} | ||||||||||||||||||
|
||||||||||||||||||
<div class="gt-dif gt-jc label-category"> | ||||||||||||||||||
{{if not .IsPageArchivedLabels}} | ||||||||||||||||||
{{.locale.Tr "repo.issues.active_labels"}} | ||||||||||||||||||
{{else}} | ||||||||||||||||||
{{.locale.Tr "repo.issues.archived_labels"}} | ||||||||||||||||||
{{end}} | ||||||||||||||||||
</div> | ||||||||||||||||||
|
||||||||||||||||||
<div class="ui right"> | ||||||||||||||||||
<div class="ui right floated secondary filter menu"> | ||||||||||||||||||
<!-- Sort --> | ||||||||||||||||||
|
@@ -9,10 +32,11 @@ | |||||||||||||||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||||||||||||||||||
</span> | ||||||||||||||||||
<div class="menu"> | ||||||||||||||||||
<a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> | ||||||||||||||||||
<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> | ||||||||||||||||||
<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a> | ||||||||||||||||||
<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a> | ||||||||||||||||||
|
||||||||||||||||||
<a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}&archived_label={{if .IsPageArchivedLabels}}true{{end}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> | ||||||||||||||||||
<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}&archived_label={{if .IsPageArchivedLabels}}true{{end}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> | ||||||||||||||||||
<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}&archived_label={{if .IsPageArchivedLabels}}true{{end}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a> | ||||||||||||||||||
<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}&archived_label={{if .IsPageArchivedLabels}}true{{end}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a> | ||||||||||||||||||
Comment on lines
+36
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
</div> | ||||||||||||||||||
</div> | ||||||||||||||||||
</div> | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,8 @@ | |
.issue-label-list .item.org-label { | ||
opacity: 0.7; | ||
} | ||
|
||
.label-category { | ||
width: 55%; | ||
margin-left: auto; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you're absolutely right.
I missed that edge case.