options.tmpl 19 KB

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