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.

81 lines
5.0 KiB

  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. <div id="repo-wrapper">
  4. <form id="repo-migrate-form" class="form form-align panel panel-radius" action="/repo/migrate" method="post">
  5. {{.CsrfTokenHtml}}
  6. <div class="panel-header"><h2>{{.i18n.Tr "new_migrate"}}</h2></div>
  7. <div class="panel-content">
  8. {{template "ng/base/alert" .}}
  9. <div class="field">
  10. <label class="req" for="url">HTTPS URL</label>
  11. <input class="ipt ipt-large ipt-radius {{if .Err_HttpsUrl}}ipt-error{{end}}" id="url" name="url" type="text" value="{{.url}}" required />
  12. </div>
  13. <div class="field">
  14. <span class="form-label"></span>
  15. <button class="btn btn-large btn-gray btn-radius" id="auth-button" data-toggle="collapse" data-target="#repo-import-auth">{{.i18n.Tr "repo.need_auth"}}</button>
  16. <div id="repo-migrate-auth" {{if not .Err_Auth}}class="hide"{{end}}>
  17. <div class="field">
  18. <label for="auth_username">{{.i18n.Tr "username"}}</label>
  19. <input class="ipt ipt-large ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_username" name="auth_username" type="text" value="{{.auth_username}}" />
  20. </div>
  21. <div class="field">
  22. <label for="auth_password">{{.i18n.Tr "password"}}</label>
  23. <input class="ipt ipt-large ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_password" name="auth_password" type="text" value="{{.auth_password}}" />
  24. </div>
  25. </div>
  26. </div>
  27. <hr/>
  28. <div class="field">
  29. <label for="owner" class="req">{{.i18n.Tr "repo.owner"}}</label>
  30. <input id="repo-owner-id" type="hidden" name="uid" value="{{.ContextUser.Id}}" />
  31. <div class="inline-block drop">
  32. <a href="#" class="drop-bottom">
  33. <img class="avatar" src="{{.ContextUser.AvatarLink}}" id="repo-owner-avatar" alt="user-avatar">
  34. <strong id="repo-owner-name">{{.ContextUser.Name}}</strong>
  35. </a>
  36. <ul class="drop-down menu menu-vertical menu-radius switching-list" id="repo-create-owner-list">
  37. <li {{if eq $.ContextUser.Id .SignedUser.Id}}class="checked"{{end}} data-uid="{{.SignedUser.Id}}">
  38. <a>
  39. <i class="octicon octicon-check"></i>
  40. <img class="avatar" src="{{.SignedUser.AvatarLink}}" alt="user-avatar">
  41. <strong>{{.SignedUser.Name}}</strong>
  42. </a>
  43. </li>
  44. {{range .Orgs}}
  45. <li {{if eq $.ContextUser.Id .Id}}class="checked"{{end}} data-uid="{{.Id}}">
  46. <a>
  47. <i class="octicon octicon-check"></i>
  48. <img class="avatar" src="{{.AvatarLink}}" alt="user-avatar">
  49. <strong>{{.Name}}</strong>
  50. </a>
  51. </li>
  52. {{end}}
  53. </ul>
  54. </div>
  55. </div>
  56. <div class="field">
  57. <label class="req" for="repo-name">{{.i18n.Tr "repo.repo_name"}}</label>
  58. <input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
  59. </div>
  60. <div class="field">
  61. <label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
  62. <input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .private}}checked{{end}} />
  63. <span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
  64. </div>
  65. <div class="field">
  66. <label for="migrate_type">{{.i18n.Tr "repo.migrate_type"}}</label>
  67. <input class="ipt-chk" id="migrate_type" name="mirror" type="checkbox" {{if .mirror}}checked{{end}} />
  68. <span>{{.i18n.Tr "repo.migrate_type_helper" | Str2html}}</span>
  69. </div>
  70. <div class="field clear">
  71. <label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
  72. <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
  73. </div>
  74. <div class="field">
  75. <label for="repo-create-submit"></label>
  76. <button class="btn btn-large btn-blue btn-radius" id="repo-create-submit">{{.i18n.Tr "repo.migrate_repo"}}</button>
  77. <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
  78. </div>
  79. </div>
  80. </form>
  81. </div>
  82. {{template "ng/base/footer" .}}