summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/milestone
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/repo/issue/milestone/filter_list.tmpl16
-rw-r--r--templates/repo/issue/milestone/select_menu.tmpl39
-rw-r--r--templates/repo/issue/milestone_issues.tmpl65
-rw-r--r--templates/repo/issue/milestone_new.tmpl59
-rw-r--r--templates/repo/issue/milestones.tmpl110
5 files changed, 289 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}}
diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl
new file mode 100644
index 0000000..e5dc8cb
--- /dev/null
+++ b/templates/repo/issue/milestone_issues.tmpl
@@ -0,0 +1,65 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content repository milestone-issue-list">
+ {{template "repo/header" .}}
+ <div class="ui container">
+ {{template "base/alert" .}}
+ <div class="tw-flex tw-items-center tw-justify-between">
+ <h1 class="tw-mb-2">{{.Milestone.Name}}</h1>
+ {{if not .Repository.IsArchived}}
+ <div class="tw-flex button-row">
+ {{if or .CanWriteIssues .CanWritePulls}}
+ {{if .Milestone.IsClosed}}
+ <a class="ui primary button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{ctx.Locale.Tr "repo.milestones.open"}}
+ </a>
+ {{else}}
+ <a class="ui red button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/close">{{ctx.Locale.Tr "repo.milestones.close"}}
+ </a>
+ {{end}}
+ <a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{ctx.Locale.Tr "repo.milestones.edit"}}</a>
+ {{end}}
+ <a class="ui primary button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
+ </div>
+ {{end}}
+ </div>
+ {{if .Milestone.RenderedContent}}
+ <div class="markup content tw-mb-4">
+ {{.Milestone.RenderedContent}}
+ </div>
+ {{end}}
+ <div class="tw-flex tw-flex-col tw-gap-2">
+ <progress class="milestone-progress-big" value="{{.Milestone.Completeness}}" max="100"></progress>
+ <div class="tw-flex tw-gap-4">
+ <div class="tw-flex tw-items-center">
+ {{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix ctx.Locale}}
+ {{if .IsClosed}}
+ {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}}
+ {{else}}
+
+ {{if .Milestone.DeadlineString}}
+ <span{{if .IsOverdue}} class="text red"{{end}}>
+ {{svg "octicon-calendar"}}
+ {{DateTime "short" .Milestone.DeadlineString}}
+ </span>
+ {{else}}
+ {{svg "octicon-calendar"}}
+ {{ctx.Locale.Tr "repo.milestones.no_due_date"}}
+ {{end}}
+ {{end}}
+ </div>
+ <div class="tw-mr-2">{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness}}</div>
+ {{if .TotalTrackedTime}}
+ <div data-tooltip-content='{{ctx.Locale.Tr "tracked_time_summary"}}'>
+ {{svg "octicon-clock"}}
+ {{.TotalTrackedTime | Sec2Time}}
+ </div>
+ {{end}}
+ </div>
+ </div>
+ <div class="divider"></div>
+
+ {{template "repo/issue/filters" .}}
+
+ {{template "shared/issuelist" dict "." . "listType" "milestone"}}
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl
new file mode 100644
index 0000000..9f32df0
--- /dev/null
+++ b/templates/repo/issue/milestone_new.tmpl
@@ -0,0 +1,59 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content repository new milestone">
+ {{template "repo/header" .}}
+ <div class="ui container">
+ <div class="issue-navbar">
+ {{template "repo/issue/navbar" .}}
+ {{if and (or .CanWriteIssues .CanWritePulls) .PageIsEditMilestone}}
+ <div class="ui right floated secondary menu">
+ <a class="ui primary button" href="{{$.RepoLink}}/milestones/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a>
+ </div>
+ {{end}}
+ </div>
+ <div class="divider"></div>
+ <h2 class="ui dividing header">
+ {{if .PageIsEditMilestone}}
+ {{ctx.Locale.Tr "repo.milestones.edit"}}
+ <div class="sub header">{{ctx.Locale.Tr "repo.milestones.edit_subheader"}}</div>
+ {{else}}
+ {{ctx.Locale.Tr "repo.milestones.new"}}
+ <div class="sub header">{{ctx.Locale.Tr "repo.milestones.new_subheader"}}</div>
+ {{end}}
+ </h2>
+ {{template "base/alert" .}}
+ <form class="ui form" action="{{.Link}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field {{if .Err_Title}}error{{end}}">
+ <label>{{ctx.Locale.Tr "repo.milestones.title"}}</label>
+ <input name="title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required maxlength="50">
+ </div>
+ <div class="field {{if .Err_Deadline}}error{{end}}">
+ <label>
+ {{ctx.Locale.Tr "repo.milestones.due_date"}}
+ <a id="clear-date">{{ctx.Locale.Tr "repo.milestones.clear"}}</a>
+ </label>
+ <input type="date" id="deadline" name="deadline" value="{{.deadline}}" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}">
+ </div>
+ <div class="field">
+ <label>{{ctx.Locale.Tr "repo.milestones.desc"}}</label>
+ <textarea name="content">{{.content}}</textarea>
+ </div>
+ <div class="divider"></div>
+ <div class="tw-text-right">
+ {{if .PageIsEditMilestone}}
+ <a class="ui primary basic button" href="{{.RepoLink}}/milestones">
+ {{ctx.Locale.Tr "repo.milestones.cancel"}}
+ </a>
+ <button class="ui primary button">
+ {{ctx.Locale.Tr "repo.milestones.modify"}}
+ </button>
+ {{else}}
+ <button class="ui primary button">
+ {{ctx.Locale.Tr "repo.milestones.create"}}
+ </button>
+ {{end}}
+ </div>
+ </form>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl
new file mode 100644
index 0000000..63a6f6b
--- /dev/null
+++ b/templates/repo/issue/milestones.tmpl
@@ -0,0 +1,110 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content repository milestones">
+ {{template "repo/header" .}}
+ <div class="ui container">
+ {{template "base/alert" .}}
+
+ <div class="list-header list-header-issues">
+ {{template "repo/issue/navbar" .}}
+ {{template "repo/issue/search" .}}
+ {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
+ <div class="button-row">
+ <a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a>
+ </div>
+ {{end}}
+ </div>
+
+ {{template "repo/issue/filters" .}}
+
+ <!-- milestone list -->
+ <div class="milestone-list">
+ {{range .Milestones}}
+ <li class="milestone-card">
+ <div class="milestone-header">
+ <h3 class="flex-text-block tw-m-0">
+ {{svg "octicon-milestone" 16}}
+ <a class="muted" href="{{$.RepoLink}}/milestone/{{.ID}}">{{.Name}}</a>
+ </h3>
+ <div class="tw-flex tw-items-center">
+ <span class="tw-mr-2">{{.Completeness}}%</span>
+ <progress value="{{.Completeness}}" max="100"></progress>
+ </div>
+ </div>
+ <div class="milestone-toolbar">
+ <div class="group">
+ <div class="flex-text-block">
+ {{svg "octicon-issue-opened" 14}}
+ {{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+ </div>
+ <div class="flex-text-block">
+ {{svg "octicon-check" 14}}
+ {{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
+ </div>
+ {{if .TotalTrackedTime}}
+ <div class="flex-text-block">
+ {{svg "octicon-clock"}}
+ {{.TotalTrackedTime|Sec2Time}}
+ </div>
+ {{end}}
+ {{if .UpdatedUnix}}
+ <div class="flex-text-block">
+ {{svg "octicon-clock"}}
+ {{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale)}}
+ </div>
+ {{end}}
+ <div class="flex-text-block">
+ {{if .IsClosed}}
+ {{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}}
+ {{svg "octicon-clock" 14}}
+ {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}}
+ {{else}}
+ {{if .DeadlineString}}
+ <span class="flex-text-inline {{if .IsOverdue}}text red{{end}}">
+ {{svg "octicon-calendar" 14}}
+ {{DateTime "short" .DeadlineString}}
+ </span>
+ {{else}}
+ {{svg "octicon-calendar" 14}}
+ {{ctx.Locale.Tr "repo.milestones.no_due_date"}}
+ {{end}}
+ {{end}}
+ </div>
+ </div>
+ {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
+ <div class="group">
+ <a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
+ {{if .IsClosed}}
+ <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.milestones.open"}}</a>
+ {{else}}
+ <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{ctx.Locale.Tr "repo.milestones.close"}}</a>
+ {{end}}
+ <a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
+ </div>
+ {{end}}
+ </div>
+ {{if .Content}}
+ <div class="markup content">
+ {{.RenderedContent}}
+ </div>
+ {{end}}
+ </li>
+ {{end}}
+
+ {{template "base/paginate" .}}
+ </div>
+ </div>
+</div>
+
+{{if or .CanWriteIssues .CanWritePulls}}
+ <div class="ui g-modal-confirm delete modal">
+ <div class="header">
+ {{svg "octicon-trash"}}
+ {{ctx.Locale.Tr "repo.milestones.deletion"}}
+ </div>
+ <div class="content">
+ <p>{{ctx.Locale.Tr "repo.milestones.deletion_desc"}}</p>
+ </div>
+ {{template "base/modal_actions_confirm" .}}
+ </div>
+{{end}}
+{{template "base/footer" .}}