options.tmpl 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. {{template "base/head" .}}
  2. <div class="repository settings options">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="ui grid">
  6. {{template "repo/settings/navbar" .}}
  7. <div class="twelve wide column content">
  8. {{template "base/alert" .}}
  9. <div class="ui top attached header">
  10. {{.i18n.Tr "repo.settings.basic_settings"}}
  11. </div>
  12. <div class="ui attached segment">
  13. <form class="ui form" action="{{.Link}}" method="POST">
  14. {{.CSRFTokenHTML}}
  15. <input type="hidden" name="action" value="update">
  16. <div class="required field {{if .Err_RepoName}}error{{end}}">
  17. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}<span class="text red hide" id="repo-name-change-prompt"> {{.i18n.Tr "repo.settings.change_reponame_prompt"}}</span></label>
  18. <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" required>
  19. </div>
  20. <div class="field {{if .Err_Description}}error{{end}}">
  21. <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label>
  22. <textarea id="description" name="description" rows="2">{{.Repository.Description}}</textarea>
  23. </div>
  24. <div class="field {{if .Err_Website}}error{{end}}">
  25. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  26. <input id="website" name="website" type="url" value="{{.Repository.Website}}">
  27. </div>
  28. {{if not .Repository.IsFork}}
  29. <div class="inline field">
  30. <label>{{.i18n.Tr "repo.visibility"}}</label>
  31. <div class="ui checkbox">
  32. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  33. <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label>
  34. </div>
  35. </div>
  36. {{end}}
  37. <div class="field">
  38. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  39. </div>
  40. </form>
  41. </div>
  42. {{if .Repository.IsMirror}}
  43. <div class="ui top attached header">
  44. {{.i18n.Tr "repo.settings.mirror_settings"}}
  45. </div>
  46. <div class="ui attached segment">
  47. <form class="ui form" method="POST">
  48. {{.CSRFTokenHTML}}
  49. <input type="hidden" name="action" value="mirror">
  50. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  51. <label>{{.i18n.Tr "repo.mirror_prune"}}</label>
  52. <div class="ui checkbox">
  53. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .MirrorEnablePrune}}checked{{end}}>
  54. <label>{{.i18n.Tr "repo.mirror_prune_desc"}}</label>
  55. </div>
  56. </div>
  57. <div class="inline field {{if .Err_Interval}}error{{end}}">
  58. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  59. <input id="interval" name="interval" type="number" value="{{.MirrorInterval}}">
  60. </div>
  61. <div class="field">
  62. <label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
  63. <input id="mirror_address" name="mirror_address" value="{{.Mirror.FullAddress}}" required>
  64. <p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
  65. </div>
  66. <div class="field">
  67. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  68. </div>
  69. </form>
  70. <div class="ui divider"></div>
  71. <form class="ui form" method="POST">
  72. {{.CSRFTokenHTML}}
  73. <input type="hidden" name="action" value="mirror-sync">
  74. <div class="inline field">
  75. <label>{{.i18n.Tr "repo.mirror_last_synced"}}</label>
  76. <span>{{.Mirror.LastSync}}</span>
  77. </div>
  78. <div class="field">
  79. <button class="ui blue button">{{$.i18n.Tr "repo.settings.sync_mirror"}}</button>
  80. </div>
  81. </form>
  82. </div>
  83. {{end}}
  84. <div class="ui top attached header">
  85. {{.i18n.Tr "repo.settings.advanced_settings"}}
  86. </div>
  87. <div class="ui attached segment">
  88. <form class="ui form" method="POST">
  89. {{.CSRFTokenHTML}}
  90. <input type="hidden" name="action" value="advanced">
  91. <!-- Wiki -->
  92. <div class="inline field">
  93. <label>{{.i18n.Tr "repo.wiki"}}</label>
  94. <div class="ui checkbox">
  95. <input class="enable-system" type="checkbox" name="enable_wiki" data-target="#wiki_box" {{if .Repository.EnableWiki}}checked{{end}}>
  96. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  97. </div>
  98. </div>
  99. <div class="ui segment field {{if not .Repository.EnableWiki}}disabled{{end}}" id="wiki_box">
  100. <div class="field">
  101. <div class="ui radio checkbox">
  102. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-enable="#internal_wiki_box" data-disable="#external_wiki_box" {{if not .Repository.EnableExternalWiki}}checked{{end}}/>
  103. <label>{{.i18n.Tr "repo.settings.use_internal_wiki"}}</label>
  104. </div>
  105. </div>
  106. <div class="box field {{if .Repository.EnableExternalWiki}}disabled{{end}}" id="internal_wiki_box">
  107. <div class="ui checkbox">
  108. <input name="allow_public_wiki" type="checkbox" {{if .Repository.AllowPublicWiki}}checked{{end}}>
  109. <label>{{.i18n.Tr "repo.settings.allow_public_wiki_desc"}}</label>
  110. </div>
  111. </div>
  112. <div class="field">
  113. <div class="ui radio checkbox">
  114. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-enable="#external_wiki_box" data-disable="#internal_wiki_box" {{if .Repository.EnableExternalWiki}}checked{{end}}/>
  115. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  116. </div>
  117. </div>
  118. <div class="box field {{if not .Repository.EnableExternalWiki}}disabled{{end}}" id="external_wiki_box">
  119. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  120. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{.Repository.ExternalWikiURL}}">
  121. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  122. </div>
  123. </div>
  124. <!-- Issues -->
  125. <div class="inline field">
  126. <label>{{.i18n.Tr "repo.issues"}}</label>
  127. <div class="ui checkbox">
  128. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if .Repository.EnableIssues}}checked{{end}}>
  129. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  130. </div>
  131. </div>
  132. <div class="ui segment field {{if not .Repository.EnableIssues}}disabled{{end}}" id="issue_box">
  133. <div class="field">
  134. <div class="ui radio checkbox">
  135. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-enable="#internal_issue_box" data-disable="#external_issue_box" {{if not .Repository.EnableExternalTracker}}checked{{end}}/>
  136. <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  137. </div>
  138. </div>
  139. <div class="box field {{if .Repository.EnableExternalTracker}}disabled{{end}}" id="internal_issue_box">
  140. <div class="ui checkbox">
  141. <input name="allow_public_issues" type="checkbox" {{if .Repository.AllowPublicIssues}}checked{{end}}>
  142. <label>{{.i18n.Tr "repo.settings.allow_public_issues_desc"}}</label>
  143. </div>
  144. </div>
  145. <div class="field">
  146. <div class="ui radio checkbox">
  147. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-enable="#external_issue_box" data-disable="#internal_issue_box" {{if .Repository.EnableExternalTracker}}checked{{end}}/>
  148. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  149. </div>
  150. </div>
  151. <div class="box field {{if not .Repository.EnableExternalTracker}}disabled{{end}}" id="external_issue_box">
  152. <div class="field">
  153. <label for="external_tracker_url">{{.i18n.Tr "repo.settings.external_tracker_url"}}</label>
  154. <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{.Repository.ExternalTrackerURL}}">
  155. <p class="help">{{.i18n.Tr "repo.settings.external_tracker_url_desc"}}</p>
  156. </div>
  157. <div class="field">
  158. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  159. <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
  160. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  161. </div>
  162. <div class="inline fields">
  163. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  164. <div class="field">
  165. <div class="ui radio checkbox">
  166. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if eq .Repository.ExternalTrackerStyle "numeric"}}checked=""{{end}}/>
  167. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  168. </div>
  169. </div>
  170. <div class="field">
  171. <div class="ui radio checkbox">
  172. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq .Repository.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}/>
  173. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- Pull Requests -->
  180. {{if .Repository.CanEnablePulls}}
  181. <div class="inline field">
  182. <label>{{.i18n.Tr "repo.pulls"}}</label>
  183. <div class="ui checkbox">
  184. <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if .Repository.EnablePulls}}checked{{end}}>
  185. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  186. </div>
  187. </div>
  188. <div class="ui segment {{if not .Repository.EnablePulls}}disabled{{end}}" id="pull_box">
  189. <div class="field">
  190. <div class="ui checkbox">
  191. <input name="pulls_ignore_whitespace" type="checkbox" {{if .Repository.PullsIgnoreWhitespace}}checked{{end}}>
  192. <label>{{.i18n.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
  193. </div>
  194. </div>
  195. <div class="field">
  196. <div class="ui checkbox">
  197. <input name="pulls_allow_rebase" type="checkbox" {{if .Repository.PullsAllowRebase}}checked{{end}}>
  198. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge"}}</label>
  199. </div>
  200. </div>
  201. </div>
  202. {{end}}
  203. <div class="field">
  204. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  205. </div>
  206. </form>
  207. </div>
  208. {{if .IsRepositoryOwner}}
  209. <div class="ui top attached warning header">
  210. {{.i18n.Tr "repo.settings.danger_zone"}}
  211. </div>
  212. <div class="ui attached warning table danger segment">
  213. {{if .Repository.IsMirror}}
  214. <div class="item">
  215. <div class="ui right">
  216. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  217. </div>
  218. <div>
  219. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  220. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  221. </div>
  222. </div>
  223. <div class="ui divider"></div>
  224. {{end}}
  225. <div class="item">
  226. <div class="ui right">
  227. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  228. </div>
  229. <div>
  230. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  231. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  232. </div>
  233. </div>
  234. {{if .Repository.EnableWiki}}
  235. <div class="ui divider"></div>
  236. <div class="item">
  237. <div class="ui right">
  238. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  239. </div>
  240. <div>
  241. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  242. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  243. </div>
  244. </div>
  245. {{end}}
  246. <div class="ui divider"></div>
  247. <div class="item">
  248. <div class="ui right">
  249. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  250. </div>
  251. <div>
  252. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  253. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  254. </div>
  255. </div>
  256. </div>
  257. {{end}}
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. {{if .IsRepositoryOwner}}
  263. {{if .Repository.IsMirror}}
  264. <div class="ui small modal" id="convert-repo-modal">
  265. <div class="header">
  266. {{.i18n.Tr "repo.settings.convert"}}
  267. </div>
  268. <div class="content">
  269. <div class="ui warning message text left">
  270. {{.i18n.Tr "repo.settings.convert_notices_1" | Safe}}
  271. </div>
  272. <form class="ui form" action="{{.Link}}" method="POST">
  273. {{.CSRFTokenHTML}}
  274. <input type="hidden" name="action" value="convert">
  275. <div class="field">
  276. <label>
  277. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  278. <span class="text red">{{.Repository.Name}}</span>
  279. </label>
  280. </div>
  281. <div class="required field">
  282. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  283. <input id="repo_name" name="repo_name" required>
  284. </div>
  285. <div class="text right actions">
  286. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  287. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  288. </div>
  289. </form>
  290. </div>
  291. </div>
  292. {{end}}
  293. <div class="ui small modal" id="transfer-repo-modal">
  294. <div class="header">
  295. {{.i18n.Tr "repo.settings.transfer"}}
  296. </div>
  297. <div class="content">
  298. <div class="ui warning message text left">
  299. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  300. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  301. </div>
  302. <form class="ui form" action="{{.Link}}" method="POST">
  303. {{.CSRFTokenHTML}}
  304. <input type="hidden" name="action" value="transfer">
  305. <div class="field">
  306. <label>
  307. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  308. <span class="text red">{{.Repository.Name}}</span>
  309. </label>
  310. </div>
  311. <div class="required field">
  312. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  313. <input id="repo_name" name="repo_name" autocomplete="off" required>
  314. </div>
  315. <div class="required field">
  316. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  317. <input id="new_owner_name" name="new_owner_name" autocomplete="off" required>
  318. </div>
  319. <div class="text right actions">
  320. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  321. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  322. </div>
  323. </form>
  324. </div>
  325. </div>
  326. <div class="ui small modal" id="delete-repo-modal">
  327. <div class="header">
  328. {{.i18n.Tr "repo.settings.delete"}}
  329. </div>
  330. <div class="content">
  331. <div class="ui warning message text left">
  332. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  333. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  334. {{if .Repository.NumForks}}<br>
  335. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}}
  336. {{end}}
  337. </div>
  338. <form class="ui form" action="{{.Link}}" method="POST">
  339. {{.CSRFTokenHTML}}
  340. <input type="hidden" name="action" value="delete">
  341. <div class="field">
  342. <label>
  343. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  344. <span class="text red">{{.Repository.Name}}</span>
  345. </label>
  346. </div>
  347. <div class="required field">
  348. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  349. <input id="repo_name" name="repo_name" autocomplete="off" required>
  350. </div>
  351. <div class="text right actions">
  352. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  353. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  354. </div>
  355. </form>
  356. </div>
  357. </div>
  358. {{if .Repository.EnableWiki}}
  359. <div class="ui small modal" id="delete-wiki-modal">
  360. <div class="header">
  361. {{.i18n.Tr "repo.settings.wiki-delete"}}
  362. </div>
  363. <div class="content">
  364. <div class="ui warning message text left">
  365. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  366. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  367. </div>
  368. <form class="ui form" action="{{.Link}}" method="POST">
  369. {{.CSRFTokenHTML}}
  370. <input type="hidden" name="action" value="delete-wiki">
  371. <div class="field">
  372. <label>
  373. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  374. <span class="text red">{{.Repository.Name}}</span>
  375. </label>
  376. </div>
  377. <div class="required field">
  378. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  379. <input id="repo_name" name="repo_name" autocomplete="off" required>
  380. </div>
  381. <div class="text right actions">
  382. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  383. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  384. </div>
  385. </form>
  386. </div>
  387. </div>
  388. {{end}}
  389. {{end}}
  390. {{template "base/footer" .}}