| 
1 | 1 | {{if and .IsRepoAdmin (not .Repository.IsArchived)}}  | 
2 | 2 | 	<div class="divider"></div>  | 
3 | 3 | 
 
  | 
 | 4 | +	{{/* Pin issue */}}  | 
4 | 5 | 	{{if or .PinEnabled .Issue.IsPinned}}  | 
5 | 6 | 		<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}}>  | 
6 | 7 | 			{{$.CsrfTokenHtml}}  | 
 | 
16 | 17 | 		</form>  | 
17 | 18 | 	{{end}}  | 
18 | 19 | 
 
  | 
19 |  | -	<button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock">  | 
 | 20 | +	{{/* Lock/unlock conversation */}}  | 
 | 21 | +	<button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock-conversation">  | 
20 | 22 | 		{{if .Issue.IsLocked}}  | 
21 |  | -			{{svg "octicon-key"}}  | 
22 |  | -			{{ctx.Locale.Tr "repo.issues.unlock"}}  | 
 | 23 | +			{{svg "octicon-key"}} {{ctx.Locale.Tr "repo.issues.unlock"}}  | 
23 | 24 | 		{{else}}  | 
24 |  | -			{{svg "octicon-lock"}}  | 
25 |  | -			{{ctx.Locale.Tr "repo.issues.lock"}}  | 
 | 25 | +			{{svg "octicon-lock"}} {{ctx.Locale.Tr "repo.issues.lock"}}  | 
26 | 26 | 		{{end}}  | 
27 | 27 | 	</button>  | 
28 |  | -	<div class="ui tiny modal" id="lock">  | 
 | 28 | +	<div class="ui tiny modal" id="lock-conversation">  | 
29 | 29 | 		<div class="header">  | 
30 | 30 | 			{{if .Issue.IsLocked}}  | 
31 | 31 | 				{{ctx.Locale.Tr "repo.issues.unlock.title"}}  | 
 | 
45 | 45 | 				{{end}}  | 
46 | 46 | 			</div>  | 
47 | 47 | 
 
  | 
48 |  | -			<form class="ui form form-fetch-action" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"  | 
49 |  | -				method="post">  | 
 | 48 | +			<form class="ui form form-fetch-action" method="post" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}">  | 
50 | 49 | 				{{.CsrfTokenHtml}}  | 
51 | 50 | 
 
  | 
52 | 51 | 				{{if not .Issue.IsLocked}}  | 
53 | 52 | 					<div class="field">  | 
54 |  | -						<strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong>  | 
 | 53 | +						<strong>{{ctx.Locale.Tr "repo.issues.lock.reason"}}</strong>  | 
55 | 54 | 					</div>  | 
56 | 55 | 
 
  | 
57 | 56 | 					<div class="field">  | 
58 | 57 | 						<div class="ui fluid dropdown selection">  | 
59 |  | - | 
60 |  | -							<select name="reason">  | 
61 |  | -								<option value=""> </option>  | 
62 |  | -								{{range .LockReasons}}  | 
63 |  | -									<option value="{{.}}">{{.}}</option>  | 
64 |  | -								{{end}}  | 
65 |  | -							</select>  | 
66 |  | -							{{svg "octicon-triangle-down" 14 "dropdown icon"}}  | 
67 |  | - | 
68 |  | -							<div class="default text"> </div>  | 
69 |  | - | 
 | 58 | +							<input type="hidden" name="reason">  | 
 | 59 | +							<div class="text"></div> {{svg "octicon-triangle-down" 14 "dropdown icon"}}  | 
70 | 60 | 							<div class="menu">  | 
 | 61 | +								<div class="item" data-value=""></div>  | 
71 | 62 | 								{{range .LockReasons}}  | 
72 | 63 | 									<div class="item" data-value="{{.}}">{{.}}</div>  | 
73 | 64 | 								{{end}}  | 
 | 
78 | 69 | 
 
  | 
79 | 70 | 				<div class="actions">  | 
80 | 71 | 					<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>  | 
81 |  | -					<button class="ui red button">  | 
 | 72 | +					{{/* explicitly focus the submit button, to avoid Fomantic modal focuses and popups the dropdown */}}  | 
 | 73 | +					<button class="ui red button" autofocus>  | 
82 | 74 | 						{{if .Issue.IsLocked}}  | 
83 | 75 | 							{{ctx.Locale.Tr "repo.issues.unlock_confirm"}}  | 
84 | 76 | 						{{else}}  | 
 | 
0 commit comments