loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request '[BUG] Ensure all filters are persistent in issue filters' (#4852) from gusted/forgejo-filter-links into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4852
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>

+365 -35
+31 -31
templates/repo/issue/filter_list.tmpl
··· 3 3 4 4 {{if not .Milestone}} 5 5 <!-- Milestone --> 6 - <div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item"> 6 + <div class="list-header-milestone ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item"> 7 7 <span class="text"> 8 8 {{ctx.Locale.Tr "repo.issues.filter_milestone"}} 9 9 </span> ··· 14 14 <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}"> 15 15 </div> 16 16 <div class="divider"></div> 17 - <a rel="nofollow" class="{{if not $.MilestoneID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a> 18 - <a rel="nofollow" class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a> 17 + <a rel="nofollow" class="{{if not $.MilestoneID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a> 18 + <a rel="nofollow" class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a> 19 19 {{if .OpenMilestones}} 20 20 <div class="divider"></div> 21 21 <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div> 22 22 {{range .OpenMilestones}} 23 - <a rel="nofollow" class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 23 + <a rel="nofollow" class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 24 24 {{svg "octicon-milestone" 16 "mr-2"}} 25 25 {{.Name}} 26 26 </a> ··· 30 30 <div class="divider"></div> 31 31 <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div> 32 32 {{range .ClosedMilestones}} 33 - <a rel="nofollow" class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 33 + <a rel="nofollow" class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 34 34 {{svg "octicon-milestone" 16 "mr-2"}} 35 35 {{.Name}} 36 36 </a> ··· 41 41 {{end}} 42 42 43 43 <!-- Project --> 44 - <div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item"> 44 + <div class="list-header-project ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item"> 45 45 <span class="text"> 46 46 {{ctx.Locale.Tr "repo.issues.filter_project"}} 47 47 </span> ··· 51 51 <i class="icon">{{svg "octicon-search" 16}}</i> 52 52 <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_project"}}"> 53 53 </div> 54 - <a rel="nofollow" class="{{if not .ProjectID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_project_all"}}</a> 55 - <a rel="nofollow" class="{{if eq .ProjectID -1}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_project_none"}}</a> 54 + <a rel="nofollow" class="{{if not .ProjectID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project=&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_project_all"}}</a> 55 + <a rel="nofollow" class="{{if eq .ProjectID -1}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_project_none"}}</a> 56 56 {{if .OpenProjects}} 57 57 <div class="divider"></div> 58 58 <div class="header"> 59 59 {{ctx.Locale.Tr "repo.issues.new.open_projects"}} 60 60 </div> 61 61 {{range .OpenProjects}} 62 - <a rel="nofollow" class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item tw-flex" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 62 + <a rel="nofollow" class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item tw-flex" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 63 63 {{svg .IconName 18 "tw-mr-2 tw-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span> 64 64 </a> 65 65 {{end}} ··· 70 70 {{ctx.Locale.Tr "repo.issues.new.closed_projects"}} 71 71 </div> 72 72 {{range .ClosedProjects}} 73 - <a rel="nofollow" class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 73 + <a rel="nofollow" class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 74 74 {{svg .IconName 18 "tw-mr-2"}}{{.Title}} 75 75 </a> 76 76 {{end}} ··· 79 79 </div> 80 80 81 81 <!-- Author --> 82 - <div class="ui dropdown jump item user-remote-search" data-tooltip-content="{{ctx.Locale.Tr "repo.author_search_tooltip"}}" 82 + <div class="list-header-author ui dropdown jump item user-remote-search" data-tooltip-content="{{ctx.Locale.Tr "repo.author_search_tooltip"}}" 83 83 data-search-url="{{if .Milestone}}{{$.RepoLink}}/issues/posters{{else}}{{$.Link}}/posters{{end}}" 84 84 data-selected-user-id="{{$.PosterID}}" 85 - data-action-jump-url="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={user_id}{{if $.ShowArchivedLabels}}&archived=true{{end}}" 85 + data-action-jump-url="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&fuzzy={{$.IsFuzzy}}&poster={user_id}{{if $.ShowArchivedLabels}}&archived=true{{end}}" 86 86 > 87 87 <span class="text"> 88 88 {{ctx.Locale.Tr "repo.issues.filter_poster"}} ··· 98 98 </div> 99 99 100 100 <!-- Assignee --> 101 - <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item"> 101 + <div class="list-header-assignee ui {{if not .Assignees}}disabled{{end}} dropdown jump item"> 102 102 <span class="text"> 103 103 {{ctx.Locale.Tr "repo.issues.filter_assignee"}} 104 104 </span> ··· 108 108 <i class="icon">{{svg "octicon-search" 16}}</i> 109 109 <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignee"}}"> 110 110 </div> 111 - <a rel="nofollow" class="{{if not .AssigneeID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_select"}}</a> 112 - <a rel="nofollow" class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a> 111 + <a rel="nofollow" class="{{if not .AssigneeID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_select"}}</a> 112 + <a rel="nofollow" class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a> 113 113 <div class="divider"></div> 114 114 {{range .Assignees}} 115 - <a rel="nofollow" class="{{if eq $.AssigneeID .ID}}active selected{{end}} item tw-flex" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 115 + <a rel="nofollow" class="{{if eq $.AssigneeID .ID}}active selected{{end}} item tw-flex" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}"> 116 116 {{ctx.AvatarUtils.Avatar . 20}}{{template "repo/search_name" .}} 117 117 </a> 118 118 {{end}} ··· 121 121 122 122 {{if .IsSigned}} 123 123 <!-- Type --> 124 - <div class="ui dropdown type jump item"> 124 + <div class="list-header-type ui dropdown type jump item"> 125 125 <span class="text"> 126 126 {{ctx.Locale.Tr "repo.issues.filter_type"}} 127 127 </span> 128 128 {{svg "octicon-triangle-down" 14 "dropdown icon"}} 129 129 <div class="menu"> 130 - <a rel="nofollow" class="{{if eq .ViewType "all"}}active {{end}}item" href="?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}</a> 131 - <a rel="nofollow" class="{{if eq .ViewType "assigned"}}active {{end}}item" href="?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> 132 - <a rel="nofollow" class="{{if eq .ViewType "created_by"}}active {{end}}item" href="?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a> 130 + <a rel="nofollow" class="{{if eq .ViewType "all"}}active {{end}}item" href="?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}</a> 131 + <a rel="nofollow" class="{{if eq .ViewType "assigned"}}active {{end}}item" href="?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> 132 + <a rel="nofollow" class="{{if eq .ViewType "created_by"}}active {{end}}item" href="?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a> 133 133 {{if .PageIsPullList}} 134 - <a rel="nofollow" class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}</a> 135 - <a rel="nofollow" class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a> 134 + <a rel="nofollow" class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}</a> 135 + <a rel="nofollow" class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a> 136 136 {{end}} 137 - <a rel="nofollow" class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> 137 + <a rel="nofollow" class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> 138 138 </div> 139 139 </div> 140 140 {{end}} ··· 146 146 </span> 147 147 {{svg "octicon-triangle-down" 14 "dropdown icon"}} 148 148 <div class="menu"> 149 - <a rel="nofollow" class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> 150 - <a rel="nofollow" class="{{if eq .SortType "oldest"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> 151 - <a rel="nofollow" class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> 152 - <a rel="nofollow" class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> 153 - <a rel="nofollow" class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a> 154 - <a rel="nofollow" class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a> 155 - <a rel="nofollow" class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a> 156 - <a rel="nofollow" class="{{if eq .SortType "farduedate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a> 149 + <a rel="nofollow" class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> 150 + <a rel="nofollow" class="{{if eq .SortType "oldest"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> 151 + <a rel="nofollow" class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> 152 + <a rel="nofollow" class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> 153 + <a rel="nofollow" class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a> 154 + <a rel="nofollow" class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a> 155 + <a rel="nofollow" class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a> 156 + <a rel="nofollow" class="{{if eq .SortType "farduedate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a> 157 157 </div> 158 158 </div>
+1 -1
templates/shared/issuelist.tmpl
··· 21 21 {{end}} 22 22 <span class="labels-list tw-ml-1"> 23 23 {{range .Labels}} 24 - <a href="?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}{{if ne $.listType "milestone"}}&milestone={{$.MilestoneID}}{{end}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{RenderLabel $.Context ctx.Locale .}}</a> 24 + <a href="?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}{{if ne $.listType "milestone"}}&milestone={{$.MilestoneID}}{{end}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{RenderLabel $.Context ctx.Locale .}}</a> 25 25 {{end}} 26 26 </span> 27 27 </div>
+3 -3
templates/shared/label_filter.tmpl
··· 23 23 </div> 24 24 <span class="info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude"}}</span> 25 25 <div class="divider"></div> 26 - <a rel="nofollow" class="{{if .AllLabels}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a> 27 - <a rel="nofollow" class="{{if .NoLabel}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a> 26 + <a rel="nofollow" class="{{if .AllLabels}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a> 27 + <a rel="nofollow" class="{{if .NoLabel}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a> 28 28 {{$previousExclusiveScope := "_no_scope"}} 29 29 {{range .Labels}} 30 30 {{$exclusiveScope := .ExclusiveScope}} ··· 32 32 <div class="divider"></div> 33 33 {{end}} 34 34 {{$previousExclusiveScope = $exclusiveScope}} 35 - <a rel="nofollow" class="item label-filter-item tw-flex tw-items-center" {{if .IsArchived}}data-is-archived{{end}} href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&labels={{.QueryString}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}" data-label-id="{{.ID}}"> 35 + <a rel="nofollow" class="item label-filter-item tw-flex tw-items-center" {{if .IsArchived}}data-is-archived{{end}} href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&labels={{.QueryString}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}&fuzzy={{$.IsFuzzy}}{{if $.ShowArchivedLabels}}&archived=true{{end}}" data-label-id="{{.ID}}"> 36 36 {{if .IsExcluded}} 37 37 {{svg "octicon-circle-slash"}} 38 38 {{else if .IsSelected}}
+330
tests/integration/repo_test.go
··· 1047 1047 MakeRequest(t, req, http.StatusNotFound) 1048 1048 }) 1049 1049 } 1050 + 1051 + func TestRepoIssueFilterLinks(t *testing.T) { 1052 + defer tests.PrepareTestEnv(t)() 1053 + 1054 + t.Run("No filters", func(t *testing.T) { 1055 + defer tests.PrintCurrentTest(t)() 1056 + 1057 + req := NewRequest(t, "GET", "/user2/repo1/issues") 1058 + resp := MakeRequest(t, req, http.StatusOK) 1059 + htmlDoc := NewHTMLParser(t, resp.Body) 1060 + 1061 + called := false 1062 + htmlDoc.Find("#issue-filters a[href^='?']").Each(func(_ int, s *goquery.Selection) { 1063 + called = true 1064 + href, _ := s.Attr("href") 1065 + assert.Contains(t, href, "?q=&") 1066 + assert.Contains(t, href, "&type=") 1067 + assert.Contains(t, href, "&sort=") 1068 + assert.Contains(t, href, "&state=") 1069 + assert.Contains(t, href, "&labels=") 1070 + assert.Contains(t, href, "&milestone=") 1071 + assert.Contains(t, href, "&project=") 1072 + assert.Contains(t, href, "&assignee=") 1073 + assert.Contains(t, href, "&poster=") 1074 + assert.Contains(t, href, "&fuzzy=") 1075 + }) 1076 + assert.True(t, called) 1077 + }) 1078 + 1079 + t.Run("Keyword", func(t *testing.T) { 1080 + defer tests.PrintCurrentTest(t)() 1081 + 1082 + req := NewRequest(t, "GET", "/user2/repo1/issues?q=search-on-this") 1083 + resp := MakeRequest(t, req, http.StatusOK) 1084 + htmlDoc := NewHTMLParser(t, resp.Body) 1085 + 1086 + called := false 1087 + htmlDoc.Find("#issue-filters a[href^='?']").Each(func(_ int, s *goquery.Selection) { 1088 + called = true 1089 + href, _ := s.Attr("href") 1090 + assert.Contains(t, href, "?q=search-on-this") 1091 + assert.Contains(t, href, "&type=") 1092 + assert.Contains(t, href, "&sort=") 1093 + assert.Contains(t, href, "&state=") 1094 + assert.Contains(t, href, "&labels=") 1095 + assert.Contains(t, href, "&milestone=") 1096 + assert.Contains(t, href, "&project=") 1097 + assert.Contains(t, href, "&assignee=") 1098 + assert.Contains(t, href, "&poster=") 1099 + assert.Contains(t, href, "&fuzzy=") 1100 + }) 1101 + assert.True(t, called) 1102 + }) 1103 + 1104 + t.Run("Fuzzy", func(t *testing.T) { 1105 + defer tests.PrintCurrentTest(t)() 1106 + 1107 + req := NewRequest(t, "GET", "/user2/repo1/issues?fuzzy=true") 1108 + resp := MakeRequest(t, req, http.StatusOK) 1109 + htmlDoc := NewHTMLParser(t, resp.Body) 1110 + 1111 + called := false 1112 + htmlDoc.Find("#issue-filters a[href^='?']").Each(func(_ int, s *goquery.Selection) { 1113 + called = true 1114 + href, _ := s.Attr("href") 1115 + assert.Contains(t, href, "?q=&") 1116 + assert.Contains(t, href, "&type=") 1117 + assert.Contains(t, href, "&sort=") 1118 + assert.Contains(t, href, "&state=") 1119 + assert.Contains(t, href, "&labels=") 1120 + assert.Contains(t, href, "&milestone=") 1121 + assert.Contains(t, href, "&project=") 1122 + assert.Contains(t, href, "&assignee=") 1123 + assert.Contains(t, href, "&poster=") 1124 + assert.Contains(t, href, "&fuzzy=true") 1125 + }) 1126 + assert.True(t, called) 1127 + }) 1128 + 1129 + t.Run("Sort", func(t *testing.T) { 1130 + defer tests.PrintCurrentTest(t)() 1131 + 1132 + req := NewRequest(t, "GET", "/user2/repo1/issues?sort=oldest") 1133 + resp := MakeRequest(t, req, http.StatusOK) 1134 + htmlDoc := NewHTMLParser(t, resp.Body) 1135 + 1136 + called := false 1137 + htmlDoc.Find("#issue-filters a[href^='?']:not(.list-header-sort a)").Each(func(_ int, s *goquery.Selection) { 1138 + called = true 1139 + href, _ := s.Attr("href") 1140 + assert.Contains(t, href, "?q=&") 1141 + assert.Contains(t, href, "&type=") 1142 + assert.Contains(t, href, "&sort=oldest") 1143 + assert.Contains(t, href, "&state=") 1144 + assert.Contains(t, href, "&labels=") 1145 + assert.Contains(t, href, "&milestone=") 1146 + assert.Contains(t, href, "&project=") 1147 + assert.Contains(t, href, "&assignee=") 1148 + assert.Contains(t, href, "&poster=") 1149 + assert.Contains(t, href, "&fuzzy=") 1150 + }) 1151 + assert.True(t, called) 1152 + }) 1153 + 1154 + t.Run("Type", func(t *testing.T) { 1155 + defer tests.PrintCurrentTest(t)() 1156 + 1157 + req := NewRequest(t, "GET", "/user2/repo1/issues?type=assigned") 1158 + resp := MakeRequest(t, req, http.StatusOK) 1159 + htmlDoc := NewHTMLParser(t, resp.Body) 1160 + 1161 + called := false 1162 + htmlDoc.Find("#issue-filters a[href^='?']:not(.list-header-type a)").Each(func(_ int, s *goquery.Selection) { 1163 + called = true 1164 + href, _ := s.Attr("href") 1165 + assert.Contains(t, href, "?q=&") 1166 + assert.Contains(t, href, "&type=assigned") 1167 + assert.Contains(t, href, "&sort=") 1168 + assert.Contains(t, href, "&state=") 1169 + assert.Contains(t, href, "&labels=") 1170 + assert.Contains(t, href, "&milestone=") 1171 + assert.Contains(t, href, "&project=") 1172 + assert.Contains(t, href, "&assignee=") 1173 + assert.Contains(t, href, "&poster=") 1174 + assert.Contains(t, href, "&fuzzy=") 1175 + }) 1176 + assert.True(t, called) 1177 + }) 1178 + 1179 + t.Run("State", func(t *testing.T) { 1180 + defer tests.PrintCurrentTest(t)() 1181 + 1182 + req := NewRequest(t, "GET", "/user2/repo1/issues?state=closed") 1183 + resp := MakeRequest(t, req, http.StatusOK) 1184 + htmlDoc := NewHTMLParser(t, resp.Body) 1185 + 1186 + called := false 1187 + htmlDoc.Find("#issue-filters a[href^='?']:not(.issue-list-toolbar-left a)").Each(func(_ int, s *goquery.Selection) { 1188 + called = true 1189 + href, _ := s.Attr("href") 1190 + assert.Contains(t, href, "?q=&") 1191 + assert.Contains(t, href, "&type=") 1192 + assert.Contains(t, href, "&sort=") 1193 + assert.Contains(t, href, "&state=closed") 1194 + assert.Contains(t, href, "&labels=") 1195 + assert.Contains(t, href, "&milestone=") 1196 + assert.Contains(t, href, "&project=") 1197 + assert.Contains(t, href, "&assignee=") 1198 + assert.Contains(t, href, "&poster=") 1199 + assert.Contains(t, href, "&fuzzy=") 1200 + }) 1201 + assert.True(t, called) 1202 + }) 1203 + 1204 + t.Run("Miilestone", func(t *testing.T) { 1205 + defer tests.PrintCurrentTest(t)() 1206 + 1207 + req := NewRequest(t, "GET", "/user2/repo1/issues?milestone=1") 1208 + resp := MakeRequest(t, req, http.StatusOK) 1209 + htmlDoc := NewHTMLParser(t, resp.Body) 1210 + 1211 + called := false 1212 + htmlDoc.Find("#issue-filters a[href^='?']:not(.list-header-milestone a)").Each(func(_ int, s *goquery.Selection) { 1213 + called = true 1214 + href, _ := s.Attr("href") 1215 + assert.Contains(t, href, "?q=&") 1216 + assert.Contains(t, href, "&type=") 1217 + assert.Contains(t, href, "&sort=") 1218 + assert.Contains(t, href, "&state=") 1219 + assert.Contains(t, href, "&labels=") 1220 + assert.Contains(t, href, "&milestone=1") 1221 + assert.Contains(t, href, "&project=") 1222 + assert.Contains(t, href, "&assignee=") 1223 + assert.Contains(t, href, "&poster=") 1224 + assert.Contains(t, href, "&fuzzy=") 1225 + }) 1226 + assert.True(t, called) 1227 + }) 1228 + 1229 + t.Run("Milestone", func(t *testing.T) { 1230 + defer tests.PrintCurrentTest(t)() 1231 + 1232 + req := NewRequest(t, "GET", "/user2/repo1/issues?milestone=1") 1233 + resp := MakeRequest(t, req, http.StatusOK) 1234 + htmlDoc := NewHTMLParser(t, resp.Body) 1235 + 1236 + called := false 1237 + htmlDoc.Find("#issue-filters a[href^='?']:not(.list-header-milestone a)").Each(func(_ int, s *goquery.Selection) { 1238 + called = true 1239 + href, _ := s.Attr("href") 1240 + assert.Contains(t, href, "?q=&") 1241 + assert.Contains(t, href, "&type=") 1242 + assert.Contains(t, href, "&sort=") 1243 + assert.Contains(t, href, "&state=") 1244 + assert.Contains(t, href, "&labels=") 1245 + assert.Contains(t, href, "&milestone=1") 1246 + assert.Contains(t, href, "&project=") 1247 + assert.Contains(t, href, "&assignee=") 1248 + assert.Contains(t, href, "&poster=") 1249 + assert.Contains(t, href, "&fuzzy=") 1250 + }) 1251 + assert.True(t, called) 1252 + }) 1253 + 1254 + t.Run("Project", func(t *testing.T) { 1255 + defer tests.PrintCurrentTest(t)() 1256 + 1257 + req := NewRequest(t, "GET", "/user2/repo1/issues?project=1") 1258 + resp := MakeRequest(t, req, http.StatusOK) 1259 + htmlDoc := NewHTMLParser(t, resp.Body) 1260 + 1261 + called := false 1262 + htmlDoc.Find("#issue-filters a[href^='?']:not(.list-header-project a)").Each(func(_ int, s *goquery.Selection) { 1263 + called = true 1264 + href, _ := s.Attr("href") 1265 + assert.Contains(t, href, "?q=&") 1266 + assert.Contains(t, href, "&type=") 1267 + assert.Contains(t, href, "&sort=") 1268 + assert.Contains(t, href, "&state=") 1269 + assert.Contains(t, href, "&labels=") 1270 + assert.Contains(t, href, "&milestone=") 1271 + assert.Contains(t, href, "&project=1") 1272 + assert.Contains(t, href, "&assignee=") 1273 + assert.Contains(t, href, "&poster=") 1274 + assert.Contains(t, href, "&fuzzy=") 1275 + }) 1276 + assert.True(t, called) 1277 + }) 1278 + 1279 + t.Run("Assignee", func(t *testing.T) { 1280 + defer tests.PrintCurrentTest(t)() 1281 + 1282 + req := NewRequest(t, "GET", "/user2/repo1/issues?assignee=1") 1283 + resp := MakeRequest(t, req, http.StatusOK) 1284 + htmlDoc := NewHTMLParser(t, resp.Body) 1285 + 1286 + called := false 1287 + htmlDoc.Find("#issue-filters a[href^='?']:not(.list-header-assignee a)").Each(func(_ int, s *goquery.Selection) { 1288 + called = true 1289 + href, _ := s.Attr("href") 1290 + assert.Contains(t, href, "?q=&") 1291 + assert.Contains(t, href, "&type=") 1292 + assert.Contains(t, href, "&sort=") 1293 + assert.Contains(t, href, "&state=") 1294 + assert.Contains(t, href, "&labels=") 1295 + assert.Contains(t, href, "&milestone=") 1296 + assert.Contains(t, href, "&project=") 1297 + assert.Contains(t, href, "&assignee=1") 1298 + assert.Contains(t, href, "&poster=") 1299 + assert.Contains(t, href, "&fuzzy=") 1300 + }) 1301 + assert.True(t, called) 1302 + }) 1303 + 1304 + t.Run("Poster", func(t *testing.T) { 1305 + defer tests.PrintCurrentTest(t)() 1306 + 1307 + req := NewRequest(t, "GET", "/user2/repo1/issues?poster=1") 1308 + resp := MakeRequest(t, req, http.StatusOK) 1309 + htmlDoc := NewHTMLParser(t, resp.Body) 1310 + 1311 + called := false 1312 + htmlDoc.Find("#issue-filters a[href^='?']:not(.list-header-poster a)").Each(func(_ int, s *goquery.Selection) { 1313 + called = true 1314 + href, _ := s.Attr("href") 1315 + assert.Contains(t, href, "?q=&") 1316 + assert.Contains(t, href, "&type=") 1317 + assert.Contains(t, href, "&sort=") 1318 + assert.Contains(t, href, "&state=") 1319 + assert.Contains(t, href, "&labels=") 1320 + assert.Contains(t, href, "&milestone=") 1321 + assert.Contains(t, href, "&project=") 1322 + assert.Contains(t, href, "&assignee=") 1323 + assert.Contains(t, href, "&poster=1") 1324 + assert.Contains(t, href, "&fuzzy=") 1325 + }) 1326 + assert.True(t, called) 1327 + }) 1328 + 1329 + t.Run("Labels", func(t *testing.T) { 1330 + defer tests.PrintCurrentTest(t)() 1331 + 1332 + req := NewRequest(t, "GET", "/user2/repo1/issues?labels=1") 1333 + resp := MakeRequest(t, req, http.StatusOK) 1334 + htmlDoc := NewHTMLParser(t, resp.Body) 1335 + 1336 + called := false 1337 + htmlDoc.Find("#issue-filters a[href^='?']:not(.label-filter a)").Each(func(_ int, s *goquery.Selection) { 1338 + called = true 1339 + href, _ := s.Attr("href") 1340 + assert.Contains(t, href, "?q=&") 1341 + assert.Contains(t, href, "&type=") 1342 + assert.Contains(t, href, "&sort=") 1343 + assert.Contains(t, href, "&state=") 1344 + assert.Contains(t, href, "&labels=1") 1345 + assert.Contains(t, href, "&milestone=") 1346 + assert.Contains(t, href, "&project=") 1347 + assert.Contains(t, href, "&assignee=") 1348 + assert.Contains(t, href, "&poster=") 1349 + assert.Contains(t, href, "&fuzzy=") 1350 + }) 1351 + assert.True(t, called) 1352 + }) 1353 + 1354 + t.Run("Archived labels", func(t *testing.T) { 1355 + defer tests.PrintCurrentTest(t)() 1356 + 1357 + req := NewRequest(t, "GET", "/user2/repo1/issues?archived=true") 1358 + resp := MakeRequest(t, req, http.StatusOK) 1359 + htmlDoc := NewHTMLParser(t, resp.Body) 1360 + 1361 + called := false 1362 + htmlDoc.Find("#issue-filters a[href^='?']").Each(func(_ int, s *goquery.Selection) { 1363 + called = true 1364 + href, _ := s.Attr("href") 1365 + assert.Contains(t, href, "?q=&") 1366 + assert.Contains(t, href, "&type=") 1367 + assert.Contains(t, href, "&sort=") 1368 + assert.Contains(t, href, "&state=") 1369 + assert.Contains(t, href, "&labels=") 1370 + assert.Contains(t, href, "&milestone=") 1371 + assert.Contains(t, href, "&project=") 1372 + assert.Contains(t, href, "&assignee=") 1373 + assert.Contains(t, href, "&poster=") 1374 + assert.Contains(t, href, "&fuzzy=") 1375 + assert.Contains(t, href, "&archived=true") 1376 + }) 1377 + assert.True(t, called) 1378 + }) 1379 + }