options.tmpl 15 KB

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