-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
move issue filters to shared template #25729
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a32b1cd
move issue filters to shared template
denyskon 9adfd59
remove milestone page check from url
denyskon 306b3ce
Update filters.tmpl
denyskon 2d0b8af
Update templates/repo/issue/filters.tmpl
denyskon a9d128c
Merge branch 'main' into refactor/issue-filters
denyskon 86c23e0
Merge branch 'main' into refactor/issue-filters
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
<div id="issue-filters" class="issue-list-toolbar"> | ||
<div class="issue-list-toolbar-left"> | ||
{{if and ($.CanWriteIssuesOrPulls) (gt (len .Issues) 0)}} | ||
<input type="checkbox" autocomplete="off" class="issue-checkbox-all gt-mr-4" title="{{.locale.Tr "repo.issues.action_check_all"}}"> | ||
{{end}} | ||
{{template "repo/issue/openclose" .}} | ||
</div> | ||
<div class="issue-list-toolbar-right"> | ||
<div class="ui secondary filter menu labels"> | ||
<!-- Label --> | ||
<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter"> | ||
<span class="text"> | ||
{{.locale.Tr "repo.issues.filter_label"}} | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</span> | ||
<div class="menu"> | ||
<div class="ui icon search input"> | ||
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | ||
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_label"}}"> | ||
</div> | ||
<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span> | ||
<div class="divider"></div> | ||
denyskon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a> | ||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a> | ||
{{$previousExclusiveScope := "_no_scope"}} | ||
{{range .Labels}} | ||
{{$exclusiveScope := .ExclusiveScope}} | ||
{{if and (ne $previousExclusiveScope $exclusiveScope)}} | ||
denyskon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<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> | ||
{{end}} | ||
</div> | ||
</div> | ||
|
||
{{if not .Milestone}} | ||
denyskon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<!-- Milestone --> | ||
<div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item"> | ||
<span class="text"> | ||
{{.locale.Tr "repo.issues.filter_milestone"}} | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</span> | ||
<div class="menu"> | ||
<div class="ui icon search input"> | ||
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | ||
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_milestone"}}"> | ||
</div> | ||
<div class="divider"></div> | ||
<a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_milestone_all"}}</a> | ||
<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_milestone_none"}}</a> | ||
{{if .OpenMilestones}} | ||
<div class="divider"></div> | ||
<div class="header">{{.locale.Tr "repo.issues.filter_milestone_open"}}</div> | ||
{{range .OpenMilestones}} | ||
<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> | ||
{{svg "octicon-milestone" 16 "mr-2"}} | ||
{{.Name}} | ||
</a> | ||
{{end}} | ||
{{end}} | ||
{{if .ClosedMilestones}} | ||
<div class="divider"></div> | ||
<div class="header">{{.locale.Tr "repo.issues.filter_milestone_closed"}}</div> | ||
{{range .ClosedMilestones}} | ||
<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> | ||
{{svg "octicon-milestone" 16 "mr-2"}} | ||
{{.Name}} | ||
</a> | ||
{{end}} | ||
{{end}} | ||
</div> | ||
</div> | ||
{{end}} | ||
|
||
<!-- Project --> | ||
<div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item"> | ||
<span class="text"> | ||
{{.locale.Tr "repo.issues.filter_project"}} | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</span> | ||
<div class="menu"> | ||
<div class="ui icon search input"> | ||
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | ||
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}"> | ||
</div> | ||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a> | ||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a> | ||
{{if .OpenProjects}} | ||
<div class="divider"></div> | ||
<div class="header"> | ||
{{.locale.Tr "repo.issues.new.open_projects"}} | ||
</div> | ||
{{range .OpenProjects}} | ||
<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> | ||
{{svg .IconName 18 "gt-mr-3 gt-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span> | ||
</a> | ||
{{end}} | ||
{{end}} | ||
{{if .ClosedProjects}} | ||
<div class="divider"></div> | ||
<div class="header"> | ||
{{.locale.Tr "repo.issues.new.closed_projects"}} | ||
</div> | ||
{{range .ClosedProjects}} | ||
<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> | ||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}} | ||
</a> | ||
{{end}} | ||
{{end}} | ||
</div> | ||
</div> | ||
|
||
<!-- Author --> | ||
<div class="ui dropdown jump item user-remote-search" data-tooltip-content="{{.locale.Tr "repo.author_search_tooltip"}}" | ||
data-search-url="{{if .Milestone}}{{$.RepoLink}}/issues/posters{{else}}{{$.Link}}/posters{{end}}" | ||
denyskon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
data-selected-user-id="{{$.PosterID}}" | ||
data-action-jump-url="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={user_id}" | ||
> | ||
<span class="text"> | ||
{{.locale.Tr "repo.issues.filter_poster"}} | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</span> | ||
<div class="menu"> | ||
<div class="ui icon search input"> | ||
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | ||
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_poster"}}"> | ||
</div> | ||
<a class="item" data-value="0">{{.locale.Tr "repo.issues.filter_poster_no_select"}}</a> | ||
</div> | ||
</div> | ||
|
||
<!-- Assignee --> | ||
<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item"> | ||
<span class="text"> | ||
{{.locale.Tr "repo.issues.filter_assignee"}} | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</span> | ||
<div class="menu"> | ||
<div class="ui icon search input"> | ||
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> | ||
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}"> | ||
</div> | ||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a> | ||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a> | ||
<div class="divider"></div> | ||
denyskon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{range .Assignees}} | ||
<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}"> | ||
{{avatar $.Context . 20}}{{template "repo/search_name" .}} | ||
</a> | ||
{{end}} | ||
</div> | ||
</div> | ||
|
||
{{if .IsSigned}} | ||
<!-- Type --> | ||
<div class="ui dropdown type jump item"> | ||
<span class="text"> | ||
{{.locale.Tr "repo.issues.filter_type"}} | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</span> | ||
<div class="menu"> | ||
<a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.all_issues"}}</a> | ||
<a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> | ||
<a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.created_by_you"}}</a> | ||
{{if .PageIsPullList}} | ||
<a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.review_requested"}}</a> | ||
<a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a> | ||
{{end}} | ||
<a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> | ||
</div> | ||
</div> | ||
{{end}} | ||
|
||
<!-- Sort --> | ||
<div class="list-header-sort ui small dropdown downward type jump item"> | ||
<span class="text"> | ||
{{.locale.Tr "repo.issues.filter_sort"}} | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</span> | ||
<div class="menu"> | ||
<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a> | ||
<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a> | ||
<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> | ||
<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> | ||
<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.mostcomment"}}</a> | ||
<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastcomment"}}</a> | ||
<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.nearduedate"}}</a> | ||
<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.farduedate"}}</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.