options.tmpl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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. {{if .Repository.IsMirror}}
  53. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  54. <label>{{.i18n.Tr "repo.mirror_prune"}}</label>
  55. <div class="ui checkbox">
  56. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .MirrorEnablePrune}}checked{{end}}>
  57. <label>{{.i18n.Tr "repo.mirror_prune_desc"}}</label>
  58. </div>
  59. </div>
  60. <div class="inline field {{if .Err_Interval}}error{{end}}">
  61. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  62. <input id="interval" name="interval" type="number" value="{{.MirrorInterval}}">
  63. </div>
  64. <div class="field">
  65. <label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
  66. <input id="mirror_address" name="mirror_address" value="{{.Mirror.FullAddress}}">
  67. <p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
  68. </div>
  69. {{end}}
  70. <div class="ui divider"></div>
  71. <div class="field">
  72. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  73. </div>
  74. </form>
  75. </div>
  76. <h4 class="ui top attached header">
  77. {{.i18n.Tr "repo.settings.advanced_settings"}}
  78. </h4>
  79. <div class="ui attached segment">
  80. <form class="ui form" action="{{.Link}}" method="post">
  81. {{.CsrfTokenHtml}}
  82. <input type="hidden" name="action" value="advanced">
  83. <div class="inline field">
  84. <label>{{.i18n.Tr "repo.wiki"}}</label>
  85. <div class="ui checkbox">
  86. <input name="enable_wiki" type="checkbox" {{if .Repository.EnableWiki}}checked{{end}}>
  87. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  88. </div>
  89. </div>
  90. <div class="inline field">
  91. <div class="ui checkbox">
  92. <input name="enable_external_wiki" type="checkbox" {{if .Repository.EnableExternalWiki}}checked{{end}}>
  93. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  94. </div>
  95. </div>
  96. <div class="field">
  97. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  98. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{.Repository.ExternalWikiURL}}">
  99. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  100. </div>
  101. <div class="ui divider"></div>
  102. <div class="inline field">
  103. <label>{{.i18n.Tr "repo.issues"}}</label>
  104. <div class="ui checkbox">
  105. <input name="enable_issues" type="checkbox" {{if .Repository.EnableIssues}}checked{{end}}>
  106. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  107. </div>
  108. </div>
  109. <div class="inline field">
  110. <div class="ui checkbox">
  111. <input name="enable_external_tracker" type="checkbox" {{if .Repository.EnableExternalTracker}}checked{{end}}>
  112. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  113. </div>
  114. </div>
  115. <div class="field">
  116. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  117. <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
  118. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  119. </div>
  120. <div class="inline fields">
  121. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  122. <div class="field">
  123. <div class="ui radio checkbox">
  124. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if eq .Repository.ExternalTrackerStyle "numeric"}}checked=""{{end}}/>
  125. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  126. </div>
  127. </div>
  128. <div class="field">
  129. <div class="ui radio checkbox">
  130. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq .Repository.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}/>
  131. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  132. </div>
  133. </div>
  134. </div>
  135. {{if .Repository.CanEnablePulls}}
  136. <div class="ui divider"></div>
  137. <div class="inline field">
  138. <label>{{.i18n.Tr "repo.pulls"}}</label>
  139. <div class="ui checkbox">
  140. <input name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}>
  141. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  142. </div>
  143. </div>
  144. {{end}}
  145. <div class="ui divider"></div>
  146. <div class="field">
  147. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  148. </div>
  149. </form>
  150. </div>
  151. {{if .IsRepositoryOwner}}
  152. <h4 class="ui top attached warning header">
  153. {{.i18n.Tr "repo.settings.danger_zone"}}
  154. </h4>
  155. <div class="ui attached warning table danger segment">
  156. {{if .Repository.IsMirror}}
  157. <div class="item">
  158. <div class="ui right">
  159. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  160. </div>
  161. <div>
  162. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  163. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  164. </div>
  165. </div>
  166. <div class="ui divider"></div>
  167. {{end}}
  168. <div class="item">
  169. <div class="ui right">
  170. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  171. </div>
  172. <div>
  173. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  174. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  175. </div>
  176. </div>
  177. {{if .Repository.EnableWiki}}
  178. <div class="ui divider"></div>
  179. <div class="item">
  180. <div class="ui right">
  181. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  182. </div>
  183. <div>
  184. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  185. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  186. </div>
  187. </div>
  188. {{end}}
  189. <div class="ui divider"></div>
  190. <div class="item">
  191. <div class="ui right">
  192. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  193. </div>
  194. <div>
  195. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  196. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  197. </div>
  198. </div>
  199. </div>
  200. {{end}}
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. {{if .IsRepositoryOwner}}
  206. {{if .Repository.IsMirror}}
  207. <div class="ui small modal" id="convert-repo-modal">
  208. <div class="header">
  209. {{.i18n.Tr "repo.settings.convert"}}
  210. </div>
  211. <div class="content">
  212. <div class="ui warning message text left">
  213. {{.i18n.Tr "repo.settings.convert_notices_1" | Safe}}
  214. </div>
  215. <form class="ui form" action="{{.Link}}" method="post">
  216. {{.CsrfTokenHtml}}
  217. <input type="hidden" name="action" value="convert">
  218. <div class="field">
  219. <label>
  220. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  221. <span class="text red">{{.Repository.Name}}</span>
  222. </label>
  223. </div>
  224. <div class="required field">
  225. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  226. <input id="repo_name" name="repo_name" required>
  227. </div>
  228. <div class="text right actions">
  229. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  230. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  231. </div>
  232. </form>
  233. </div>
  234. </div>
  235. {{end}}
  236. <div class="ui small modal" id="transfer-repo-modal">
  237. <div class="header">
  238. {{.i18n.Tr "repo.settings.transfer"}}
  239. </div>
  240. <div class="content">
  241. <div class="ui warning message text left">
  242. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  243. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  244. </div>
  245. <form class="ui form" action="{{.Link}}" method="post">
  246. {{.CsrfTokenHtml}}
  247. <input type="hidden" name="action" value="transfer">
  248. <div class="field">
  249. <label>
  250. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  251. <span class="text red">{{.Repository.Name}}</span>
  252. </label>
  253. </div>
  254. <div class="required field">
  255. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  256. <input id="repo_name" name="repo_name" required>
  257. </div>
  258. <div class="required field">
  259. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  260. <input id="new_owner_name" name="new_owner_name" required>
  261. </div>
  262. <div class="text right actions">
  263. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  264. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  265. </div>
  266. </form>
  267. </div>
  268. </div>
  269. <div class="ui small modal" id="delete-repo-modal">
  270. <div class="header">
  271. {{.i18n.Tr "repo.settings.delete"}}
  272. </div>
  273. <div class="content">
  274. <div class="ui warning message text left">
  275. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  276. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  277. {{if .Repository.NumForks}}<br>
  278. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}}
  279. {{end}}
  280. </div>
  281. <form class="ui form" action="{{.Link}}" method="post">
  282. {{.CsrfTokenHtml}}
  283. <input type="hidden" name="action" value="delete">
  284. <div class="field">
  285. <label>
  286. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  287. <span class="text red">{{.Repository.Name}}</span>
  288. </label>
  289. </div>
  290. <div class="required field">
  291. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  292. <input id="repo_name" name="repo_name" required>
  293. </div>
  294. <div class="text right actions">
  295. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  296. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  297. </div>
  298. </form>
  299. </div>
  300. </div>
  301. {{if .Repository.EnableWiki}}
  302. <div class="ui small modal" id="delete-wiki-modal">
  303. <div class="header">
  304. {{.i18n.Tr "repo.settings.wiki-delete"}}
  305. </div>
  306. <div class="content">
  307. <div class="ui warning message text left">
  308. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  309. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  310. </div>
  311. <form class="ui form" action="{{.Link}}" method="post">
  312. {{.CsrfTokenHtml}}
  313. <input type="hidden" name="action" value="delete-wiki">
  314. <div class="field">
  315. <label>
  316. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  317. <span class="text red">{{.Repository.Name}}</span>
  318. </label>
  319. </div>
  320. <div class="required field">
  321. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  322. <input id="repo_name" name="repo_name" required>
  323. </div>
  324. <div class="text right actions">
  325. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  326. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  327. </div>
  328. </form>
  329. </div>
  330. </div>
  331. {{end}}
  332. {{end}}
  333. {{template "base/footer" .}}