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.

168 lines
6.4 KiB

  1. {{template "base/head" .}}
  2. <div class="repository settings options">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "repo/sidebar" .}}
  6. <div class="ui grid">
  7. {{template "repo/settings/navbar" .}}
  8. <div class="twelve wide column content">
  9. {{template "base/alert" .}}
  10. <h4 class="ui top attached header">
  11. {{.i18n.Tr "repo.settings.basic_settings"}}
  12. </h4>
  13. <div class="ui attached segment">
  14. <form class="ui form" action="{{.Link}}" method="post">
  15. {{.CsrfTokenHtml}}
  16. <input type="hidden" name="action" value="update">
  17. <div class="required field {{if .Err_RepoName}}error{{end}}">
  18. <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>
  19. <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
  20. </div>
  21. <div class="field {{if .Err_Description}}error{{end}}">
  22. <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label>
  23. <textarea id="description" name="description" rows="2">{{.Repository.Description}}</textarea>
  24. </div>
  25. <div class="field {{if .Err_Website}}error{{end}}">
  26. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  27. <input id="website" name="website" type="url" value="{{.Repository.Website}}">
  28. </div>
  29. <div class="ui divider"></div>
  30. {{if not .Repository.IsBare}}
  31. <div class="required inline field">
  32. <label>{{.i18n.Tr "repo.default_branch"}}</label>
  33. <div class="ui selection dropdown">
  34. <input type="hidden" id="branch" name="branch" value="{{.Repository.DefaultBranch}}">
  35. <div class="text">{{.Repository.DefaultBranch}}</div>
  36. <i class="dropdown icon"></i>
  37. <div class="menu">
  38. {{range .Branches}}
  39. <div class="item" data-value="{{.}}">{{.}}</div>
  40. {{end}}
  41. </div>
  42. </div>
  43. </div>
  44. {{end}}
  45. {{if not .Repository.IsFork}}
  46. <div class="inline field">
  47. <label>{{.i18n.Tr "repo.visibility"}}</label>
  48. <div class="ui checkbox">
  49. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  50. <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label>
  51. </div>
  52. </div>
  53. {{end}}
  54. {{if .Repository.IsMirror}}
  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" type="number" value="{{.MirrorInterval}}">
  58. </div>
  59. {{end}}
  60. <div class="field">
  61. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  62. </div>
  63. </form>
  64. </div>
  65. <h4 class="ui top attached warning header">
  66. {{.i18n.Tr "repo.settings.danger_zone"}}
  67. </h4>
  68. <div class="ui attached warning table danger segment">
  69. <div class="item">
  70. <div class="ui right">
  71. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  72. </div>
  73. <div>
  74. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  75. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  76. </div>
  77. </div>
  78. <div class="ui divider"></div>
  79. <div class="item">
  80. <div class="ui right">
  81. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  82. </div>
  83. <div>
  84. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  85. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="ui small modal" id="transfer-repo-modal">
  94. <div class="header">
  95. {{.i18n.Tr "repo.settings.transfer"}}
  96. </div>
  97. <div class="content">
  98. <div class="ui warning message text left">
  99. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  100. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  101. </div>
  102. <form class="ui form" action="{{.Link}}" method="post">
  103. {{.CsrfTokenHtml}}
  104. <input type="hidden" name="action" value="transfer">
  105. <div class="field">
  106. <label>
  107. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  108. <span class="text red">{{.Repository.Name}}</span>
  109. </label>
  110. </div>
  111. <div class="required field">
  112. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  113. <input id="repo_name" name="repo_name" required>
  114. </div>
  115. <div class="required field">
  116. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  117. <input id="new_owner_name" name="new_owner_name" required>
  118. </div>
  119. <div class="text right actions">
  120. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  121. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  122. </div>
  123. </form>
  124. </div>
  125. </div>
  126. <div class="ui small modal" id="delete-repo-modal">
  127. <div class="header">
  128. {{.i18n.Tr "repo.settings.delete"}}
  129. </div>
  130. <div class="content">
  131. <div class="ui warning message text left">
  132. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}} <br>
  133. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  134. {{if .Repository.NumForks}}<br>
  135. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}} <br>
  136. {{.i18n.Tr "repo.settings.delete_notices_fork_2" | Safe}} <br>
  137. {{.i18n.Tr "repo.settings.delete_notices_fork_3" | Safe}}
  138. {{end}}
  139. </div>
  140. <form class="ui form" action="{{.Link}}" method="post">
  141. {{.CsrfTokenHtml}}
  142. <input type="hidden" name="action" value="delete">
  143. <div class="field">
  144. <label>
  145. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  146. <span class="text red">{{.Repository.Name}}</span>
  147. </label>
  148. </div>
  149. <div class="required field">
  150. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  151. <input id="repo_name" name="repo_name" required>
  152. </div>
  153. <div class="text right actions">
  154. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  155. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  156. </div>
  157. </form>
  158. </div>
  159. </div>
  160. {{template "base/footer" .}}