summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/sidebar.tmpl
blob: 0728f5390a184e435a12562346dc8317324883ec (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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
<div class="four wide column">
	<div class="ui segment metas">
		{{template "repo/issue/branch_selector_field" .}}

		{{if .Issue.IsPull}}

			<input id="reviewer_id" name="reviewer_id" type="hidden" value="{{.reviewer_id}}">
			<div class="ui {{if or (not .Reviewers) (not .CanChooseReviewer) .Repository.IsArchived}}disabled{{end}} floating jump select-reviewers-modify dropdown">
				<a class="text gt-df gt-ac muted">
					<strong>{{.locale.Tr "repo.issues.review.reviewers"}}</strong>
					{{if and .CanChooseReviewer (not .Repository.IsArchived)}}
						{{svg "octicon-gear" 16 "gt-ml-2"}}
					{{end}}
				</a>
				<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
					<div class="header" style="text-transform: none;font-size:16px;">{{.locale.Tr "repo.issues.new.add_reviewer_title"}}</div>
					{{if .Reviewers}}
						<div class="ui icon search input">
							<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
							<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_reviewers"}}">
						</div>
					{{end}}
					{{if .Reviewers}}
						{{range .Reviewers}}
							{{if .User}}
								<a class="{{if not .CanChange}}ui tooltip{{end}} item {{if .Checked}} checked {{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
									<span class="octicon-check {{if not .Checked}}invisible{{end}}">{{svg "octicon-check"}}</span>
									<span class="text">
										{{avatar $.Context .User 28 "gt-mr-3"}}
										{{.User.GetDisplayName}}
									</span>
								</a>
							{{end}}
						{{end}}
					{{end}}
					{{if .TeamReviewers}}
						<div class="ui divider"></div>
						{{range .TeamReviewers}}
							{{if .Team}}
								<a class="{{if not .CanChange}}ui tooltip{{end}} item {{if .Checked}} checked {{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_team_{{.Team.ID}}" {{if not .CanChange}} data-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
									<span class="octicon-check {{if not .Checked}}invisible{{end}}">{{svg "octicon-check" 16}}</span>
									<span class="text">
										{{svg "octicon-people" 16 "gt-ml-4 gt-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}
									</span>
								</a>
							{{end}}
						{{end}}
					{{end}}
				</div>
			</div>

			<div class="ui assignees list">
				<span class="no-select item {{if or .OriginalReviews .PullReviewers}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_reviewers"}}</span>
				<div class="selected">
					{{range .PullReviewers}}
						<div class="item gt-mb-2">
							{{if .User}}
								<a class="muted sidebar-item-link" href="{{.User.HomeLink}}">
									{{avatar $.Context .User 28 "gt-mr-3"}}
									{{.User.GetDisplayName}}
								</a>
							{{else if .Team}}
								<span class="text">{{svg "octicon-people" 16 "teamavatar"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}</span>
							{{end}}
							<span class="ui right type-icon text {{if eq .Review.Type 1}}green
								{{- else if eq .Review.Type 2}}grey
								{{- else if eq .Review.Type 3}}red
								{{- else if eq .Review.Type 4}}yellow
								{{- else}}grey{{end}} right ">

								{{if .CanChange}}
									<a href="#" class="ui tooltip icon re-request-review {{if .Checked}}checked{{end}}" data-content="{{if .Checked}} {{$.locale.Tr "repo.issues.remove_request_review"}} {{else}} {{$.locale.Tr "repo.issues.re_request_review"}} {{end}}" data-issue-id="{{$.Issue.ID}}"  data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
										{{if .Checked}} {{svg "octicon-trash"}} {{else}} {{svg "octicon-sync"}} {{end}}
									</a>
								{{end}}
								{{svg (printf "octicon-%s" .Review.Type.Icon)}}
							</span>
						</div>
					{{end}}
					{{range .OriginalReviews}}
						<div class="item" style="margin-bottom: 10px;">
							<a href="{{$.Repository.OriginalURL}}" class="ui tooltip" data-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}">
								<span class="text black">
									{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
									{{.OriginalAuthor}}
								</span>
							</a>
							<span class="ui right type-icon text {{if eq .Type 1}}green
								{{- else if eq .Type 2}}grey
								{{- else if eq .Type 3}}red
								{{- else if eq .Type 4}}yellow
								{{- else}}grey{{end}} right ">
								{{svg (printf "octicon-%s" .Type.Icon)}}
							</span>
						</div>
					{{end}}
				</div>
			</div>
			{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
				<div class="toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(index .PullRequestWorkInProgressPrefixes 0| Escape)}}" data-update-url="{{.Issue.Link}}/title">
					<a class="muted">
						{{.locale.Tr "repo.pulls.still_in_progress"}} {{.locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
					</a>
				</div>
			{{end}}
			<div class="ui divider"></div>
		{{end}}

		<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-label dropdown">
			<a class="text gt-df gt-ac muted">
				<strong>{{.locale.Tr "repo.issues.new.labels"}}</strong>
				{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
					{{svg "octicon-gear" 16 "gt-ml-2"}}
				{{end}}
			</a>
			<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/labels">
				<div class="header" style="text-transform: none;font-size:16px;">{{.locale.Tr "repo.issues.new.add_labels_title"}}</div>
				{{if or .Labels .OrgLabels}}
					<div class="ui icon search input">
						<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_labels"}}">
					</div>
				{{end}}
				<a class="no-select item" href="#">{{.locale.Tr "repo.issues.new.clear_labels"}}</a>
				{{if or .Labels .OrgLabels}}
					{{$previousExclusiveScope := "_no_scope"}}
					{{range .Labels}}
						{{$exclusiveScope := .ExclusiveScope}}
						{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
							<div class="ui divider"></div>
						{{end}}
						{{$previousExclusiveScope = $exclusiveScope}}
						<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}" data-scope="{{$exclusiveScope}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}</span>&nbsp;&nbsp;{{RenderLabel $.Context .}}
						{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}</a>
					{{end}}
					<div class="ui divider"></div>
					{{$previousExclusiveScope := "_no_scope"}}
					{{range .OrgLabels}}
						{{$exclusiveScope := .ExclusiveScope}}
						{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
							<div class="ui divider"></div>
						{{end}}
						{{$previousExclusiveScope = $exclusiveScope}}
						<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}" data-scope="{{$exclusiveScope}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}</span>&nbsp;&nbsp;{{RenderLabel $.Context .}}
						{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}</a>
					{{end}}
				{{else}}
					<div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div>
				{{end}}
			</div>
		</div>
		{{template "repo/issue/labels/labels_sidebar" dict "root" $ "ctx" .}}

		<div class="ui divider"></div>

		<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown">
			<a class="text gt-df gt-ac muted">
				<strong>{{.locale.Tr "repo.issues.new.milestone"}}</strong>
				{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
					{{svg "octicon-gear" 16 "gt-ml-2"}}
				{{end}}
			</a>
			<div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/milestone">
				<div class="header" style="text-transform: none;font-size:16px;">{{.locale.Tr "repo.issues.new.add_milestone_title"}}</div>
				{{if or .OpenMilestones .ClosedMilestones}}
				<div class="ui icon search input">
					<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
					<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_milestones"}}">
				</div>
				{{end}}
				<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_milestone"}}</div>
				{{if and (not .OpenMilestones) (not .ClosedMilestones)}}
					<div class="header" style="text-transform: none;font-size:14px;">
						{{.locale.Tr "repo.issues.new.no_items"}}
					</div>
				{{else}}
					{{if .OpenMilestones}}
						<div class="divider"></div>
						<div class="header">
							{{.locale.Tr "repo.issues.new.open_milestone"}}
						</div>
						{{range .OpenMilestones}}
							<a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}">
								{{svg "octicon-milestone" 16 "gt-mr-2"}}
								{{.Name}}
							</a>
						{{end}}
					{{end}}
					{{if .ClosedMilestones}}
						<div class="divider"></div>
						<div class="header">
							{{.locale.Tr "repo.issues.new.closed_milestone"}}
						</div>
						{{range .ClosedMilestones}}
							<a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}">
								{{svg "octicon-milestone" 16 "gt-mr-2"}}
								{{.Name}}
							</a>
						{{end}}
					{{end}}
				{{end}}
			</div>
		</div>
		<div class="ui select-milestone list">
			<span class="no-select item {{if .Issue.Milestone}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_milestone"}}</span>
			<div class="selected">
				{{if .Issue.Milestone}}
					<a class="item muted sidebar-item-link" href="{{.RepoLink}}/milestone/{{.Issue.Milestone.ID}}">
						{{svg "octicon-milestone" 18 "gt-mr-3"}}
						{{.Issue.Milestone.Name}}
					</a>
				{{end}}
			</div>
		</div>

		{{if .IsProjectsEnabled}}
			<div class="ui divider"></div>

			<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown">
				<a class="text gt-df gt-ac muted">
					<strong>{{.locale.Tr "repo.issues.new.projects"}}</strong>
					{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
						{{svg "octicon-gear" 16 "gt-ml-2"}}
					{{end}}
				</a>
				<div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/projects">
					<div class="header" style="text-transform: none;font-size:16px;">{{.locale.Tr "repo.issues.new.add_project_title"}}</div>
					{{if or .OpenProjects .ClosedProjects}}
					<div class="ui icon search input">
						<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_projects"}}">
					</div>
					{{end}}
					<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_projects"}}</div>
					{{if .OpenProjects}}
						<div class="divider"></div>
						<div class="header">
							{{.locale.Tr "repo.issues.new.open_projects"}}
						</div>
						{{range .OpenProjects}}
							<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
								{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
								{{.Title}}
							</a>
						{{end}}
					{{end}}
					{{if .ClosedProjects}}
						<div class="divider"></div>
						<div class="header">
							{{.locale.Tr "repo.issues.new.closed_projects"}}
						</div>
						{{range .ClosedProjects}}
							<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
								{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
								{{.Title}}
							</a>
						{{end}}
					{{end}}
				</div>
			</div>
			<div class="ui select-project list">
				<span class="no-select item {{if .Issue.ProjectID}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span>
				<div class="selected">
					{{if .Issue.ProjectID}}
						<a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}">
							{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
							{{.Issue.Project.Title}}
						</a>
					{{end}}
				</div>
			</div>
		{{end}}

		<div class="ui divider"></div>

		<input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
		<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown">
			<a class="text gt-df gt-ac muted">
				<strong>{{.locale.Tr "repo.issues.new.assignees"}}</strong>
				{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
					{{svg "octicon-gear" 16 "gt-ml-2"}}
				{{end}}
			</a>
			<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee">
				<div class="header" style="text-transform: none;font-size:16px;">{{.locale.Tr "repo.issues.new.add_assignees_title"}}</div>
				<div class="ui icon search input">
					<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
					<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignees"}}">
				</div>
				<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_assignees"}}</div>
				{{range .Assignees}}

					{{$AssigneeID := .ID}}
					<a class="item{{range $.Issue.Assignees}}{{if eq .ID $AssigneeID}} checked{{end}}{{end}}" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
						{{$checked := false}}
						{{range $.Issue.Assignees}}
							{{if eq .ID $AssigneeID}}
								{{$checked = true}}
							{{end}}
						{{end}}
						<span class="octicon-check {{if not $checked}}invisible{{end}}">{{svg "octicon-check"}}</span>
						<span class="text">
							{{avatar $.Context . 28 "gt-mr-3"}}
							{{.GetDisplayName}}
						</span>
					</a>
				{{end}}
			</div>
		</div>
		<div class="ui assignees list">
			<span class="no-select item {{if .Issue.Assignees}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_assignees"}}</span>
			<div class="selected">
				{{range .Issue.Assignees}}
					<div class="item">
						<a class="muted sidebar-item-link" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?assignee={{.ID}}">
							{{avatar $.Context . 28 "gt-mr-3"}}
							{{.GetDisplayName}}
						</a>
					</div>
				{{end}}
			</div>
		</div>

		<div class="ui divider"></div>

		{{if .Participants}}
			<span class="text"><strong>{{.locale.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span>
			<div class="ui list gt-df gt-fw">
				{{range .Participants}}
					<a class="ui tooltip" {{if gt .ID 0}}href="{{.HomeLink}}"{{end}} data-content="{{.GetDisplayName}}" data-position="top center">
						{{avatar $.Context . 28 "gt-my-1 gt-mr-2"}}
					</a>
				{{end}}
			</div>
		{{end}}

		{{if and $.IssueWatch (not .Repository.IsArchived)}}
			<div class="ui divider"></div>

			<div class="ui watching">
				<span class="text"><strong>{{.locale.Tr "notification.notifications"}}</strong></span>
				<div class="gt-mt-3">
					<form method="POST" action="{{.Issue.Link}}/watch">
						<input type="hidden" name="watch" value="{{if $.IssueWatch.IsWatching}}0{{else}}1{{end}}" />
						{{$.CsrfTokenHtml}}
						<button class="fluid ui button gt-df gt-jc">
							{{if $.IssueWatch.IsWatching}}
								{{svg "octicon-mute" 16 "gt-mr-3"}}
								{{.locale.Tr "repo.issues.unsubscribe"}}
							{{else}}
								{{svg "octicon-unmute" 16 "gt-mr-3"}}
								{{.locale.Tr "repo.issues.subscribe"}}
							{{end}}
						</button>
					</form>
				</div>
			</div>
		{{end}}
		{{if .Repository.IsTimetrackerEnabled $.Context}}
			{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
				<div class="ui divider"></div>
				<div class="ui timetrack">
					<span class="text"><strong>{{.locale.Tr "repo.issues.tracker"}}</strong></span>
					<div class="gt-mt-3">
						<form method="POST" action="{{.Issue.Link}}/times/stopwatch/toggle" id="toggle_stopwatch_form">
							{{$.CsrfTokenHtml}}
						</form>
						<form method="POST" action="{{.Issue.Link}}/times/stopwatch/cancel" id="cancel_stopwatch_form">
							{{$.CsrfTokenHtml}}
						</form>
						{{if  $.IsStopwatchRunning}}
							<button class="ui fluid button issue-stop-time">{{.locale.Tr "repo.issues.stop_tracking"}}</button>
							<button class="ui fluid negative button issue-cancel-time gt-mt-3">{{.locale.Tr "repo.issues.cancel_tracking"}}</button>
						{{else}}
							{{if .HasUserStopwatch}}
								<div class="ui warning message">
									{{.locale.Tr "repo.issues.tracking_already_started" (.OtherStopwatchURL|Escape) | Safe}}
								</div>
							{{end}}
							<button class="ui fluid button tooltip issue-start-time" data-content='{{.locale.Tr "repo.issues.start_tracking"}}' data-position="top center">{{.locale.Tr "repo.issues.start_tracking_short"}}</button>
							<div class="ui mini modal issue-start-time-modal">
								<div class="header">{{.locale.Tr "repo.issues.add_time"}}</div>
								<div class="content">
									<form method="POST" id="add_time_manual_form" action="{{.Issue.Link}}/times/add" class="ui action input fluid">
										{{$.CsrfTokenHtml}}
										<input placeholder='{{.locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">
										<input placeholder='{{.locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact">
									</form>
								</div>
								<div class="actions">
									<div class="ui green approve button">{{.locale.Tr "repo.issues.add_time_short"}}</div>
									<div class="ui red cancel button">{{.locale.Tr "repo.issues.add_time_cancel"}}</div>
								</div>
							</div>
							<button class="ui fluid button green tooltip issue-add-time gt-mt-3" data-content='{{.locale.Tr "repo.issues.add_time"}}' data-position="top center">{{.locale.Tr "repo.issues.add_time_short"}}</button>
						{{end}}
					</div>
				</div>
			{{end}}
			{{if gt (len .WorkingUsers) 0}}
				<div class="ui divider"></div>
				<div class="ui comments">
					<span class="text"><strong>{{.locale.Tr "repo.issues.time_spent_from_all_authors"  ($.Issue.TotalTrackedTime | Sec2Time) | Safe}}</strong></span>
					<div>
						{{range $user, $trackedtime := .WorkingUsers}}
							<div class="comment gt-mt-3">
								<a class="avatar">
									{{avatar $.Context $user}}
								</a>
								<div class="content">
									{{template "shared/user/authorlink" $user}}
									<div class="text">
										{{$trackedtime}}
									</div>
								</div>
							</div>
						{{end}}
					</div>
				</div>
			{{end}}
		{{end}}

		<div class="ui divider"></div>
		<span class="text"><strong>{{.locale.Tr "repo.issues.due_date"}}</strong></span>
		<div class="ui form" id="deadline-loader">
			<div class="ui negative message gt-hidden" id="deadline-err-invalid-date">
				{{svg "octicon-x" 16 "close icon"}}
				{{.locale.Tr "repo.issues.due_date_invalid"}}
			</div>
			{{if ne .Issue.DeadlineUnix 0}}
				<p>
					<div class="gt-df gt-sb gt-ac">
						<div class="due-date tooltip {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-content="{{.locale.Tr "repo.issues.due_date_overdue"}}"{{end}}>
							{{svg "octicon-calendar" 16 "gt-mr-3"}}
							<time data-format="date" datetime="{{.Issue.DeadlineUnix.FormatDate}}">{{.Issue.DeadlineUnix.FormatDate}}</time>
						</div>
						<div>
							{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
								<a class="issue-due-edit tooltip muted" data-content="{{$.locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil" 16 "gt-mr-2"}}</a>
								<a class="issue-due-remove tooltip muted" data-content="{{$.locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a>
							{{end}}
						</div>
					</div>
				</p>
			{{else}}
				<p>{{.locale.Tr "repo.issues.due_date_not_set"}}</p>
			{{end}}

			{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
				<div {{if ne .Issue.DeadlineUnix 0}} class="gt-hidden"{{end}} id="deadlineForm">
					<form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" method="post" id="update-issue-deadline-form">
						{{$.CsrfTokenHtml}}
						<input required placeholder="{{.locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="deadlineDate" id="deadlineDate">
						<button class="ui green icon button">
							{{if ne .Issue.DeadlineUnix 0}}
								{{svg "octicon-pencil"}}
							{{else}}
								{{svg "octicon-plus"}}
							{{end}}
						</button>
					</form>
				</div>
			{{end}}
		</div>

		{{if .Repository.IsDependenciesEnabled $.Context}}
			<div class="ui divider"></div>

			<div class="ui depending">
				{{if (and (not .BlockedByDependencies) (not .BlockingDependencies))}}
					<span class="text"><strong>{{.locale.Tr "repo.issues.dependency.title"}}</strong></span>
					<br>
					<p>
						{{if .Issue.IsPull}}
							{{.locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
						{{else}}
							{{.locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
						{{end}}
					</p>
				{{end}}

				{{if .BlockingDependencies}}
					<span class="text tooltip" data-content="{{if .Issue.IsPull}}{{.locale.Tr "repo.issues.dependency.pr_close_blocks"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_close_blocks"}}{{end}}">
						<strong>{{.locale.Tr "repo.issues.dependency.blocks_short"}}</strong>
					</span>
					<div class="ui relaxed divided list">
						{{range .BlockingDependencies}}
							<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
								<div class="item-left gt-df gt-jc gt-fc gt-f1">
									<a class="title tooltip" href="{{.Issue.Link}}" data-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
										#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
									</a>
									<div class="text small">
										{{.Repository.OwnerName}}/{{.Repository.Name}}
									</div>
								</div>
								<div class="item-right gt-df gt-ac">
									{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
										<a class="delete-dependency-button tooltip ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
											{{svg "octicon-trash" 16}}
										</a>
									{{end}}
								</div>
							</div>
						{{end}}
					</div>
				{{end}}

				{{if .BlockedByDependencies}}
					<span class="text tooltip" data-content="{{if .Issue.IsPull}}{{.locale.Tr "repo.issues.dependency.pr_closing_blockedby"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_closing_blockedby"}}{{end}}">
						<strong>{{.locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong>
					</span>
					<div class="ui relaxed divided list">
						{{range .BlockedByDependencies}}
							<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
								<div class="item-left gt-df gt-jc gt-fc gt-f1">
									<a class="title tooltip" href="{{.Issue.Link}}" data-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
										#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
									</a>
									<div class="text small">
										{{.Repository.OwnerName}}/{{.Repository.Name}}
									</div>
								</div>
								<div class="item-right gt-df gt-ac">
									{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
										<a class="delete-dependency-button tooltip ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
											{{svg "octicon-trash" 16}}
										</a>
									{{end}}
								</div>
							</div>
						{{end}}
					</div>
				{{end}}

				{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
					<div>
						<form method="POST" action="{{.Issue.Link}}/dependency/add" id="addDependencyForm">
							{{$.CsrfTokenHtml}}
							<div class="ui fluid action input">
								<div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}">
									<input name="newDependency" type="hidden">
									{{svg "octicon-triangle-down" 14 "dropdown icon"}}
									<input type="text" class="search">
									<div class="default text">{{.locale.Tr "repo.issues.dependency.add"}}</div>
								</div>
								<button class="ui green icon button">
									{{svg "octicon-plus"}}
								</button>
							</div>
						</form>
					</div>
				{{end}}
			</div>

			{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
				<input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}">

				<div class="ui basic modal remove-dependency">
					<div class="ui icon header">
						{{svg "octicon-trash"}}
						{{.locale.Tr "repo.issues.dependency.remove_header"}}
					</div>
					<div class="content">
						<form method="POST" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm">
							{{$.CsrfTokenHtml}}
							<input type="hidden" value="" name="removeDependencyID" id="removeDependencyID"/>
							<input type="hidden" value="" name="dependencyType" id="dependencyType"/>
						</form>
						<p>{{if .Issue.IsPull}}
							{{.locale.Tr "repo.issues.dependency.pr_remove_text"}}
						{{else}}
							{{.locale.Tr "repo.issues.dependency.issue_remove_text"}}
						{{end}}</p>
					</div>
					<div class="actions">
						<div class="ui red cancel inverted button">
							{{svg "octicon-x"}}
							{{.locale.Tr "repo.issues.dependency.cancel"}}
						</div>
						<div class="ui green ok inverted button">
							{{svg "octicon-check"}}
							{{.locale.Tr "repo.issues.dependency.remove"}}
						</div>
					</div>
				</div>
			{{end}}
		{{end}}

		<div class="ui divider"></div>
		<div class="ui equal width compact grid">
			{{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
			<div class="row gt-ac tooltip" data-content="{{$issueReferenceLink}}">
				<span class="text column truncate">{{.locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span>
				<button class="ui two wide button column gt-p-3" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button>
			</div>
		</div>

		{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
			<div class="ui divider"></div>
			<div class="ui watching">
				<button class="fluid ui show-modal button {{if .Issue.IsLocked}} negative {{end}}" data-modal="#lock">
					{{if .Issue.IsLocked}}
						{{svg "octicon-key"}}
						{{.locale.Tr "repo.issues.unlock"}}
					{{else}}
						{{svg "octicon-lock"}}
						{{.locale.Tr "repo.issues.lock"}}
					{{end}}
				</button>
			</div>
			<div class="ui tiny modal" id="lock">
				<div class="header">
					{{if .Issue.IsLocked}}
						{{.locale.Tr "repo.issues.unlock.title"}}
					{{else}}
						{{.locale.Tr "repo.issues.lock.title"}}
					{{end}}
				</div>
				<div class="content">
					<div class="ui warning message text left">
						{{if .Issue.IsLocked}}
							{{.locale.Tr "repo.issues.unlock.notice_1"}}<br>
							{{.locale.Tr "repo.issues.unlock.notice_2"}}<br>
						{{else}}
							{{.locale.Tr "repo.issues.lock.notice_1"}}<br>
							{{.locale.Tr "repo.issues.lock.notice_2"}}<br>
							{{.locale.Tr "repo.issues.lock.notice_3"}}<br>
						{{end}}
					</div>

					<form class="ui form" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
						method="post">
						{{.CsrfTokenHtml}}

						{{if not .Issue.IsLocked}}
							<div class="field">
								<strong> {{.locale.Tr "repo.issues.lock.reason"}} </strong>
							</div>

							<div class="field">
								<div class="ui fluid dropdown selection" tabindex="0">

									<select name="reason">
										<option value=""> </option>
										{{range .LockReasons}}
											<option value="{{.}}">{{.}}</option>
										{{end}}
									</select>
									{{svg "octicon-triangle-down" 14 "dropdown icon"}}

									<div class="default text"> </div>

									<div class="menu">
										{{range .LockReasons}}
											<div class="item" data-value="{{.}}">{{.}}</div>
										{{end}}
									</div>
								</div>
							</div>
						{{end}}

						<div class="text right actions">
							<div class="ui cancel button">{{.locale.Tr "settings.cancel"}}</div>
							<button class="ui red button">
								{{if .Issue.IsLocked}}
									{{.locale.Tr "repo.issues.unlock_confirm"}}
								{{else}}
									{{.locale.Tr "repo.issues.lock_confirm"}}
								{{end}}
							</button>
						</div>
					</form>
				</div>
			</div>
			<button class="fluid ui show-modal button negative gt-mt-3" data-modal="#delete">
				{{svg "octicon-trash"}}
				{{.locale.Tr "repo.issues.delete"}}
			</button>
			<div class="ui basic modal" id="delete">
				<div class="ui icon header">
					{{if .Issue.IsPull}}
						{{.locale.Tr "repo.pulls.delete.title"}}
					{{else}}
						{{.locale.Tr "repo.issues.delete.title"}}
					{{end}}
				</div>
				<div class="content center">
					<p>
						{{if .Issue.IsPull}}
							{{.locale.Tr "repo.pulls.delete.text"}}
						{{else}}
							{{.locale.Tr "repo.issues.delete.text"}}
						{{end}}
					</p>
				</div>
				<form action="{{.Issue.Link}}/delete" method="post">
					{{.CsrfTokenHtml}}
					<div class="center actions">
						<div class="ui basic cancel inverted button">{{.locale.Tr "settings.cancel"}}</div>
						<button class="ui basic red inverted button">{{.locale.Tr "modal.yes"}}</button>
					</div>
				</form>
			</div>
		{{end}}

		{{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed)}}
			{{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
				<div class="ui divider"></div>
				<div class="inline field">
					<div class="ui checkbox" id="allow-edits-from-maintainers"
							data-url="{{.Issue.Link}}"
							data-prompt-tip="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
							data-prompt-error="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
						>
						<label><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
						<input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}}>
					</div>
				</div>
			{{end}}
		{{end}}
	</div>
</div>