summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/milestone/select_menu.tmpl
blob: 570acc2eee73a0d25b89659df62e84e40d23c986 (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
{{$useHTMX := not .NewIssuePage}}
{{if or .OpenMilestones .ClosedMilestones}}
	<div class="ui icon search input">
		<i class="icon">{{svg "octicon-search" 16}}</i>
		<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
	</div>
	<div class="divider"></div>
{{end}}
<div class="no-select item"{{if $useHTMX}} hx-post="{{$.RepoLink}}/issues/milestone?issue_ids={{$.Issue.ID}}&htmx=true"{{end}}>{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
{{if and (not .OpenMilestones) (not .ClosedMilestones)}}
	<div class="disabled item">
		{{ctx.Locale.Tr "repo.issues.new.no_items"}}
	</div>
{{else}}
	{{if .OpenMilestones}}
		<div class="divider"></div>
		<div class="header">
			{{ctx.Locale.Tr "repo.issues.new.open_milestone"}}
		</div>
		{{range .OpenMilestones}}
			<a class="item"{{if $useHTMX}} hx-post="{{$.RepoLink}}/issues/milestone?id={{.ID}}&issue_ids={{$.Issue.ID}}&htmx=true"{{else}} data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"{{end}}>
				{{svg "octicon-milestone" 16 "tw-mr-1"}}
				{{.Name}}
			</a>
		{{end}}
	{{end}}
	{{if .ClosedMilestones}}
		<div class="divider"></div>
		<div class="header">
			{{ctx.Locale.Tr "repo.issues.new.closed_milestone"}}
		</div>
		{{range .ClosedMilestones}}
			<a class="item"{{if $useHTMX}} hx-post="{{$.RepoLink}}/issues/milestone?id={{.ID}}&issue_ids={{$.Issue.ID}}&htmx=true"{{else}} data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"{{end}}>
				{{svg "octicon-milestone" 16 "tw-mr-1"}}
				{{.Name}}
			</a>
		{{end}}
	{{end}}
{{end}}