options.tmpl 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. <div id="repo-wrapper">
  4. {{template "repo/header" .}}
  5. <div id="setting-wrapper" class="main-wrapper">
  6. <div id="repo-setting" class="container clear">
  7. {{template "repo/settings/nav" .}}
  8. <div class="grid-4-5 left">
  9. <div class="setting-content">
  10. {{template "ng/base/alert" .}}
  11. <div id="setting-content">
  12. <div class="panel panel-radius">
  13. <div class="panel-header">
  14. <strong>{{.i18n.Tr "repo.settings.basic_settings"}}</strong>
  15. </div>
  16. <form class="form form-align panel-body" id="repo-setting-form" action="{{.RepoLink}}/settings" method="post">
  17. {{.CsrfTokenHtml}}
  18. <input type="hidden" name="action" value="update">
  19. <div class="field">
  20. <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  21. <input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" required />
  22. </div>
  23. <div class="white-popup-block mfp-hide" id="change-reponame-modal">
  24. <h1 class="text-red">{{.i18n.Tr "repo.settings.change_reponame"}}</h1>
  25. <p>{{.i18n.Tr "repo.settings.change_reponame_desc"}}</p>
  26. <br>
  27. <button class="btn btn-red btn-large btn-radius" id="change-reponame-submit">{{.i18n.Tr "settings.continue"}}</button>
  28. <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  29. </div>
  30. <div class="field clear">
  31. <label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
  32. <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.Repository.Description}}</textarea>
  33. </div>
  34. <div class="field">
  35. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  36. <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="site" type="url" value="{{.Repository.Website}}" />
  37. </div>
  38. <hr>
  39. <br>
  40. {{if not .Repository.IsBare}}
  41. <div class="field">
  42. <label>{{.i18n.Tr "repo.default_branch"}}</label>
  43. <select name="branch">
  44. {{if .Repository.DefaultBranch}}<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>{{end}}
  45. {{range .Branches}}
  46. {{if not (eq . $.Repository.DefaultBranch)}}<option value="{{.}}">{{.}}</option>{{end}}
  47. {{end}}
  48. </select>
  49. </div>
  50. {{end}}
  51. {{if .Repository.IsMirror}}
  52. <div class="field">
  53. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  54. <input class="ipt ipt-large ipt-radius {{if .Err_Interval}}ipt-error{{end}}" id="interval" name="interval" type="number" value="{{.MirrorInterval}}" />
  55. </div>
  56. {{end}}
  57. <div class="field">
  58. <label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
  59. <input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}} />
  60. <span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
  61. </div>
  62. <div class="field">
  63. <label for="goget">{{.i18n.Tr "repo.goget_meta"}}</label>
  64. <input class="ipt-chk" id="goget" name="goget" type="checkbox" {{if .Repository.IsGoget}}checked{{end}} />
  65. <span>{{.i18n.Tr "repo.goget_meta_helper" | Str2html}}</span>
  66. </div>
  67. <div class="field">
  68. <span class="form-label"></span>
  69. <button class="btn btn-green btn-large btn-radius" id="change-reponame-btn" href="#change-reponame-modal">{{.i18n.Tr "repo.settings.update_settings"}}</button>
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. <br>
  76. <div class="setting-content">
  77. <div id="setting-content">
  78. <div id="user-profile-setting-content" class="panel panel-warning panel-radius">
  79. <div class="panel-header">
  80. <strong>{{.i18n.Tr "repo.settings.danger_zone"}}</strong>
  81. </div>
  82. <div class="panel-body">
  83. <div class="repo-setting-zone">
  84. <button class="btn btn-gray btn-large btn-radius right" id="transfer-repo-btn" href="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  85. <dt>{{.i18n.Tr "repo.settings.transfer"}}</dt>
  86. <dl>{{.i18n.Tr "repo.settings.transfer_desc"}}</dl>
  87. <div class="white-popup-block mfp-hide" id="transfer-repo-modal">
  88. <h1 class="text-red">{{.i18n.Tr "repo.settings.transfer"}}</h1>
  89. {{.i18n.Tr "repo.settings.transfer_notices" | Str2html}}
  90. <br>
  91. <form class="form-align form panel container panel-radius" id="transfer-repo-form" action="{{.RepoLink}}/settings" method="post">
  92. {{.CsrfTokenHtml}}
  93. <input type="hidden" name="action" value="transfer">
  94. <div class="panel-content">
  95. <div class="field">
  96. <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  97. <input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
  98. </div>
  99. <div class="field">
  100. <label class="req" for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  101. <input class="ipt ipt-large ipt-radius" id="new_owner_name" name="new_owner_name" required/>
  102. </div>
  103. <div class="field">
  104. <label class="req" for="password">{{.i18n.Tr "password"}}</label>
  105. <input class="ipt ipt-large ipt-radius" id="password" name="password" type="password" required/>
  106. </div>
  107. </div>
  108. </form>
  109. <br>
  110. <button class="btn btn-large btn-red btn-radius" id="transfer-repo-submit">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  111. <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  112. </div>
  113. </div>
  114. <hr>
  115. <div class="repo-setting-zone">
  116. <button class="btn btn-gray btn-large btn-radius pull-right" id="delete-repo-btn" href="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  117. <dt>{{.i18n.Tr "repo.settings.delete"}}</dt>
  118. <dl>{{.i18n.Tr "repo.settings.delete_desc"}}</dl>
  119. <div class="white-popup-block mfp-hide" id="delete-repo-modal">
  120. <h1 class="text-red">{{.i18n.Tr "repo.settings.delete"}}</h1>
  121. <br>
  122. <form class="form-align form panel container panel-radius" id="delete-repo-form" action="{{.RepoLink}}/settings" method="post">
  123. {{.CsrfTokenHtml}}
  124. <input type="hidden" name="action" value="delete">
  125. <div class="panel-content">
  126. <div class="field">
  127. <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  128. <input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
  129. </div>
  130. <div class="field">
  131. <label class="req" for="password">{{.i18n.Tr "password"}}</label>
  132. <input class="ipt ipt-large ipt-radius" id="password" name="password" type="password" required/>
  133. </div>
  134. </div>
  135. </form>
  136. <br>
  137. <button class="btn btn-large btn-red btn-radius" id="delete-repo-submit">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  138. <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. {{template "ng/base/footer" .}}