options.tmpl 18 KB

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