options.tmpl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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.Updated}}</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 name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}>
  185. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  186. </div>
  187. </div>
  188. {{end}}
  189. <div class="field">
  190. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  191. </div>
  192. </form>
  193. </div>
  194. {{if .IsRepositoryOwner}}
  195. <div class="ui top attached warning header">
  196. {{.i18n.Tr "repo.settings.danger_zone"}}
  197. </div>
  198. <div class="ui attached warning table danger segment">
  199. {{if .Repository.IsMirror}}
  200. <div class="item">
  201. <div class="ui right">
  202. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  203. </div>
  204. <div>
  205. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  206. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  207. </div>
  208. </div>
  209. <div class="ui divider"></div>
  210. {{end}}
  211. <div class="item">
  212. <div class="ui right">
  213. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  214. </div>
  215. <div>
  216. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  217. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  218. </div>
  219. </div>
  220. {{if .Repository.EnableWiki}}
  221. <div class="ui divider"></div>
  222. <div class="item">
  223. <div class="ui right">
  224. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  225. </div>
  226. <div>
  227. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  228. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  229. </div>
  230. </div>
  231. {{end}}
  232. <div class="ui divider"></div>
  233. <div class="item">
  234. <div class="ui right">
  235. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  236. </div>
  237. <div>
  238. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  239. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  240. </div>
  241. </div>
  242. </div>
  243. {{end}}
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. {{if .IsRepositoryOwner}}
  249. {{if .Repository.IsMirror}}
  250. <div class="ui small modal" id="convert-repo-modal">
  251. <div class="header">
  252. {{.i18n.Tr "repo.settings.convert"}}
  253. </div>
  254. <div class="content">
  255. <div class="ui warning message text left">
  256. {{.i18n.Tr "repo.settings.convert_notices_1" | Safe}}
  257. </div>
  258. <form class="ui form" action="{{.Link}}" method="POST">
  259. {{.CSRFTokenHTML}}
  260. <input type="hidden" name="action" value="convert">
  261. <div class="field">
  262. <label>
  263. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  264. <span class="text red">{{.Repository.Name}}</span>
  265. </label>
  266. </div>
  267. <div class="required field">
  268. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  269. <input id="repo_name" name="repo_name" required>
  270. </div>
  271. <div class="text right actions">
  272. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  273. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  274. </div>
  275. </form>
  276. </div>
  277. </div>
  278. {{end}}
  279. <div class="ui small modal" id="transfer-repo-modal">
  280. <div class="header">
  281. {{.i18n.Tr "repo.settings.transfer"}}
  282. </div>
  283. <div class="content">
  284. <div class="ui warning message text left">
  285. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  286. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  287. </div>
  288. <form class="ui form" action="{{.Link}}" method="POST">
  289. {{.CSRFTokenHTML}}
  290. <input type="hidden" name="action" value="transfer">
  291. <div class="field">
  292. <label>
  293. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  294. <span class="text red">{{.Repository.Name}}</span>
  295. </label>
  296. </div>
  297. <div class="required field">
  298. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  299. <input id="repo_name" name="repo_name" autocomplete="off" required>
  300. </div>
  301. <div class="required field">
  302. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  303. <input id="new_owner_name" name="new_owner_name" autocomplete="off" required>
  304. </div>
  305. <div class="text right actions">
  306. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  307. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  308. </div>
  309. </form>
  310. </div>
  311. </div>
  312. <div class="ui small modal" id="delete-repo-modal">
  313. <div class="header">
  314. {{.i18n.Tr "repo.settings.delete"}}
  315. </div>
  316. <div class="content">
  317. <div class="ui warning message text left">
  318. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  319. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  320. {{if .Repository.NumForks}}<br>
  321. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}}
  322. {{end}}
  323. </div>
  324. <form class="ui form" action="{{.Link}}" method="POST">
  325. {{.CSRFTokenHTML}}
  326. <input type="hidden" name="action" value="delete">
  327. <div class="field">
  328. <label>
  329. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  330. <span class="text red">{{.Repository.Name}}</span>
  331. </label>
  332. </div>
  333. <div class="required field">
  334. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  335. <input id="repo_name" name="repo_name" autocomplete="off" required>
  336. </div>
  337. <div class="text right actions">
  338. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  339. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  340. </div>
  341. </form>
  342. </div>
  343. </div>
  344. {{if .Repository.EnableWiki}}
  345. <div class="ui small modal" id="delete-wiki-modal">
  346. <div class="header">
  347. {{.i18n.Tr "repo.settings.wiki-delete"}}
  348. </div>
  349. <div class="content">
  350. <div class="ui warning message text left">
  351. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  352. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  353. </div>
  354. <form class="ui form" action="{{.Link}}" method="POST">
  355. {{.CSRFTokenHTML}}
  356. <input type="hidden" name="action" value="delete-wiki">
  357. <div class="field">
  358. <label>
  359. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  360. <span class="text red">{{.Repository.Name}}</span>
  361. </label>
  362. </div>
  363. <div class="required field">
  364. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  365. <input id="repo_name" name="repo_name" autocomplete="off" required>
  366. </div>
  367. <div class="text right actions">
  368. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  369. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  370. </div>
  371. </form>
  372. </div>
  373. </div>
  374. {{end}}
  375. {{end}}
  376. {{template "base/footer" .}}