Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

options.tmpl 16KB

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