migrate.tmpl 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {{template "base/head" .}}
  2. <div class="repository new migrate">
  3. <div class="ui middle very relaxed page grid">
  4. <div class="column">
  5. <form class="ui form" action="{{.Link}}" method="post">
  6. {{.CsrfTokenHtml}}
  7. <h3 class="ui top attached header">
  8. {{.i18n.Tr "new_migrate"}}
  9. </h3>
  10. <div class="ui attached segment">
  11. {{template "base/alert" .}}
  12. <div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
  13. <label for="clone_addr">{{.i18n.Tr "repo.migrate.clone_address"}}</label>
  14. <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
  15. <span class="help">{{.i18n.Tr "repo.migrate.clone_address_desc"}}</span>
  16. </div>
  17. <div class="ui accordion optional field">
  18. <div class="title {{if .Err_Auth}}text red active{{end}}">
  19. <i class="icon dropdown"></i>
  20. {{.i18n.Tr "repo.need_auth"}}
  21. </div>
  22. <div class="content {{if .Err_Auth}}active{{end}}">
  23. <div class="inline field {{if .Err_Auth}}error{{end}}">
  24. <label for="auth_username">{{.i18n.Tr "username"}}</label>
  25. <input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
  26. </div>
  27. <input class="fake" type="password">
  28. <div class="inline field {{if .Err_Auth}}error{{end}}">
  29. <label for="auth_password">{{.i18n.Tr "password"}}</label>
  30. <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
  31. </div>
  32. </div>
  33. </div>
  34. <div class="ui divider"></div>
  35. <div class="inline required field {{if .Err_Owner}}error{{end}}">
  36. <label>{{.i18n.Tr "repo.owner"}}</label>
  37. <div class="ui selection owner dropdown">
  38. <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
  39. <span class="text">
  40. <img class="ui mini image" src="{{.ContextUser.AvatarLink}}">
  41. {{.ContextUser.ShortName 20}}
  42. </span>
  43. <i class="dropdown icon"></i>
  44. <div class="menu">
  45. <div class="item" data-value="{{.SignedUser.ID}}">
  46. <img class="ui mini image" src="{{.SignedUser.AvatarLink}}">
  47. {{.SignedUser.ShortName 20}}
  48. </div>
  49. {{range .Orgs}}
  50. <div class="item" data-value="{{.ID}}">
  51. <img class="ui mini image" src="{{.AvatarLink}}">
  52. {{.ShortName 20}}
  53. </div>
  54. {{end}}
  55. </div>
  56. </div>
  57. </div>
  58. <div class="inline required field {{if .Err_RepoName}}error{{end}}">
  59. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  60. <input id="repo_name" name="repo_name" value="{{.repo_name}}" required>
  61. </div>
  62. <div class="inline field">
  63. <label>{{.i18n.Tr "repo.visibility"}}</label>
  64. <div class="ui checkbox">
  65. {{if .IsForcedPrivate}}
  66. <input name="private" type="checkbox" checked readonly>
  67. <label>{{.i18n.Tr "repo.visiblity_helper_forced" | Safe}}</label>
  68. {{else}}
  69. <input name="private" type="checkbox" {{if .private}}checked{{end}}>
  70. <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}}</label>
  71. {{end}}
  72. </div>
  73. </div>
  74. <div class="inline field">
  75. <label>{{.i18n.Tr "repo.migrate_type"}}</label>
  76. <div class="ui checkbox">
  77. <input name="mirror" type="checkbox" {{if .mirror}}checked{{end}}>
  78. <label>{{.i18n.Tr "repo.migrate_type_helper" | Safe}}</label>
  79. </div>
  80. </div>
  81. <div class="inline field {{if .Err_Description}}error{{end}}">
  82. <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label>
  83. <textarea id="description" name="description">{{.description}}</textarea>
  84. </div>
  85. <div class="inline field">
  86. <label></label>
  87. <button class="ui green button">
  88. {{.i18n.Tr "repo.migrate_repo"}}
  89. </button>
  90. <a class="ui button" href="{{AppSubUrl}}/">{{.i18n.Tr "cancel"}}</a>
  91. </div>
  92. </div>
  93. </form>
  94. </div>
  95. </div>
  96. </div>
  97. {{template "base/footer" .}}