summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/sidebar/actions.tmpl
blob: 36f21822aa7982b419192c718acf2b022c41d0bc (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
{{if or .PinEnabled .Issue.IsPinned}}
	<form class="tw-mt-1 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.max_pinned"}}"{{end}}>
		{{$.CsrfTokenHtml}}
		<button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
			{{if not .Issue.IsPinned}}
				{{svg "octicon-pin" 16 "tw-mr-2"}}
				{{ctx.Locale.Tr "pin"}}
			{{else}}
				{{svg "octicon-pin-slash" 16 "tw-mr-2"}}
				{{ctx.Locale.Tr "unpin"}}
			{{end}}
		</button>
	</form>
{{end}}

<button class="tw-mt-1 fluid ui show-modal button {{if .Issue.IsLocked}} negative {{end}}" data-modal="#lock">
	{{if .Issue.IsLocked}}
		{{svg "octicon-key"}}
		{{ctx.Locale.Tr "repo.issues.unlock"}}
	{{else}}
		{{svg "octicon-lock"}}
		{{ctx.Locale.Tr "repo.issues.lock"}}
	{{end}}
</button>
<div class="ui tiny modal" id="lock">
	<div class="header">
		{{if .Issue.IsLocked}}
			{{ctx.Locale.Tr "repo.issues.unlock.title"}}
		{{else}}
			{{ctx.Locale.Tr "repo.issues.lock.title"}}
		{{end}}
	</div>
	<div class="content">
		<div class="ui warning message">
			{{if .Issue.IsLocked}}
				{{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}<br>
				{{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}<br>
			{{else}}
				{{ctx.Locale.Tr "repo.issues.lock.notice_1"}}<br>
				{{ctx.Locale.Tr "repo.issues.lock.notice_2"}}<br>
				{{ctx.Locale.Tr "repo.issues.lock.notice_3"}}<br>
			{{end}}
		</div>

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

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

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

						<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">
				<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
				<button class="ui red button">
					{{if .Issue.IsLocked}}
						{{ctx.Locale.Tr "repo.issues.unlock_confirm"}}
					{{else}}
						{{ctx.Locale.Tr "repo.issues.lock_confirm"}}
					{{end}}
				</button>
			</div>
		</form>
	</div>
</div>
<button class="tw-mt-1 fluid ui show-modal button" data-modal="#sidebar-delete-issue">
	{{svg "octicon-trash"}}
	{{ctx.Locale.Tr "repo.issues.delete"}}
</button>
<div class="ui g-modal-confirm modal" id="sidebar-delete-issue">
	<div class="header">
		{{if .Issue.IsPull}}
			{{ctx.Locale.Tr "repo.pulls.delete.title"}}
		{{else}}
			{{ctx.Locale.Tr "repo.issues.delete.title"}}
		{{end}}
	</div>
	<div class="content">
		<p>
			{{if .Issue.IsPull}}
				{{ctx.Locale.Tr "repo.pulls.delete.text"}}
			{{else}}
				{{ctx.Locale.Tr "repo.issues.delete.text"}}
			{{end}}
		</p>
	</div>
	<form action="{{.Issue.Link}}/delete" method="post">
		{{.CsrfTokenHtml}}
		{{template "base/modal_actions_confirm" .}}
	</form>
</div>