summaryrefslogtreecommitdiffstats
path: root/templates/shared/label_filter.tmpl
blob: 2269271aacb470bf8ddd3d96eeff61f06756b8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!-- Label -->
<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter">
	<span class="text">
		{{ctx.Locale.Tr "repo.issues.filter_label"}}
	</span>
	{{svg "octicon-triangle-down" 14 "dropdown icon"}}
	<div class="menu">
		<div class="ui icon search input">
			<i class="icon">{{svg "octicon-search" 16}}</i>
			<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_label"}}">
		</div>
		<div class="ui checkbox compact archived-label-filter">
			<input name="archived" type="checkbox"
				id="archived-filter-checkbox"
				{{if .ShowArchivedLabels}}checked{{end}}
			>
			<label for="archived-filter-checkbox">
				{{ctx.Locale.Tr "repo.issues.label_archived_filter"}}
				<i class="tw-ml-1" data-tooltip-content={{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}>
					{{svg "octicon-info"}}
				</i>
			</label>
		</div>
		<span class="info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude"}}</span>
		<div class="divider"></div>
		<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>
		<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>
		{{$previousExclusiveScope := "_no_scope"}}
		{{range .Labels}}
			{{$exclusiveScope := .ExclusiveScope}}
			{{if and (ne $previousExclusiveScope $exclusiveScope)}}
				<div class="divider"></div>
			{{end}}
			{{$previousExclusiveScope = $exclusiveScope}}
			<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}}">
				{{if .IsExcluded}}
					{{svg "octicon-circle-slash"}}
				{{else if .IsSelected}}
					{{if $exclusiveScope}}
						{{svg "octicon-dot-fill"}}
					{{else}}
						{{svg "octicon-check"}}
					{{end}}
				{{end}}
				{{RenderLabel $.Context ctx.Locale .}}
				<p class="tw-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
			</a>
		{{end}}
	</div>
</div>