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.

128 lines
8.0 KiB

  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 id="user-profile-setting-content" 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="field clear">
  24. <label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
  25. <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.Repository.Description}}</textarea>
  26. </div>
  27. <div class="field">
  28. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  29. <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="site" type="url" value="{{.Repository.Website}}" />
  30. </div>
  31. <hr>
  32. <br>
  33. {{if not .Repository.IsBare}}
  34. <div class="field">
  35. <label>{{.i18n.Tr "repo.default_branch"}}</label>
  36. <select name="branch">
  37. {{if .Repository.DefaultBranch}}<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>{{end}}
  38. {{range .Branches}}
  39. {{if not (eq . $.Repository.DefaultBranch)}}<option value="{{.}}">{{.}}</option>{{end}}
  40. {{end}}
  41. </select>
  42. </div>
  43. {{end}}
  44. {{if .Repository.IsMirror}}
  45. <div class="field">
  46. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  47. <input class="ipt ipt-large ipt-radius {{if .Err_Interval}}ipt-error{{end}}" id="interval" name="interval" type="number" value="{{.MirrorInterval}}" />
  48. </div>
  49. {{end}}
  50. <div class="field">
  51. <label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
  52. <input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}} />
  53. <span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
  54. </div>
  55. <div class="field">
  56. <label for="goget">{{.i18n.Tr "repo.goget_meta"}}</label>
  57. <input class="ipt-chk" id="goget" name="goget" type="checkbox" {{if .Repository.IsGoget}}checked{{end}} />
  58. <span>{{.i18n.Tr "repo.goget_meta_helper" | Str2html}}</span>
  59. </div>
  60. <div class="field">
  61. <span class="form-label"></span>
  62. <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "repo.settings.update_settings"}}</button>
  63. </div>
  64. </form>
  65. </div>
  66. </div>
  67. </div>
  68. <br>
  69. <div class="setting-content">
  70. <div id="setting-content">
  71. <div id="user-profile-setting-content" class="panel panel-warning panel-radius">
  72. <div class="panel-header">
  73. <strong>{{.i18n.Tr "repo.settings.danger_zone"}}</strong>
  74. </div>
  75. <div class="panel-body">
  76. <div class="repo-setting-zone">
  77. <button class="btn btn-gray btn-large btn-radius right" id="transfer-button">{{.i18n.Tr "repo.settings.transfer"}}</button>
  78. <dt>{{.i18n.Tr "repo.settings.transfer"}}</dt>
  79. <dl>{{.i18n.Tr "repo.settings.transfer_desc"}}</dl>
  80. <div class="hide" id="transfer-form">
  81. <br>
  82. <form class="form-align form panel container panel-radius" action="{{.RepoLink}}/settings" method="post">
  83. {{.CsrfTokenHtml}}
  84. <input type="hidden" name="action" value="transfer">
  85. <div class="panel-content">
  86. <div class="field">
  87. <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  88. <input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
  89. </div>
  90. <label class="req" for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  91. <input class="ipt ipt-large ipt-radius" id="new_owner_name" name="new_owner_name" required/>
  92. <span class="form-label"></span>
  93. <button class="btn btn-large btn-red btn-radius right">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  94. </div>
  95. </form>
  96. </div>
  97. </div>
  98. <hr>
  99. <div class="repo-setting-zone">
  100. <button class="btn btn-gray btn-large btn-radius pull-right" id="delete-button">{{.i18n.Tr "repo.settings.delete"}}</button>
  101. <dt>{{.i18n.Tr "repo.settings.delete"}}</dt>
  102. <dl>{{.i18n.Tr "repo.settings.delete_desc"}}</dl>
  103. <div class="hide" id="delete-form">
  104. <br>
  105. <form class="form-align form panel container panel-radius" action="{{.RepoLink}}/settings" method="post">
  106. {{.CsrfTokenHtml}}
  107. <input type="hidden" name="action" value="delete">
  108. <div class="panel-content">
  109. <div class="field">
  110. <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  111. <input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
  112. </div>
  113. <label class="req" for="password">{{.i18n.Tr "password"}}</label>
  114. <input class="ipt ipt-large ipt-radius" id="password" name="password" type="password" required/>
  115. <span class="form-label"></span>
  116. <button class="btn btn-large btn-red btn-radius right">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  117. </div>
  118. </form>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. {{template "ng/base/footer" .}}