aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/list.tmpl
blob: 904b4d8bd0866e8a75465fbf8b63fc2c9617bbd4 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{{template "base/head" .}}
<div class="page-content repository">
	{{template "repo/header" .}}
	<div class="ui container">
		<div class="ui three column stackable grid">
			<div class="column">
				{{template "repo/issue/navbar" .}}
			</div>
			<div class="column center aligned">
				{{template "repo/issue/search" .}}
			</div>
			{{if not .Repository.IsArchived}}
				<div class="column right aligned">
					{{if .PageIsIssueList}}
						<a class="ui green button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.i18n.Tr "repo.issues.new"}}</a>
					{{else}}
						<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | EscapePound}}{{end}}">{{.i18n.Tr "repo.pulls.new"}}</a>
					{{end}}
				</div>
			{{else}}
				{{if not .PageIsIssueList}}
					<div class="column right aligned">
						<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | EscapePound}}{{end}}">{{$.i18n.Tr "action.compare_commits_general"}}</a>
					</div>
				{{end}}
			{{end}}
		</div>
		<div class="ui divider"></div>
		<div id="issue-filters" class="ui stackable grid">
			<div class="six wide column">
				{{template "repo/issue/openclose" .}}
			</div>
			<div class="ten wide right aligned column">
				<div class="ui secondary filter stackable menu labels">
					<!-- Label -->
					<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter" style="margin-left: auto">
						<span class="text">
							{{.i18n.Tr "repo.issues.filter_label"}}
							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						</span>
						<div class="menu">
							<span class="info">{{.i18n.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
							<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
							{{range .Labels}}
								<a class="item label-filter-item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" data-label-id="{{.ID}}">{{if .IsExcluded}}{{svg "octicon-circle-slash"}}{{else if .IsSelected}}{{svg "octicon-check"}}{{end}}<span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}</a>
							{{end}}
						</div>
					</div>

					<!-- Milestone -->
					<div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
						<span class="text">
							{{.i18n.Tr "repo.issues.filter_milestone"}}
							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						</span>
						<div class="menu">
							<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a>
							{{range .Milestones}}
								<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&assignee={{$.AssigneeID}}">{{.Name}}</a>
							{{end}}
						</div>
					</div>

					<!-- Assignee -->
					<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
						<span class="text">
							{{.i18n.Tr "repo.issues.filter_assignee"}}
							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						</span>
						<div class="menu">
							<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a>
							{{range .Assignees}}
								<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.ID}}">
									{{avatar .}} {{.GetDisplayName}}
								</a>
							{{end}}
						</div>
					</div>

					{{if .IsSigned}}
						<!-- Type -->
						<div class="ui dropdown type jump item">
							<span class="text">
								{{.i18n.Tr "repo.issues.filter_type"}}
								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
							</span>
							<div class="menu">
								<a class="{{if eq .ViewType "all"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.all_issues"}}</a>
								<a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
								<a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.created_by_you"}}</a>
								<a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}</a>
								{{if .PageIsPullList}}
									<a class="{{if eq .ViewType "review_requested"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.review_requested"}}</a>
								{{end}}
							</div>
						</div>
					{{end}}

					<!-- Sort -->
					<div class="ui dropdown type jump item">
						<span class="text">
							{{.i18n.Tr "repo.issues.filter_sort"}}
							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						</span>
						<div class="menu">
							<a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
							<a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
							<a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
							<a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
							<a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
							<a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
							<a class="{{if eq .SortType "nearduedate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.nearduedate"}}</a>
							<a class="{{if eq .SortType "farduedate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.farduedate"}}</a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="issue-actions" class="ui stackable grid hide">
			<div class="six wide column">
				{{template "repo/issue/openclose" .}}
			</div>
			{{/* Ten wide does not cope well and makes the columns stack.
			This seems to be related to jQuery's hide/show: in fact, switching
			issue-actions and issue-filters and having this ten wide will show
			this one correctly, but not the other one. */}}
			<div class="nine wide right aligned right floated column">
				<div class="ui secondary filter stackable menu">
					{{if not .Repository.IsArchived}}
					<!-- Action Button -->
					{{if .IsShowClosed}}
						<div class="ui green active basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.i18n.Tr "repo.issues.action_open"}}</div>
					{{else}}
						<div class="ui red active basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.i18n.Tr "repo.issues.action_close"}}</div>
					{{end}}
					<!-- Labels -->
					<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
						<span class="text">
							{{.i18n.Tr "repo.issues.action_label"}}
							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						</span>
						<div class="menu">
							{{range .Labels}}
								<div class="item issue-action" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
									{{if contain $.SelLabelIDs .ID}}{{svg "octicon-check"}}{{end}}<span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
								</div>
							{{end}}
						</div>
					</div>

					<!-- Milestone -->
					<div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
						<span class="text">
							{{.i18n.Tr "repo.issues.action_milestone"}}
							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						</span>
						<div class="menu">
							<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
							{{.i18n.Tr "repo.issues.action_milestone_no_select"}}
							</div>
							{{range .Milestones}}
								<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
									{{.Name}}
								</div>
							{{end}}
						</div>
					</div>

					<!-- Assignees -->
					<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
						<span class="text">
							{{.i18n.Tr "repo.issues.action_assignee"}}
							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						</span>
						<div class="menu">
							<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
								{{.i18n.Tr "repo.issues.action_assignee_no_select"}}
							</div>
							{{range .Assignees}}
								<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
									{{avatar .}} {{.GetDisplayName}}
								</div>
							{{end}}
						</div>
					</div>
					{{end}}
				</div>
			</div>
		</div>
		{{template "shared/issuelist" mergeinto . "listType" "repo"}}
	</div>
</div>
{{template "base/footer" .}}