options.tmpl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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.IsBare}}
  29. <div class="required inline field">
  30. <label>{{.i18n.Tr "repo.default_branch"}}</label>
  31. <div class="ui selection dropdown">
  32. <input type="hidden" id="branch" name="branch" value="{{.Repository.DefaultBranch}}">
  33. <div class="text">{{.Repository.DefaultBranch}}</div>
  34. <i class="dropdown icon"></i>
  35. <div class="menu">
  36. {{range .Branches}}
  37. <div class="item" data-value="{{.}}">{{.}}</div>
  38. {{end}}
  39. </div>
  40. </div>
  41. </div>
  42. {{end}}
  43. {{if not .Repository.IsFork}}
  44. <div class="inline field">
  45. <label>{{.i18n.Tr "repo.visibility"}}</label>
  46. <div class="ui checkbox">
  47. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  48. <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label>
  49. </div>
  50. </div>
  51. {{end}}
  52. <div class="field">
  53. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  54. </div>
  55. </form>
  56. </div>
  57. {{if .Repository.IsMirror}}
  58. <h4 class="ui top attached header">
  59. {{.i18n.Tr "repo.settings.mirror_settings"}}
  60. </h4>
  61. <div class="ui attached segment">
  62. <form class="ui form" method="post">
  63. {{.CsrfTokenHtml}}
  64. <input type="hidden" name="action" value="mirror">
  65. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  66. <label>{{.i18n.Tr "repo.mirror_prune"}}</label>
  67. <div class="ui checkbox">
  68. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .MirrorEnablePrune}}checked{{end}}>
  69. <label>{{.i18n.Tr "repo.mirror_prune_desc"}}</label>
  70. </div>
  71. </div>
  72. <div class="inline field {{if .Err_Interval}}error{{end}}">
  73. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  74. <input id="interval" name="interval" type="number" value="{{.MirrorInterval}}">
  75. </div>
  76. <div class="field">
  77. <label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
  78. <input id="mirror_address" name="mirror_address" value="{{.Mirror.FullAddress}}" required>
  79. <p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
  80. </div>
  81. <div class="field">
  82. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  83. </div>
  84. </form>
  85. <div class="ui divider"></div>
  86. <form class="ui form" method="post">
  87. {{.CsrfTokenHtml}}
  88. <input type="hidden" name="action" value="mirror-sync">
  89. <div class="inline field">
  90. <label>{{.i18n.Tr "repo.mirror_last_synced"}}</label>
  91. <span>{{.Mirror.Updated}}</span>
  92. </div>
  93. <div class="field">
  94. <button class="ui blue button">{{$.i18n.Tr "repo.settings.sync_mirror"}}</button>
  95. </div>
  96. </form>
  97. </div>
  98. {{end}}
  99. <h4 class="ui top attached header">
  100. {{.i18n.Tr "repo.settings.advanced_settings"}}
  101. </h4>
  102. <div class="ui attached segment">
  103. <form class="ui form" method="post">
  104. {{.CsrfTokenHtml}}
  105. <input type="hidden" name="action" value="advanced">
  106. <div class="inline field">
  107. <label>{{.i18n.Tr "repo.wiki"}}</label>
  108. <div class="ui checkbox">
  109. <input class="enable-system" name="enable_wiki" type="checkbox" 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="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-target="#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="field">
  121. <div class="ui radio checkbox">
  122. <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}}/>
  123. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  124. </div>
  125. </div>
  126. <div class="field {{if not .Repository.EnableExternalWiki}}disabled{{end}}" id="external_wiki_box">
  127. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  128. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{.Repository.ExternalWikiURL}}">
  129. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  130. </div>
  131. </div>
  132. <div class="ui divider"></div>
  133. <div class="inline field">
  134. <label>{{.i18n.Tr "repo.issues"}}</label>
  135. <div class="ui checkbox">
  136. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if .Repository.EnableIssues}}checked{{end}}>
  137. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  138. </div>
  139. </div>
  140. <div class="field {{if not .Repository.EnableIssues}}disabled{{end}}" id="issue_box">
  141. <div class="field">
  142. <div class="ui radio checkbox">
  143. <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}}/>
  144. <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  145. </div>
  146. </div>
  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="true" data-target="#external_issue_box" {{if .Repository.EnableExternalTracker}}checked{{end}}/>
  150. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  151. </div>
  152. </div>
  153. <div class="field {{if not .Repository.EnableExternalTracker}}disabled{{end}}" id="external_issue_box">
  154. <div class="field">
  155. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  156. <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
  157. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  158. </div>
  159. <div class="inline fields">
  160. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  161. <div class="field">
  162. <div class="ui radio checkbox">
  163. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if eq .Repository.ExternalTrackerStyle "numeric"}}checked=""{{end}}/>
  164. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  165. </div>
  166. </div>
  167. <div class="field">
  168. <div class="ui radio checkbox">
  169. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq .Repository.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}/>
  170. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. {{if .Repository.CanEnablePulls}}
  177. <div class="ui divider"></div>
  178. <div class="inline field">
  179. <label>{{.i18n.Tr "repo.pulls"}}</label>
  180. <div class="ui checkbox">
  181. <input name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}>
  182. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  183. </div>
  184. </div>
  185. {{end}}
  186. <div class="ui divider"></div>
  187. <div class="field">
  188. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  189. </div>
  190. </form>
  191. </div>
  192. {{if .IsRepositoryOwner}}
  193. <h4 class="ui top attached warning header">
  194. {{.i18n.Tr "repo.settings.danger_zone"}}
  195. </h4>
  196. <div class="ui attached warning table danger segment">
  197. {{if .Repository.IsMirror}}
  198. <div class="item">
  199. <div class="ui right">
  200. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  201. </div>
  202. <div>
  203. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  204. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  205. </div>
  206. </div>
  207. <div class="ui divider"></div>
  208. {{end}}
  209. <div class="item">
  210. <div class="ui right">
  211. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  212. </div>
  213. <div>
  214. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  215. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  216. </div>
  217. </div>
  218. {{if .Repository.EnableWiki}}
  219. <div class="ui divider"></div>
  220. <div class="item">
  221. <div class="ui right">
  222. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  223. </div>
  224. <div>
  225. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  226. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  227. </div>
  228. </div>
  229. {{end}}
  230. <div class="ui divider"></div>
  231. <div class="item">
  232. <div class="ui right">
  233. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  234. </div>
  235. <div>
  236. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  237. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  238. </div>
  239. </div>
  240. </div>
  241. {{end}}
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. {{if .IsRepositoryOwner}}
  247. {{if .Repository.IsMirror}}
  248. <div class="ui small modal" id="convert-repo-modal">
  249. <div class="header">
  250. {{.i18n.Tr "repo.settings.convert"}}
  251. </div>
  252. <div class="content">
  253. <div class="ui warning message text left">
  254. {{.i18n.Tr "repo.settings.convert_notices_1" | Safe}}
  255. </div>
  256. <form class="ui form" action="{{.Link}}" method="post">
  257. {{.CsrfTokenHtml}}
  258. <input type="hidden" name="action" value="convert">
  259. <div class="field">
  260. <label>
  261. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  262. <span class="text red">{{.Repository.Name}}</span>
  263. </label>
  264. </div>
  265. <div class="required field">
  266. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  267. <input id="repo_name" name="repo_name" required>
  268. </div>
  269. <div class="text right actions">
  270. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  271. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  272. </div>
  273. </form>
  274. </div>
  275. </div>
  276. {{end}}
  277. <div class="ui small modal" id="transfer-repo-modal">
  278. <div class="header">
  279. {{.i18n.Tr "repo.settings.transfer"}}
  280. </div>
  281. <div class="content">
  282. <div class="ui warning message text left">
  283. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  284. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  285. </div>
  286. <form class="ui form" action="{{.Link}}" method="post">
  287. {{.CsrfTokenHtml}}
  288. <input type="hidden" name="action" value="transfer">
  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="required field">
  300. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  301. <input id="new_owner_name" name="new_owner_name" required>
  302. </div>
  303. <div class="text right actions">
  304. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  305. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  306. </div>
  307. </form>
  308. </div>
  309. </div>
  310. <div class="ui small modal" id="delete-repo-modal">
  311. <div class="header">
  312. {{.i18n.Tr "repo.settings.delete"}}
  313. </div>
  314. <div class="content">
  315. <div class="ui warning message text left">
  316. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  317. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  318. {{if .Repository.NumForks}}<br>
  319. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}}
  320. {{end}}
  321. </div>
  322. <form class="ui form" action="{{.Link}}" method="post">
  323. {{.CsrfTokenHtml}}
  324. <input type="hidden" name="action" value="delete">
  325. <div class="field">
  326. <label>
  327. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  328. <span class="text red">{{.Repository.Name}}</span>
  329. </label>
  330. </div>
  331. <div class="required field">
  332. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  333. <input id="repo_name" name="repo_name" required>
  334. </div>
  335. <div class="text right actions">
  336. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  337. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  338. </div>
  339. </form>
  340. </div>
  341. </div>
  342. {{if .Repository.EnableWiki}}
  343. <div class="ui small modal" id="delete-wiki-modal">
  344. <div class="header">
  345. {{.i18n.Tr "repo.settings.wiki-delete"}}
  346. </div>
  347. <div class="content">
  348. <div class="ui warning message text left">
  349. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  350. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  351. </div>
  352. <form class="ui form" action="{{.Link}}" method="post">
  353. {{.CsrfTokenHtml}}
  354. <input type="hidden" name="action" value="delete-wiki">
  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" 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. {{end}}
  373. {{end}}
  374. {{template "base/footer" .}}