summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/milestone
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo/issue/milestone')
-rw-r--r--templates/repo/issue/milestone/filter_list.tmpl16
-rw-r--r--templates/repo/issue/milestone/select_menu.tmpl39
2 files changed, 55 insertions, 0 deletions
diff --git a/templates/repo/issue/milestone/filter_list.tmpl b/templates/repo/issue/milestone/filter_list.tmpl
new file mode 100644
index 0000000..cc45d3b
--- /dev/null
+++ b/templates/repo/issue/milestone/filter_list.tmpl
@@ -0,0 +1,16 @@
+<!-- Sort -->
+<div class="list-header-sort ui dropdown type jump item">
+ <span class="text">
+ {{ctx.Locale.Tr "repo.issues.filter_sort"}}
+ </span>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="menu">
+ <a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="?sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.earliest_due_data"}}</a>
+ <a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="?sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.latest_due_date"}}</a>
+ <a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="?sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_complete"}}</a>
+ <a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="?sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_complete"}}</a>
+ <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="?sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
+ <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="?sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
+ <a class="{{if eq .SortType "name"}}active {{end}}item" href="?sort=name&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.name"}}</a>
+ </div>
+</div>
diff --git a/templates/repo/issue/milestone/select_menu.tmpl b/templates/repo/issue/milestone/select_menu.tmpl
new file mode 100644
index 0000000..570acc2
--- /dev/null
+++ b/templates/repo/issue/milestone/select_menu.tmpl
@@ -0,0 +1,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}}