summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/milestones.tmpl
blob: 63a6f6b26a0fc8fdd5519c3dc2ff9fdfd8ffc5e0 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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" .}}