options.tmpl 17 KB

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