You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

407 lines
16 KiB

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