options.tmpl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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. <h4 class="ui top attached header">
  10. {{.i18n.Tr "repo.settings.basic_settings"}}
  11. </h4>
  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}}" autofocus 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. <h4 class="ui top attached header">
  44. {{.i18n.Tr "repo.settings.mirror_settings"}}
  45. </h4>
  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. <h4 class="ui top attached header">
  85. {{.i18n.Tr "repo.settings.advanced_settings"}}
  86. </h4>
  87. <div class="ui attached segment">
  88. <form class="ui form" method="post">
  89. {{.CsrfTokenHtml}}
  90. <input type="hidden" name="action" value="advanced">
  91. <div class="inline field">
  92. <label>{{.i18n.Tr "repo.wiki"}}</label>
  93. <div class="ui checkbox">
  94. <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if .Repository.EnableWiki}}checked{{end}}>
  95. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  96. </div>
  97. </div>
  98. <div class="field {{if not .Repository.EnableWiki}}disabled{{end}}" id="wiki_box">
  99. <div class="field">
  100. <div class="ui radio checkbox">
  101. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not .Repository.EnableExternalWiki}}checked{{end}}/>
  102. <label>{{.i18n.Tr "repo.settings.use_internal_wiki"}}</label>
  103. </div>
  104. </div>
  105. <div class="field">
  106. <div class="ui radio checkbox">
  107. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.EnableExternalWiki}}checked{{end}}/>
  108. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  109. </div>
  110. </div>
  111. <div class="field {{if not .Repository.EnableExternalWiki}}disabled{{end}}" id="external_wiki_box">
  112. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  113. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{.Repository.ExternalWikiURL}}">
  114. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  115. </div>
  116. </div>
  117. <div class="ui divider"></div>
  118. <div class="inline field">
  119. <label>{{.i18n.Tr "repo.issues"}}</label>
  120. <div class="ui checkbox">
  121. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if .Repository.EnableIssues}}checked{{end}}>
  122. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  123. </div>
  124. </div>
  125. <div class="field {{if not .Repository.EnableIssues}}disabled{{end}}" id="issue_box">
  126. <div class="field">
  127. <div class="ui radio checkbox">
  128. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-target="#external_issue_box" {{if not .Repository.EnableExternalTracker}}checked{{end}}/>
  129. <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  130. </div>
  131. </div>
  132. <div class="field">
  133. <div class="ui radio checkbox">
  134. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-target="#external_issue_box" {{if .Repository.EnableExternalTracker}}checked{{end}}/>
  135. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  136. </div>
  137. </div>
  138. <div class="field {{if not .Repository.EnableExternalTracker}}disabled{{end}}" id="external_issue_box">
  139. <div class="field">
  140. <label for="external_tracker_url">{{.i18n.Tr "repo.settings.external_tracker_url"}}</label>
  141. <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{.Repository.ExternalTrackerURL}}">
  142. <p class="help">{{.i18n.Tr "repo.settings.external_tracker_url_desc"}}</p>
  143. </div>
  144. <div class="field">
  145. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  146. <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
  147. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  148. </div>
  149. <div class="inline fields">
  150. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  151. <div class="field">
  152. <div class="ui radio checkbox">
  153. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if eq .Repository.ExternalTrackerStyle "numeric"}}checked=""{{end}}/>
  154. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  155. </div>
  156. </div>
  157. <div class="field">
  158. <div class="ui radio checkbox">
  159. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq .Repository.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}/>
  160. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. {{if .Repository.CanEnablePulls}}
  167. <div class="ui divider"></div>
  168. <div class="inline field">
  169. <label>{{.i18n.Tr "repo.pulls"}}</label>
  170. <div class="ui checkbox">
  171. <input name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}>
  172. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  173. </div>
  174. </div>
  175. {{end}}
  176. <div class="ui divider"></div>
  177. <div class="field">
  178. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  179. </div>
  180. </form>
  181. </div>
  182. {{if .IsRepositoryOwner}}
  183. <h4 class="ui top attached warning header">
  184. {{.i18n.Tr "repo.settings.danger_zone"}}
  185. </h4>
  186. <div class="ui attached warning table danger segment">
  187. {{if .Repository.IsMirror}}
  188. <div class="item">
  189. <div class="ui right">
  190. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  191. </div>
  192. <div>
  193. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  194. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  195. </div>
  196. </div>
  197. <div class="ui divider"></div>
  198. {{end}}
  199. <div class="item">
  200. <div class="ui right">
  201. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  202. </div>
  203. <div>
  204. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  205. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  206. </div>
  207. </div>
  208. {{if .Repository.EnableWiki}}
  209. <div class="ui divider"></div>
  210. <div class="item">
  211. <div class="ui right">
  212. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  213. </div>
  214. <div>
  215. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  216. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  217. </div>
  218. </div>
  219. {{end}}
  220. <div class="ui divider"></div>
  221. <div class="item">
  222. <div class="ui right">
  223. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  224. </div>
  225. <div>
  226. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  227. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  228. </div>
  229. </div>
  230. </div>
  231. {{end}}
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. {{if .IsRepositoryOwner}}
  237. {{if .Repository.IsMirror}}
  238. <div class="ui small modal" id="convert-repo-modal">
  239. <div class="header">
  240. {{.i18n.Tr "repo.settings.convert"}}
  241. </div>
  242. <div class="content">
  243. <div class="ui warning message text left">
  244. {{.i18n.Tr "repo.settings.convert_notices_1" | Safe}}
  245. </div>
  246. <form class="ui form" action="{{.Link}}" method="post">
  247. {{.CsrfTokenHtml}}
  248. <input type="hidden" name="action" value="convert">
  249. <div class="field">
  250. <label>
  251. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  252. <span class="text red">{{.Repository.Name}}</span>
  253. </label>
  254. </div>
  255. <div class="required field">
  256. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  257. <input id="repo_name" name="repo_name" required>
  258. </div>
  259. <div class="text right actions">
  260. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  261. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  262. </div>
  263. </form>
  264. </div>
  265. </div>
  266. {{end}}
  267. <div class="ui small modal" id="transfer-repo-modal">
  268. <div class="header">
  269. {{.i18n.Tr "repo.settings.transfer"}}
  270. </div>
  271. <div class="content">
  272. <div class="ui warning message text left">
  273. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  274. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  275. </div>
  276. <form class="ui form" action="{{.Link}}" method="post">
  277. {{.CsrfTokenHtml}}
  278. <input type="hidden" name="action" value="transfer">
  279. <div class="field">
  280. <label>
  281. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  282. <span class="text red">{{.Repository.Name}}</span>
  283. </label>
  284. </div>
  285. <div class="required field">
  286. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  287. <input id="repo_name" name="repo_name" autocomplete="off" required>
  288. </div>
  289. <div class="required field">
  290. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  291. <input id="new_owner_name" name="new_owner_name" autocomplete="off" required>
  292. </div>
  293. <div class="text right actions">
  294. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  295. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  296. </div>
  297. </form>
  298. </div>
  299. </div>
  300. <div class="ui small modal" id="delete-repo-modal">
  301. <div class="header">
  302. {{.i18n.Tr "repo.settings.delete"}}
  303. </div>
  304. <div class="content">
  305. <div class="ui warning message text left">
  306. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  307. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  308. {{if .Repository.NumForks}}<br>
  309. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}}
  310. {{end}}
  311. </div>
  312. <form class="ui form" action="{{.Link}}" method="post">
  313. {{.CsrfTokenHtml}}
  314. <input type="hidden" name="action" value="delete">
  315. <div class="field">
  316. <label>
  317. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  318. <span class="text red">{{.Repository.Name}}</span>
  319. </label>
  320. </div>
  321. <div class="required field">
  322. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  323. <input id="repo_name" name="repo_name" autocomplete="off" required>
  324. </div>
  325. <div class="text right actions">
  326. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  327. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  328. </div>
  329. </form>
  330. </div>
  331. </div>
  332. {{if .Repository.EnableWiki}}
  333. <div class="ui small modal" id="delete-wiki-modal">
  334. <div class="header">
  335. {{.i18n.Tr "repo.settings.wiki-delete"}}
  336. </div>
  337. <div class="content">
  338. <div class="ui warning message text left">
  339. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  340. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  341. </div>
  342. <form class="ui form" action="{{.Link}}" method="post">
  343. {{.CsrfTokenHtml}}
  344. <input type="hidden" name="action" value="delete-wiki">
  345. <div class="field">
  346. <label>
  347. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  348. <span class="text red">{{.Repository.Name}}</span>
  349. </label>
  350. </div>
  351. <div class="required field">
  352. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  353. <input id="repo_name" name="repo_name" autocomplete="off" required>
  354. </div>
  355. <div class="text right actions">
  356. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  357. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  358. </div>
  359. </form>
  360. </div>
  361. </div>
  362. {{end}}
  363. {{end}}
  364. {{template "base/footer" .}}