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

options.tmpl 17KB

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