Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

options.tmpl 54KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  1. {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}}
  2. <div class="user-main-content twelve wide column">
  3. <h4 class="ui top attached header">
  4. {{ctx.Locale.Tr "repo.settings.basic_settings"}}
  5. </h4>
  6. <div class="ui attached segment">
  7. <form class="ui form" action="{{.Link}}" method="post">
  8. {{template "base/disable_form_autofill"}}
  9. {{.CsrfTokenHtml}}
  10. <input type="hidden" name="action" value="update">
  11. <div class="required field {{if .Err_RepoName}}error{{end}}">
  12. <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
  13. <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
  14. </div>
  15. <div class="inline field">
  16. <label>{{ctx.Locale.Tr "repo.repo_size"}}</label>
  17. <span {{if not (eq .Repository.Size 0)}} data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>{{FileSize .Repository.Size}}</span>
  18. </div>
  19. <div class="inline field">
  20. <label>{{ctx.Locale.Tr "repo.template"}}</label>
  21. <div class="ui checkbox">
  22. <input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
  23. <label>{{ctx.Locale.Tr "repo.template_helper"}}</label>
  24. </div>
  25. </div>
  26. {{if not .Repository.IsFork}}
  27. <div class="inline field">
  28. <label>{{ctx.Locale.Tr "repo.visibility"}}</label>
  29. <div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{ctx.Locale.Tr "repo.stars_remove_warning"}}"{{end}}>
  30. {{if .IsAdmin}}
  31. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  32. {{else}}
  33. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}>
  34. {{end}}
  35. <label>{{ctx.Locale.Tr "repo.visibility_helper"}} {{if .Repository.NumForks}}<span class="text red">{{ctx.Locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
  36. </div>
  37. </div>
  38. {{end}}
  39. <div class="field {{if .Err_Description}}error{{end}}">
  40. <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
  41. <textarea id="description" name="description" rows="2" maxlength="2048">{{.Repository.Description}}</textarea>
  42. </div>
  43. <div class="field {{if .Err_Website}}error{{end}}">
  44. <label for="website">{{ctx.Locale.Tr "repo.settings.site"}}</label>
  45. <input id="website" name="website" type="url" maxlength="1024" value="{{.Repository.Website}}">
  46. </div>
  47. <div class="field">
  48. <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
  49. </div>
  50. </form>
  51. <div class="divider"></div>
  52. <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
  53. {{.CsrfTokenHtml}}
  54. <div class="inline field">
  55. <label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
  56. <input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
  57. </div>
  58. <div class="field">
  59. <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
  60. <button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
  61. </div>
  62. </form>
  63. </div>
  64. {{/* These variables exist to make the logic in the Settings window easier to comprehend and are not used later on. */}}
  65. {{$newMirrorsPartiallyEnabled := or (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}}
  66. {{/* .Repository.IsMirror is not always reliable if the repository is not actively acting as a mirror because of errors. */}}
  67. {{$showMirrorSettings := and (.Repository.UnitEnabled $.Context $.UnitTypeCode) (or $newMirrorsPartiallyEnabled .Repository.IsMirror .PullMirror .PushMirrors)}}
  68. {{$newMirrorsEntirelyEnabled := and (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}}
  69. {{$onlyNewPushMirrorsEnabled := and (not .DisableNewPushMirrors) .DisableNewPullMirrors}}
  70. {{$onlyNewPullMirrorsEnabled := and .DisableNewPushMirrors (not .DisableNewPullMirrors)}}
  71. {{$existingPushMirror := or .Repository.IsMirror .PushMirrors}}
  72. {{$modifyBrokenPullMirror := and .Repository.IsMirror (not .PullMirror)}}
  73. {{$isWorkingPullMirror := .PullMirror}}
  74. {{if $showMirrorSettings}}
  75. <h4 class="ui top attached header">
  76. {{ctx.Locale.Tr "repo.settings.mirror_settings"}}
  77. </h4>
  78. <div class="ui attached segment">
  79. {{if .Repository.IsArchived}}
  80. <div class="ui warning message tw-text-center">
  81. {{ctx.Locale.Tr "repo.settings.archive.mirrors_unavailable"}}
  82. </div>
  83. {{else}}
  84. {{if $newMirrorsEntirelyEnabled}}
  85. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs"}}
  86. <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
  87. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}}
  88. <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br>
  89. {{else if $onlyNewPushMirrorsEnabled}}
  90. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}}
  91. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
  92. <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br>
  93. {{else if $onlyNewPullMirrorsEnabled}}
  94. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}}
  95. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}}
  96. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
  97. <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
  98. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}}
  99. {{if $existingPushMirror}}
  100. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
  101. {{end}}
  102. {{else}}
  103. {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br>
  104. {{end}}
  105. {{if .Repository.IsMirror}}
  106. <table class="ui table">
  107. <thead>
  108. <tr>
  109. <th class="tw-w-2/5">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th>
  110. <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th>
  111. <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
  112. <th></th>
  113. </tr>
  114. </thead>
  115. {{if $modifyBrokenPullMirror}}
  116. {{/* even if a repo is a pull mirror (IsMirror=true), the PullMirror might still be nil if the mirror migration is broken */}}
  117. <tbody>
  118. <tr>
  119. <td colspan="4">
  120. <div class="text red tw-py-4">{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}</div>
  121. </td>
  122. </tr>
  123. </tbody>
  124. {{else if $isWorkingPullMirror}}
  125. <tbody>
  126. <tr>
  127. <td>{{.PullMirror.RemoteAddress}}</td>
  128. <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
  129. <td>{{DateTime "full" .PullMirror.UpdatedUnix}}</td>
  130. <td class="right aligned">
  131. <form method="post" class="tw-inline-block">
  132. {{.CsrfTokenHtml}}
  133. <input type="hidden" name="action" value="mirror-sync">
  134. <button class="ui primary tiny button inline text-thin">{{ctx.Locale.Tr "repo.settings.sync_mirror"}}</button>
  135. </form>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td colspan="4">
  140. <form class="ui form" method="post">
  141. {{template "base/disable_form_autofill"}}
  142. {{.CsrfTokenHtml}}
  143. <input type="hidden" name="action" value="mirror">
  144. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  145. <label>{{ctx.Locale.Tr "repo.mirror_prune"}}</label>
  146. <div class="ui checkbox">
  147. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .PullMirror.EnablePrune}}checked{{end}}>
  148. <label>{{ctx.Locale.Tr "repo.mirror_prune_desc"}}</label>
  149. </div>
  150. </div>
  151. <div class="inline field {{if .Err_Interval}}error{{end}}">
  152. <label for="interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
  153. <input id="interval" name="interval" value="{{.PullMirror.Interval}}">
  154. </div>
  155. {{$address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName}}
  156. <div class="field {{if .Err_MirrorAddress}}error{{end}}">
  157. <label for="mirror_address">{{ctx.Locale.Tr "repo.mirror_address"}}</label>
  158. <input id="mirror_address" name="mirror_address" value="{{$address.Address}}" required>
  159. <p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
  160. </div>
  161. <details class="ui optional field" {{if or .Err_Auth $address.Username}}open{{end}}>
  162. <summary class="tw-p-1">
  163. {{ctx.Locale.Tr "repo.need_auth"}}
  164. </summary>
  165. <div class="tw-p-1">
  166. <div class="inline field {{if .Err_Auth}}error{{end}}">
  167. <label for="mirror_username">{{ctx.Locale.Tr "username"}}</label>
  168. <input id="mirror_username" name="mirror_username" value="{{$address.Username}}" {{if not .mirror_username}}data-need-clear="true"{{end}}>
  169. </div>
  170. <div class="inline field {{if .Err_Auth}}error{{end}}">
  171. <label for="mirror_password">{{ctx.Locale.Tr "password"}}</label>
  172. <input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{ctx.Locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{ctx.Locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off">
  173. </div>
  174. <p class="help">{{ctx.Locale.Tr "repo.mirror_password_help"}}</p>
  175. </div>
  176. </details>
  177. {{if .LFSStartServer}}
  178. <div class="inline field">
  179. <label>{{ctx.Locale.Tr "repo.mirror_lfs"}}</label>
  180. <div class="ui checkbox">
  181. <input id="mirror_lfs" name="mirror_lfs" type="checkbox" {{if .PullMirror.LFS}}checked{{end}}>
  182. <label>{{ctx.Locale.Tr "repo.mirror_lfs_desc"}}</label>
  183. </div>
  184. </div>
  185. <div class="field {{if .Err_LFSEndpoint}}error{{end}}">
  186. <label for="mirror_lfs_endpoint">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint"}}</label>
  187. <input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
  188. <p class="help">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery"}}</p>
  189. </div>
  190. {{end}}
  191. <div class="field">
  192. <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_mirror_settings"}}</button>
  193. </div>
  194. </form>
  195. </td>
  196. </tr>
  197. </tbody>
  198. {{end}}{{/* end if: $modifyBrokenPullMirror / $isWorkingPullMirror */}}
  199. </table>
  200. {{end}}{{/* end if .Repository.IsMirror */}}
  201. <table class="ui table">
  202. <thead>
  203. <tr>
  204. <th class="tw-w-2/5">{{ctx.Locale.Tr "repo.settings.mirror_settings.pushed_repository"}}</th>
  205. <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th>
  206. <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
  207. <th></th>
  208. </tr>
  209. </thead>
  210. <tbody>
  211. {{range .PushMirrors}}
  212. <tr>
  213. <td class="gt-word-break">{{.RemoteAddress}}</td>
  214. <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
  215. <td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
  216. <td class="right aligned">
  217. <button
  218. class="ui tiny button show-modal"
  219. data-modal="#push-mirror-edit-modal"
  220. data-tooltip-content="{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}"
  221. data-modal-push-mirror-edit-id="{{.ID}}"
  222. data-modal-push-mirror-edit-interval="{{.Interval}}"
  223. data-modal-push-mirror-edit-address="{{.RemoteAddress}}"
  224. >
  225. {{svg "octicon-pencil" 14}}
  226. </button>
  227. <form method="post" class="tw-inline-block">
  228. {{$.CsrfTokenHtml}}
  229. <input type="hidden" name="action" value="push-mirror-sync">
  230. <input type="hidden" name="push_mirror_id" value="{{.ID}}">
  231. <button class="ui primary tiny button" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button>
  232. </form>
  233. <form method="post" class="tw-inline-block">
  234. {{$.CsrfTokenHtml}}
  235. <input type="hidden" name="action" value="push-mirror-remove">
  236. <input type="hidden" name="push_mirror_id" value="{{.ID}}">
  237. <button class="ui basic red tiny button" data-tooltip-content="{{ctx.Locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button>
  238. </form>
  239. </td>
  240. </tr>
  241. {{else}}
  242. <tr>
  243. <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td>
  244. </tr>
  245. {{end}}
  246. {{if (not .DisableNewPushMirrors)}}
  247. <tr>
  248. <td colspan="4">
  249. <form class="ui form" method="post">
  250. {{template "base/disable_form_autofill"}}
  251. {{.CsrfTokenHtml}}
  252. <input type="hidden" name="action" value="push-mirror-add">
  253. <div class="field {{if .Err_PushMirrorAddress}}error{{end}}">
  254. <label for="push_mirror_address">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label>
  255. <input id="push_mirror_address" name="push_mirror_address" value="{{.push_mirror_address}}" required>
  256. <p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
  257. </div>
  258. <details class="ui optional field" {{if or .Err_PushMirrorAuth .push_mirror_username}}open{{end}}>
  259. <summary class="tw-p-1">
  260. {{ctx.Locale.Tr "repo.need_auth"}}
  261. </summary>
  262. <div class="tw-p-1">
  263. <div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
  264. <label for="push_mirror_username">{{ctx.Locale.Tr "username"}}</label>
  265. <input id="push_mirror_username" name="push_mirror_username" value="{{.push_mirror_username}}">
  266. </div>
  267. <div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
  268. <label for="push_mirror_password">{{ctx.Locale.Tr "password"}}</label>
  269. <input id="push_mirror_password" name="push_mirror_password" type="password" value="{{.push_mirror_password}}" autocomplete="off">
  270. </div>
  271. </div>
  272. </details>
  273. <div class="field">
  274. <div class="ui checkbox">
  275. <input id="push_mirror_sync_on_commit" name="push_mirror_sync_on_commit" type="checkbox" {{if .push_mirror_sync_on_commit}}checked{{end}}>
  276. <label for="push_mirror_sync_on_commit">{{ctx.Locale.Tr "repo.mirror_sync_on_commit"}}</label>
  277. </div>
  278. </div>
  279. <div class="inline field {{if .Err_PushMirrorInterval}}error{{end}}">
  280. <label for="push_mirror_interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
  281. <input id="push_mirror_interval" name="push_mirror_interval" value="{{if .push_mirror_interval}}{{.push_mirror_interval}}{{else}}{{.DefaultMirrorInterval}}{{end}}">
  282. </div>
  283. <div class="field">
  284. <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
  285. </div>
  286. </form>
  287. </td>
  288. </tr>
  289. {{end}}
  290. </tbody>
  291. </table>
  292. {{end}}
  293. </div>
  294. {{end}}
  295. <h4 class="ui top attached header">
  296. {{ctx.Locale.Tr "repo.settings.advanced_settings"}}
  297. </h4>
  298. <div class="ui attached segment">
  299. <form class="ui form" method="post">
  300. {{.CsrfTokenHtml}}
  301. <input type="hidden" name="action" value="advanced">
  302. {{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}}
  303. {{$isCodeGlobalDisabled := .UnitTypeCode.UnitGlobalDisabled}}
  304. <div class="inline field">
  305. <label>{{ctx.Locale.Tr "repo.code"}}</label>
  306. <div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  307. <input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}>
  308. <label>{{ctx.Locale.Tr "repo.code.desc"}}</label>
  309. </div>
  310. </div>
  311. {{$isWikiEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeWiki) (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}
  312. {{$isWikiGlobalDisabled := .UnitTypeWiki.UnitGlobalDisabled}}
  313. {{$isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled}}
  314. {{$isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled}}
  315. <div class="inline field">
  316. <label>{{ctx.Locale.Tr "repo.wiki"}}</label>
  317. <div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  318. <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
  319. <label>{{ctx.Locale.Tr "repo.settings.wiki_desc"}}</label>
  320. </div>
  321. </div>
  322. <div class="field{{if not $isWikiEnabled}} disabled{{end}}" id="wiki_box">
  323. <div class="field">
  324. <div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  325. <input class="enable-system-radio" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}checked{{end}}>
  326. <label>{{ctx.Locale.Tr "repo.settings.use_internal_wiki"}}</label>
  327. </div>
  328. </div>
  329. <div class="inline field tw-pl-4">
  330. <label>{{ctx.Locale.Tr "repo.settings.default_wiki_branch_name"}}</label>
  331. <input name="default_wiki_branch" value="{{.Repository.DefaultWikiBranch}}">
  332. </div>
  333. <div class="field">
  334. <div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  335. <input class="enable-system-radio" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki}}checked{{end}}>
  336. <label>{{ctx.Locale.Tr "repo.settings.use_external_wiki"}}</label>
  337. </div>
  338. </div>
  339. <div class="field tw-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
  340. <label for="external_wiki_url">{{ctx.Locale.Tr "repo.settings.external_wiki_url"}}</label>
  341. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
  342. <p class="help">{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}</p>
  343. </div>
  344. </div>
  345. <div class="divider"></div>
  346. {{$isIssuesEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeIssues) (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}
  347. {{$isIssuesGlobalDisabled := .UnitTypeIssues.UnitGlobalDisabled}}
  348. {{$isExternalTrackerGlobalDisabled := .UnitTypeExternalTracker.UnitGlobalDisabled}}
  349. {{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}}
  350. <div class="inline field">
  351. <label>{{ctx.Locale.Tr "repo.issues"}}</label>
  352. <div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  353. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
  354. <label>{{ctx.Locale.Tr "repo.settings.issues_desc"}}</label>
  355. </div>
  356. </div>
  357. <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
  358. <div class="field">
  359. <div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  360. <input class="enable-system-radio" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}checked{{end}}>
  361. <label>{{ctx.Locale.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  362. </div>
  363. </div>
  364. <div class="field tw-pl-4 {{if (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
  365. {{if .Repository.CanEnableTimetracker}}
  366. <div class="field">
  367. <div class="ui checkbox">
  368. <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled $.Context}}checked{{end}}>
  369. <label>{{ctx.Locale.Tr "repo.settings.enable_timetracker"}}</label>
  370. </div>
  371. </div>
  372. <div class="field {{if not (.Repository.IsTimetrackerEnabled $.Context)}}disabled{{end}}" id="only_contributors">
  373. <div class="ui checkbox">
  374. <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime $.Context}}checked{{end}}>
  375. <label>{{ctx.Locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
  376. </div>
  377. </div>
  378. {{end}}
  379. <div class="field">
  380. <div class="ui checkbox">
  381. <input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled $.Context)}}checked{{end}}>
  382. <label>{{ctx.Locale.Tr "repo.issues.dependency.setting"}}</label>
  383. </div>
  384. </div>
  385. <div class="ui checkbox">
  386. <input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{if .Repository.CloseIssuesViaCommitInAnyBranch}}checked{{end}}>
  387. <label>{{ctx.Locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
  388. </div>
  389. </div>
  390. <div class="field">
  391. <div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  392. <input class="enable-system-radio" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalTracker}}checked{{end}}>
  393. <label>{{ctx.Locale.Tr "repo.settings.use_external_issue_tracker"}}</label>
  394. </div>
  395. </div>
  396. <div class="field tw-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
  397. <div class="field">
  398. <label for="external_tracker_url">{{ctx.Locale.Tr "repo.settings.external_tracker_url"}}</label>
  399. <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
  400. <p class="help">{{ctx.Locale.Tr "repo.settings.external_tracker_url_desc"}}</p>
  401. </div>
  402. <div class="field">
  403. <label for="tracker_url_format">{{ctx.Locale.Tr "repo.settings.tracker_url_format"}}</label>
  404. <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerFormat}}" placeholder="https://github.com/{user}/{repo}/issues/{index}">
  405. <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_url_format_desc"}}</p>
  406. </div>
  407. <div class="inline fields">
  408. <label for="issue_style">{{ctx.Locale.Tr "repo.settings.tracker_issue_style"}}</label>
  409. <div class="field">
  410. <div class="ui radio checkbox">
  411. {{$externalTracker := (.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker)}}
  412. {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
  413. <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="numeric" {{if eq $externalTrackerStyle "numeric"}}checked{{end}}>
  414. <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label>
  415. </div>
  416. </div>
  417. <div class="field">
  418. <div class="ui radio checkbox">
  419. <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq $externalTrackerStyle "alphanumeric"}}checked{{end}}>
  420. <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label>
  421. </div>
  422. </div>
  423. <div class="field">
  424. <div class="ui radio checkbox">
  425. <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="regexp" {{if eq $externalTrackerStyle "regexp"}}checked{{end}}>
  426. <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label>
  427. </div>
  428. </div>
  429. </div>
  430. <div class="field {{if ne $externalTrackerStyle "regexp"}}disabled{{end}}" id="tracker-issue-style-regex-box">
  431. <label for="external_tracker_regexp_pattern">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label>
  432. <input id="external_tracker_regexp_pattern" name="external_tracker_regexp_pattern" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerRegexpPattern}}">
  433. <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc"}}</p>
  434. </div>
  435. </div>
  436. </div>
  437. <div class="divider"></div>
  438. {{$isProjectsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeProjects}}
  439. {{$isProjectsGlobalDisabled := .UnitTypeProjects.UnitGlobalDisabled}}
  440. {{$projectsUnit := .Repository.MustGetUnit $.Context $.UnitTypeProjects}}
  441. <div class="inline field">
  442. <label>{{ctx.Locale.Tr "repo.project_board"}}</label>
  443. <div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  444. <input class="enable-system" name="enable_projects" type="checkbox" data-target="#projects_box" {{if $isProjectsEnabled}}checked{{end}}>
  445. <label>{{ctx.Locale.Tr "repo.settings.projects_desc"}}</label>
  446. </div>
  447. </div>
  448. <div class="field {{if not $isProjectsEnabled}} disabled{{end}} tw-pl-4" id="projects_box">
  449. <p>
  450. {{ctx.Locale.Tr "repo.settings.projects_mode_desc"}}
  451. </p>
  452. <div class="ui dropdown selection">
  453. <select name="projects_mode">
  454. <option value="repo" {{if or (not $isProjectsEnabled) (eq $projectsUnit.ProjectsConfig.GetProjectsMode "repo")}}selected{{end}}>{{ctx.Locale.Tr "repo.settings.projects_mode_repo"}}</option>
  455. <option value="owner" {{if or (not $isProjectsEnabled) (eq $projectsUnit.ProjectsConfig.GetProjectsMode "owner")}}selected{{end}}>{{ctx.Locale.Tr "repo.settings.projects_mode_owner"}}</option>
  456. <option value="all" {{if or (not $isProjectsEnabled) (eq $projectsUnit.ProjectsConfig.GetProjectsMode "all")}}selected{{end}}>{{ctx.Locale.Tr "repo.settings.projects_mode_all"}}</option>
  457. </select>
  458. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  459. <div class="default text">
  460. {{if (eq $projectsUnit.ProjectsConfig.GetProjectsMode "repo")}}
  461. {{ctx.Locale.Tr "repo.settings.projects_mode_repo"}}
  462. {{end}}
  463. {{if (eq $projectsUnit.ProjectsConfig.GetProjectsMode "owner")}}
  464. {{ctx.Locale.Tr "repo.settings.projects_mode_owner"}}
  465. {{end}}
  466. {{if (eq $projectsUnit.ProjectsConfig.GetProjectsMode "all")}}
  467. {{ctx.Locale.Tr "repo.settings.projects_mode_all"}}
  468. {{end}}
  469. </div>
  470. <div class="menu">
  471. <div class="item" data-value="repo">{{ctx.Locale.Tr "repo.settings.projects_mode_repo"}}</div>
  472. <div class="item" data-value="owner">{{ctx.Locale.Tr "repo.settings.projects_mode_owner"}}</div>
  473. <div class="item" data-value="all">{{ctx.Locale.Tr "repo.settings.projects_mode_all"}}</div>
  474. </div>
  475. </div>
  476. </div>
  477. <div class="divider"></div>
  478. {{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}}
  479. {{$isReleasesGlobalDisabled := .UnitTypeReleases.UnitGlobalDisabled}}
  480. <div class="inline field">
  481. <label>{{ctx.Locale.Tr "repo.releases"}}</label>
  482. <div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  483. <input class="enable-system" name="enable_releases" type="checkbox" {{if $isReleasesEnabled}}checked{{end}}>
  484. <label>{{ctx.Locale.Tr "repo.settings.releases_desc"}}</label>
  485. </div>
  486. </div>
  487. {{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}}
  488. {{$isPackagesGlobalDisabled := .UnitTypePackages.UnitGlobalDisabled}}
  489. <div class="inline field">
  490. <label>{{ctx.Locale.Tr "repo.packages"}}</label>
  491. <div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  492. <input class="enable-system" name="enable_packages" type="checkbox" {{if $isPackagesEnabled}}checked{{end}}>
  493. <label>{{ctx.Locale.Tr "repo.settings.packages_desc"}}</label>
  494. </div>
  495. </div>
  496. {{if .EnableActions}}
  497. {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}}
  498. {{$isActionsGlobalDisabled := .UnitTypeActions.UnitGlobalDisabled}}
  499. <div class="inline field">
  500. <label>{{ctx.Locale.Tr "actions.actions"}}</label>
  501. <div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  502. <input class="enable-system" name="enable_actions" type="checkbox" {{if $isActionsEnabled}}checked{{end}}>
  503. <label>{{ctx.Locale.Tr "repo.settings.actions_desc"}}</label>
  504. </div>
  505. </div>
  506. {{end}}
  507. {{if not .IsMirror}}
  508. <div class="divider"></div>
  509. {{$pullRequestEnabled := .Repository.UnitEnabled $.Context $.UnitTypePullRequests}}
  510. {{$pullRequestGlobalDisabled := .UnitTypePullRequests.UnitGlobalDisabled}}
  511. {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}
  512. <div class="inline field">
  513. <label>{{ctx.Locale.Tr "repo.pulls"}}</label>
  514. <div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
  515. <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
  516. <label>{{ctx.Locale.Tr "repo.settings.pulls_desc"}}</label>
  517. </div>
  518. </div>
  519. <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
  520. <div class="field">
  521. <p>
  522. {{ctx.Locale.Tr "repo.settings.merge_style_desc"}}
  523. </p>
  524. </div>
  525. <div class="field">
  526. <div class="ui checkbox">
  527. <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
  528. <label>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</label>
  529. </div>
  530. </div>
  531. <div class="field">
  532. <div class="ui checkbox">
  533. <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
  534. <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label>
  535. </div>
  536. </div>
  537. <div class="field">
  538. <div class="ui checkbox">
  539. <input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}>
  540. <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label>
  541. </div>
  542. </div>
  543. <div class="field">
  544. <div class="ui checkbox">
  545. <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
  546. <label>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</label>
  547. </div>
  548. </div>
  549. <div class="field">
  550. <div class="ui checkbox">
  551. <input name="pulls_allow_fast_forward_only" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowFastForwardOnly)}}checked{{end}}>
  552. <label>{{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}</label>
  553. </div>
  554. </div>
  555. <div class="field">
  556. <div class="ui checkbox">
  557. <input name="pulls_allow_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowManualMerge)}}checked{{end}}>
  558. <label>{{ctx.Locale.Tr "repo.pulls.merge_manually"}}</label>
  559. </div>
  560. </div>
  561. <div class="field">
  562. <p>
  563. {{ctx.Locale.Tr "repo.settings.default_merge_style_desc"}}
  564. </p>
  565. <div class="ui dropdown selection">
  566. <select name="pulls_default_merge_style">
  567. <option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</option>
  568. <option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option>
  569. <option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option>
  570. <option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</option>
  571. <option value="fast-forward-only" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "fast-forward-only")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}</option>
  572. </select>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
  573. <div class="default text">
  574. {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}
  575. {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}
  576. {{end}}
  577. {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}
  578. {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}
  579. {{end}}
  580. {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}
  581. {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}
  582. {{end}}
  583. {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}
  584. {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}
  585. {{end}}
  586. {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "fast-forward-only")}}
  587. {{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}
  588. {{end}}
  589. </div>
  590. <div class="menu">
  591. <div class="item" data-value="merge">{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</div>
  592. <div class="item" data-value="rebase">{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
  593. <div class="item" data-value="rebase-merge">{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>
  594. <div class="item" data-value="squash">{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</div>
  595. <div class="item" data-value="fast-forward-only">{{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}</div>
  596. </div>
  597. </div>
  598. </div>
  599. <div class="field">
  600. <div class="ui checkbox">
  601. <input name="default_allow_maintainer_edit" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultAllowMaintainerEdit)}}checked{{end}}>
  602. <label>{{ctx.Locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label>
  603. </div>
  604. </div>
  605. <div class="field">
  606. <div class="ui checkbox">
  607. <input name="pulls_allow_rebase_update" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseUpdate)}}checked{{end}}>
  608. <label>{{ctx.Locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label>
  609. </div>
  610. </div>
  611. <div class="field">
  612. <div class="ui checkbox">
  613. <input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}>
  614. <label>{{ctx.Locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label>
  615. </div>
  616. </div>
  617. <div class="field">
  618. <div class="ui checkbox">
  619. <input name="enable_autodetect_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AutodetectManualMerge)}}checked{{end}}>
  620. <label>{{ctx.Locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label>
  621. </div>
  622. </div>
  623. <div class="field">
  624. <div class="ui checkbox">
  625. <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
  626. <label>{{ctx.Locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
  627. </div>
  628. </div>
  629. </div>
  630. {{end}}
  631. <div class="divider"></div>
  632. <div class="field">
  633. <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
  634. </div>
  635. </form>
  636. </div>
  637. <h4 class="ui top attached header">
  638. {{ctx.Locale.Tr "repo.settings.signing_settings"}}
  639. </h4>
  640. <div class="ui attached segment">
  641. <form class="ui form" method="post">
  642. {{.CsrfTokenHtml}}
  643. <input type="hidden" name="action" value="signing">
  644. <div class="field">
  645. <label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label><br>
  646. <div class="field">
  647. <div class="ui radio checkbox">
  648. <input type="radio" id="trust_model_default" name="trust_model" {{if eq .Repository.TrustModel.String "default"}}checked="checked"{{end}} value="default">
  649. <label for="trust_model_default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</label>
  650. <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.default.desc"}}</p>
  651. </div>
  652. </div>
  653. <div class="field">
  654. <div class="ui radio checkbox">
  655. <input type="radio" id="trust_model_collaborator" name="trust_model" {{if eq .Repository.TrustModel.String "collaborator"}}checked="checked"{{end}} value="collaborator">
  656. <label for="trust_model_collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.long"}}</label>
  657. <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p>
  658. </div>
  659. </div>
  660. <div class="field">
  661. <div class="ui radio checkbox">
  662. <input type="radio" name="trust_model" id="trust_model_committer" {{if eq .Repository.TrustModel.String "committer"}}checked="checked"{{end}} value="committer">
  663. <label for="trust_model_committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer.long"}}</label>
  664. <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.committer.desc"}}</p>
  665. </div>
  666. </div>
  667. <div class="field">
  668. <div class="ui radio checkbox">
  669. <input type="radio" name="trust_model" id="trust_model_collaboratorcommitter" {{if eq .Repository.TrustModel.String "collaboratorcommitter"}}checked="checked"{{end}} value="collaboratorcommitter">
  670. <label for="trust_model_collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label>
  671. <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p>
  672. </div>
  673. </div>
  674. </div>
  675. <div class="divider"></div>
  676. <div class="field">
  677. <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
  678. </div>
  679. </form>
  680. </div>
  681. {{if .IsAdmin}}
  682. <h4 class="ui top attached header">
  683. {{ctx.Locale.Tr "repo.settings.admin_settings"}}
  684. </h4>
  685. <div class="ui attached segment">
  686. <form class="ui form" method="post">
  687. {{.CsrfTokenHtml}}
  688. <input type="hidden" name="action" value="admin">
  689. <div class="field">
  690. <div class="ui checkbox">
  691. <input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
  692. <label>{{ctx.Locale.Tr "repo.settings.admin_enable_health_check"}}</label>
  693. </div>
  694. </div>
  695. <div class="field">
  696. <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
  697. </div>
  698. </form>
  699. <div class="divider"></div>
  700. <form class="ui form" method="post">
  701. {{.CsrfTokenHtml}}
  702. <input type="hidden" name="action" value="admin_index">
  703. {{if .CodeIndexerEnabled}}
  704. <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
  705. <div class="inline fields">
  706. <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
  707. <span class="field">
  708. {{if .CodeIndexerStatus}}
  709. <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}">
  710. <span class="shortsha">{{ShortSha .CodeIndexerStatus.CommitSha}}</span>
  711. </a>
  712. {{else}}
  713. <span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
  714. {{end}}
  715. </span>
  716. <div class="field">
  717. <button class="ui primary button" name="request_reindex_type" value="code">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
  718. </div>
  719. </div>
  720. {{end}}
  721. <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
  722. <div class="inline fields">
  723. {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
  724. <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
  725. {{end}}
  726. <span class="field">
  727. {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
  728. <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
  729. <span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
  730. </a>
  731. {{else}}
  732. <span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
  733. {{end}}
  734. </span>
  735. <div class="field">
  736. <button class="ui primary button" name="request_reindex_type" value="stats">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
  737. </div>
  738. </div>
  739. </form>
  740. </div>
  741. {{end}}
  742. {{if .Permission.IsOwner}}
  743. <h4 class="ui top attached error header">
  744. {{ctx.Locale.Tr "repo.settings.danger_zone"}}
  745. </h4>
  746. <div class="ui attached error danger segment">
  747. <div class="flex-list">
  748. {{if .Repository.IsMirror}}
  749. <div class="flex-item">
  750. <div class="flex-item-main">
  751. <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert"}}</div>
  752. <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_desc"}}</div>
  753. </div>
  754. <div class="flex-item-trailing">
  755. <button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{ctx.Locale.Tr "repo.settings.convert"}}</button>
  756. </div>
  757. </div>
  758. {{end}}
  759. {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
  760. <div class="flex-item">
  761. <div class="flex-item-main">
  762. <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div>
  763. <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_fork_desc"}}</div>
  764. </div>
  765. <div class="flex-item-trailing">
  766. <button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</button>
  767. </div>
  768. </div>
  769. {{end}}
  770. <div class="flex-item">
  771. <div class="flex-item-main">
  772. <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.transfer"}}</div>
  773. <div class="flex-item-body">
  774. {{if .RepoTransfer}}
  775. {{ctx.Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}
  776. {{else}}
  777. {{ctx.Locale.Tr "repo.settings.transfer_desc"}}
  778. {{end}}
  779. </div>
  780. </div>
  781. <div class="flex-item-trailing">
  782. {{if .RepoTransfer}}
  783. <form class="ui form" action="{{.Link}}" method="post">
  784. {{.CsrfTokenHtml}}
  785. <input type="hidden" name="action" value="cancel_transfer">
  786. <button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_abort"}}</button>
  787. </form>
  788. {{else}}
  789. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{ctx.Locale.Tr "repo.settings.transfer"}}</button>
  790. {{end}}
  791. </div>
  792. </div>
  793. {{if .Permission.CanRead $.UnitTypeWiki}}
  794. <div class="flex-item">
  795. <div class="flex-item-main">
  796. <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</div>
  797. <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.wiki_delete_desc"}}</div>
  798. </div>
  799. <div class="flex-item-trailing">
  800. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</button>
  801. </div>
  802. </div>
  803. {{end}}
  804. <div class="flex-item">
  805. <div class="flex-item-main">
  806. <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.delete"}}</div>
  807. <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.delete_desc"}}</div>
  808. </div>
  809. <div class="flex-item-trailing">
  810. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button>
  811. </div>
  812. </div>
  813. {{if not .Repository.IsMirror}}
  814. <div class="flex-item tw-items-center">
  815. <div class="flex-item-main">
  816. {{if .Repository.IsArchived}}
  817. <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.unarchive.header"}}</div>
  818. <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.unarchive.text"}}</div>
  819. {{else}}
  820. <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.archive.header"}}</div>
  821. <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.archive.text"}}</div>
  822. {{end}}
  823. </div>
  824. <div class="flex-item-trailing">
  825. <button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
  826. {{if .Repository.IsArchived}}
  827. {{ctx.Locale.Tr "repo.settings.unarchive.button"}}
  828. {{else}}
  829. {{ctx.Locale.Tr "repo.settings.archive.button"}}
  830. {{end}}
  831. </button>
  832. </div>
  833. </div>
  834. {{end}}
  835. </div>
  836. </div>
  837. {{end}}
  838. </div>
  839. {{template "repo/settings/layout_footer" .}}
  840. {{if .Permission.IsOwner}}
  841. {{if .Repository.IsMirror}}
  842. <div class="ui small modal" id="convert-mirror-repo-modal">
  843. <div class="header">
  844. {{ctx.Locale.Tr "repo.settings.convert"}}
  845. </div>
  846. <div class="content">
  847. <div class="ui warning message">
  848. {{ctx.Locale.Tr "repo.settings.convert_notices_1"}}
  849. </div>
  850. <form class="ui form" action="{{.Link}}" method="post">
  851. {{.CsrfTokenHtml}}
  852. <input type="hidden" name="action" value="convert">
  853. <div class="field">
  854. <label>
  855. {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
  856. <span class="text red">{{.Repository.Name}}</span>
  857. </label>
  858. </div>
  859. <div class="required field">
  860. <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
  861. <input id="repo_name" name="repo_name" required maxlength="100">
  862. </div>
  863. <div class="text right actions">
  864. <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
  865. <button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_confirm"}}</button>
  866. </div>
  867. </form>
  868. </div>
  869. </div>
  870. {{end}}
  871. {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
  872. <div class="ui small modal" id="convert-fork-repo-modal">
  873. <div class="header">
  874. {{ctx.Locale.Tr "repo.settings.convert_fork"}}
  875. </div>
  876. <div class="content">
  877. <div class="ui warning message">
  878. {{ctx.Locale.Tr "repo.settings.convert_fork_notices_1"}}
  879. </div>
  880. <form class="ui form" action="{{.Link}}" method="post">
  881. {{.CsrfTokenHtml}}
  882. <input type="hidden" name="action" value="convert_fork">
  883. <div class="field">
  884. <label>
  885. {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
  886. <span class="text red">{{.Repository.Name}}</span>
  887. </label>
  888. </div>
  889. <div class="required field">
  890. <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
  891. <input id="repo_name" name="repo_name" required>
  892. </div>
  893. <div class="text right actions">
  894. <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
  895. <button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_fork_confirm"}}</button>
  896. </div>
  897. </form>
  898. </div>
  899. </div>
  900. {{end}}
  901. <div class="ui small modal" id="transfer-repo-modal">
  902. <div class="header">
  903. {{ctx.Locale.Tr "repo.settings.transfer"}}
  904. </div>
  905. <div class="content">
  906. <div class="ui warning message">
  907. {{ctx.Locale.Tr "repo.settings.transfer_notices_1"}} <br>
  908. {{ctx.Locale.Tr "repo.settings.transfer_notices_2"}} <br>
  909. {{ctx.Locale.Tr "repo.settings.transfer_notices_3"}}
  910. </div>
  911. <form class="ui form" action="{{.Link}}" method="post">
  912. {{.CsrfTokenHtml}}
  913. <input type="hidden" name="action" value="transfer">
  914. <div class="field">
  915. <label>
  916. {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
  917. <span class="text red">{{.Repository.Name}}</span>
  918. </label>
  919. </div>
  920. <div class="required field">
  921. <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
  922. <input id="repo_name" name="repo_name" required>
  923. </div>
  924. <div class="required field">
  925. <label for="new_owner_name">{{ctx.Locale.Tr "repo.settings.transfer_owner"}}</label>
  926. <input id="new_owner_name" name="new_owner_name" required>
  927. </div>
  928. <div class="text right actions">
  929. <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
  930. <button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_perform"}}</button>
  931. </div>
  932. </form>
  933. </div>
  934. </div>
  935. <div class="ui small modal" id="delete-repo-modal">
  936. <div class="header">
  937. {{ctx.Locale.Tr "repo.settings.delete"}}
  938. </div>
  939. <div class="content">
  940. <div class="ui warning message">
  941. {{ctx.Locale.Tr "repo.settings.delete_notices_1"}}<br>
  942. {{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName}}
  943. {{if .Repository.NumForks}}<br>
  944. {{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
  945. {{end}}
  946. </div>
  947. <form class="ui form" action="{{.Link}}" method="post">
  948. {{.CsrfTokenHtml}}
  949. <input type="hidden" name="action" value="delete">
  950. <div class="field">
  951. <label>
  952. {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
  953. <span class="text red">{{.Repository.Name}}</span>
  954. </label>
  955. </div>
  956. <div class="required field">
  957. <label for="repo_name_to_delete">{{ctx.Locale.Tr "repo.repo_name"}}</label>
  958. <input id="repo_name_to_delete" name="repo_name" required>
  959. </div>
  960. <div class="text right actions">
  961. <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
  962. <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button>
  963. </div>
  964. </form>
  965. </div>
  966. </div>
  967. {{if .Repository.UnitEnabled $.Context $.UnitTypeWiki}}
  968. <div class="ui small modal" id="delete-wiki-modal">
  969. <div class="header">
  970. {{ctx.Locale.Tr "repo.settings.wiki_delete"}}
  971. </div>
  972. <div class="content">
  973. <div class="ui warning message">
  974. {{ctx.Locale.Tr "repo.settings.delete_notices_1"}}<br>
  975. {{ctx.Locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name}}
  976. </div>
  977. <form class="ui form" action="{{.Link}}" method="post">
  978. {{.CsrfTokenHtml}}
  979. <input type="hidden" name="action" value="delete-wiki">
  980. <div class="field">
  981. <label>
  982. {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
  983. <span class="text red">{{.Repository.Name}}</span>
  984. </label>
  985. </div>
  986. <div class="required field">
  987. <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
  988. <input id="repo_name" name="repo_name" required>
  989. </div>
  990. <div class="text right actions">
  991. <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
  992. <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_wiki_delete"}}</button>
  993. </div>
  994. </form>
  995. </div>
  996. </div>
  997. {{end}}
  998. {{if not .Repository.IsMirror}}
  999. <div class="ui g-modal-confirm modal" id="archive-repo-modal">
  1000. <div class="header">
  1001. {{if .Repository.IsArchived}}
  1002. {{ctx.Locale.Tr "repo.settings.unarchive.header"}}
  1003. {{else}}
  1004. {{ctx.Locale.Tr "repo.settings.archive.header"}}
  1005. {{end}}
  1006. </div>
  1007. <div class="content">
  1008. <p>
  1009. {{if .Repository.IsArchived}}
  1010. {{ctx.Locale.Tr "repo.settings.unarchive.text"}}
  1011. {{else}}
  1012. {{ctx.Locale.Tr "repo.settings.archive.text"}}
  1013. {{end}}
  1014. </p>
  1015. </div>
  1016. <form action="{{.Link}}" method="post">
  1017. {{.CsrfTokenHtml}}
  1018. <input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}">
  1019. <input type="hidden" name="repo_id" value="{{.Repository.ID}}">
  1020. {{template "base/modal_actions_confirm" .}}
  1021. </form>
  1022. </div>
  1023. {{end}}
  1024. {{end}}
  1025. {{template "repo/settings/push_mirror_sync_modal" .}}