options.tmpl 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. <div class="ui divider"></div>
  114. <div class="inline field">
  115. <label>{{.i18n.Tr "repo.pulls"}}</label>
  116. <div class="ui checkbox">
  117. <input name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}>
  118. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  119. </div>
  120. </div>
  121. <div class="ui divider"></div>
  122. <div class="field">
  123. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  124. </div>
  125. </form>
  126. </div>
  127. <h4 class="ui top attached warning header">
  128. {{.i18n.Tr "repo.settings.danger_zone"}}
  129. </h4>
  130. <div class="ui attached warning table danger segment">
  131. <div class="item">
  132. <div class="ui right">
  133. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  134. </div>
  135. <div>
  136. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  137. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  138. </div>
  139. </div>
  140. <div class="ui divider"></div>
  141. <div class="item">
  142. <div class="ui right">
  143. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  144. </div>
  145. <div>
  146. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  147. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="ui small modal" id="transfer-repo-modal">
  156. <div class="header">
  157. {{.i18n.Tr "repo.settings.transfer"}}
  158. </div>
  159. <div class="content">
  160. <div class="ui warning message text left">
  161. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  162. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  163. </div>
  164. <form class="ui form" action="{{.Link}}" method="post">
  165. {{.CsrfTokenHtml}}
  166. <input type="hidden" name="action" value="transfer">
  167. <div class="field">
  168. <label>
  169. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  170. <span class="text red">{{.Repository.Name}}</span>
  171. </label>
  172. </div>
  173. <div class="required field">
  174. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  175. <input id="repo_name" name="repo_name" required>
  176. </div>
  177. <div class="required field">
  178. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  179. <input id="new_owner_name" name="new_owner_name" required>
  180. </div>
  181. <div class="text right actions">
  182. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  183. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  184. </div>
  185. </form>
  186. </div>
  187. </div>
  188. <div class="ui small modal" id="delete-repo-modal">
  189. <div class="header">
  190. {{.i18n.Tr "repo.settings.delete"}}
  191. </div>
  192. <div class="content">
  193. <div class="ui warning message text left">
  194. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}} <br>
  195. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  196. {{if .Repository.NumForks}}<br>
  197. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}} <br>
  198. {{.i18n.Tr "repo.settings.delete_notices_fork_2" | Safe}} <br>
  199. {{.i18n.Tr "repo.settings.delete_notices_fork_3" | Safe}}
  200. {{end}}
  201. </div>
  202. <form class="ui form" action="{{.Link}}" method="post">
  203. {{.CsrfTokenHtml}}
  204. <input type="hidden" name="action" value="delete">
  205. <div class="field">
  206. <label>
  207. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  208. <span class="text red">{{.Repository.Name}}</span>
  209. </label>
  210. </div>
  211. <div class="required field">
  212. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  213. <input id="repo_name" name="repo_name" required>
  214. </div>
  215. <div class="text right actions">
  216. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  217. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  218. </div>
  219. </form>
  220. </div>
  221. </div>
  222. {{template "base/footer" .}}