options.tmpl 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. {{end}}
  58. <div class="ui divider"></div>
  59. <div class="field">
  60. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  61. </div>
  62. </form>
  63. </div>
  64. <h4 class="ui top attached header">
  65. {{.i18n.Tr "repo.settings.advanced_settings"}}
  66. </h4>
  67. <div class="ui attached segment">
  68. <form class="ui form" action="{{.Link}}" method="post">
  69. {{.CsrfTokenHtml}}
  70. <input type="hidden" name="action" value="advanced">
  71. <div class="inline field">
  72. <label>{{.i18n.Tr "repo.wiki"}}</label>
  73. <div class="ui checkbox">
  74. <input name="enable_wiki" type="checkbox" {{if .Repository.EnableWiki}}checked{{end}}>
  75. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  76. </div>
  77. </div>
  78. <div class="ui divider"></div>
  79. <div class="inline field">
  80. <label>{{.i18n.Tr "repo.issues"}}</label>
  81. <div class="ui checkbox">
  82. <input name="enable_issues" type="checkbox" {{if .Repository.EnableIssues}}checked{{end}}>
  83. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  84. </div>
  85. </div>
  86. <div class="inline field">
  87. <div class="ui checkbox">
  88. <input name="enable_external_tracker" type="checkbox" {{if .Repository.EnableExternalTracker}}checked{{end}}>
  89. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  90. </div>
  91. </div>
  92. <div class="field">
  93. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  94. <input id="tracker_url_format" name="tracker_url_format" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
  95. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  96. </div>
  97. <div class="ui divider"></div>
  98. <div class="inline field">
  99. <label>{{.i18n.Tr "repo.pulls"}}</label>
  100. <div class="ui checkbox">
  101. <input name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}>
  102. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  103. </div>
  104. </div>
  105. <div class="ui divider"></div>
  106. <div class="field">
  107. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  108. </div>
  109. </form>
  110. </div>
  111. <h4 class="ui top attached warning header">
  112. {{.i18n.Tr "repo.settings.danger_zone"}}
  113. </h4>
  114. <div class="ui attached warning table danger segment">
  115. <div class="item">
  116. <div class="ui right">
  117. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  118. </div>
  119. <div>
  120. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  121. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  122. </div>
  123. </div>
  124. <div class="ui divider"></div>
  125. <div class="item">
  126. <div class="ui right">
  127. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  128. </div>
  129. <div>
  130. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  131. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="ui small modal" id="transfer-repo-modal">
  140. <div class="header">
  141. {{.i18n.Tr "repo.settings.transfer"}}
  142. </div>
  143. <div class="content">
  144. <div class="ui warning message text left">
  145. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  146. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  147. </div>
  148. <form class="ui form" action="{{.Link}}" method="post">
  149. {{.CsrfTokenHtml}}
  150. <input type="hidden" name="action" value="transfer">
  151. <div class="field">
  152. <label>
  153. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  154. <span class="text red">{{.Repository.Name}}</span>
  155. </label>
  156. </div>
  157. <div class="required field">
  158. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  159. <input id="repo_name" name="repo_name" required>
  160. </div>
  161. <div class="required field">
  162. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  163. <input id="new_owner_name" name="new_owner_name" required>
  164. </div>
  165. <div class="text right actions">
  166. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  167. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  168. </div>
  169. </form>
  170. </div>
  171. </div>
  172. <div class="ui small modal" id="delete-repo-modal">
  173. <div class="header">
  174. {{.i18n.Tr "repo.settings.delete"}}
  175. </div>
  176. <div class="content">
  177. <div class="ui warning message text left">
  178. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}} <br>
  179. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  180. {{if .Repository.NumForks}}<br>
  181. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}} <br>
  182. {{.i18n.Tr "repo.settings.delete_notices_fork_2" | Safe}} <br>
  183. {{.i18n.Tr "repo.settings.delete_notices_fork_3" | Safe}}
  184. {{end}}
  185. </div>
  186. <form class="ui form" action="{{.Link}}" method="post">
  187. {{.CsrfTokenHtml}}
  188. <input type="hidden" name="action" value="delete">
  189. <div class="field">
  190. <label>
  191. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  192. <span class="text red">{{.Repository.Name}}</span>
  193. </label>
  194. </div>
  195. <div class="required field">
  196. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  197. <input id="repo_name" name="repo_name" required>
  198. </div>
  199. <div class="text right actions">
  200. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  201. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  202. </div>
  203. </form>
  204. </div>
  205. </div>
  206. {{template "base/footer" .}}