options.tmpl 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. <div class="ui divider"></div>
  29. {{if not .Repository.IsBare}}
  30. <div class="required inline field">
  31. <label>{{.i18n.Tr "repo.default_branch"}}</label>
  32. <div class="ui selection dropdown">
  33. <input type="hidden" id="branch" name="branch" value="{{.Repository.DefaultBranch}}">
  34. <div class="text">{{.Repository.DefaultBranch}}</div>
  35. <i class="dropdown icon"></i>
  36. <div class="menu">
  37. {{range .Branches}}
  38. <div class="item" data-value="{{.}}">{{.}}</div>
  39. {{end}}
  40. </div>
  41. </div>
  42. </div>
  43. {{end}}
  44. {{if not .Repository.IsFork}}
  45. <div class="inline field">
  46. <label>{{.i18n.Tr "repo.visibility"}}</label>
  47. <div class="ui checkbox">
  48. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  49. <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label>
  50. </div>
  51. </div>
  52. {{end}}
  53. {{if .Repository.IsMirror}}
  54. <div class="inline field {{if .Err_Interval}}error{{end}}">
  55. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  56. <input id="interval" name="interval" type="number" value="{{.MirrorInterval}}">
  57. </div>
  58. {{end}}
  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 warning header">
  65. {{.i18n.Tr "repo.settings.danger_zone"}}
  66. </h4>
  67. <div class="ui attached warning table danger segment">
  68. <div class="item">
  69. <div class="ui right">
  70. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  71. </div>
  72. <div>
  73. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  74. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  75. </div>
  76. </div>
  77. <div class="ui divider"></div>
  78. <div class="item">
  79. <div class="ui right">
  80. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  81. </div>
  82. <div>
  83. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  84. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="ui small modal" id="transfer-repo-modal">
  93. <div class="header">
  94. {{.i18n.Tr "repo.settings.transfer"}}
  95. </div>
  96. <div class="content">
  97. <div class="ui warning message text left">
  98. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  99. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  100. </div>
  101. <form class="ui form" action="{{.Link}}" method="post">
  102. {{.CsrfTokenHtml}}
  103. <input type="hidden" name="action" value="transfer">
  104. <div class="field">
  105. <label>
  106. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  107. <span class="text red">{{.Repository.Name}}</span>
  108. </label>
  109. </div>
  110. <div class="required field">
  111. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  112. <input id="repo_name" name="repo_name" required>
  113. </div>
  114. <div class="required field">
  115. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  116. <input id="new_owner_name" name="new_owner_name" required>
  117. </div>
  118. <div class="text right actions">
  119. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  120. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  121. </div>
  122. </form>
  123. </div>
  124. </div>
  125. <div class="ui small modal" id="delete-repo-modal">
  126. <div class="header">
  127. {{.i18n.Tr "repo.settings.delete"}}
  128. </div>
  129. <div class="content">
  130. <div class="ui warning message text left">
  131. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}} <br>
  132. {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
  133. {{if .Repository.NumForks}}<br>
  134. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}} <br>
  135. {{.i18n.Tr "repo.settings.delete_notices_fork_2" | Safe}} <br>
  136. {{.i18n.Tr "repo.settings.delete_notices_fork_3" | Safe}}
  137. {{end}}
  138. </div>
  139. <form class="ui form" action="{{.Link}}" method="post">
  140. {{.CsrfTokenHtml}}
  141. <input type="hidden" name="action" value="delete">
  142. <div class="field">
  143. <label>
  144. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  145. <span class="text red">{{.Repository.Name}}</span>
  146. </label>
  147. </div>
  148. <div class="required field">
  149. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  150. <input id="repo_name" name="repo_name" required>
  151. </div>
  152. <div class="text right actions">
  153. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  154. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  155. </div>
  156. </form>
  157. </div>
  158. </div>
  159. {{template "base/footer" .}}