options.tmpl 12 KB

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