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.

117 lines
4.2 KiB

  1. {{template "base/head" .}}
  2. <div class="repository new repo">
  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_repo"}}
  9. </h3>
  10. <div class="ui attached segment">
  11. {{template "base/alert" .}}
  12. <div class="inline required field {{if .Err_Owner}}error{{end}}">
  13. <label>{{.i18n.Tr "repo.owner"}}</label>
  14. <div class="ui selection owner dropdown">
  15. <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
  16. <span class="text">
  17. <img class="ui mini image" src="{{.ContextUser.RelAvatarLink}}">
  18. {{.ContextUser.ShortName 20}}
  19. </span>
  20. <i class="dropdown icon"></i>
  21. <div class="menu">
  22. <div class="item" data-value="{{.SignedUser.ID}}">
  23. <img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}">
  24. {{.SignedUser.ShortName 20}}
  25. </div>
  26. {{range .Orgs}}
  27. <div class="item" data-value="{{.ID}}">
  28. <img class="ui mini image" src="{{.RelAvatarLink}}">
  29. {{.ShortName 20}}
  30. </div>
  31. {{end}}
  32. </div>
  33. </div>
  34. </div>
  35. <div class="inline required field {{if .Err_RepoName}}error{{end}}">
  36. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  37. <input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required>
  38. <span class="help">{{.i18n.Tr "repo.repo_name_helper"}}</span>
  39. </div>
  40. <div class="inline field">
  41. <label>{{.i18n.Tr "repo.visibility"}}</label>
  42. <div class="ui checkbox">
  43. {{if .IsForcedPrivate}}
  44. <input name="private" type="checkbox" checked readonly>
  45. <label>{{.i18n.Tr "repo.visibility_helper_forced" | Safe}}</label>
  46. {{else}}
  47. <input name="private" type="checkbox" {{if .private}}checked{{end}}>
  48. <label>{{.i18n.Tr "repo.visibility_helper" | Safe}}</label>
  49. {{end}}
  50. </div>
  51. </div>
  52. <div class="inline field {{if .Err_Description}}error{{end}}">
  53. <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label>
  54. <textarea id="description" name="description">{{.description}}</textarea>
  55. </div>
  56. <div class="ui divider"></div>
  57. <div class="inline field">
  58. <label>.gitignore</label>
  59. <div class="ui multiple search normal selection dropdown">
  60. <input type="hidden" name="gitignores" value="{{.gitignores}}">
  61. <div class="default text">{{.i18n.Tr "repo.repo_gitignore_helper"}}</div>
  62. <div class="menu">
  63. {{range .Gitignores}}
  64. <div class="item" data-value="{{.}}">{{.}}</div>
  65. {{end}}
  66. </div>
  67. </div>
  68. </div>
  69. <div class="inline field">
  70. <label>{{.i18n.Tr "repo.license"}}</label>
  71. <div class="ui search selection dropdown">
  72. <input type="hidden" name="license" value="{{.license}}">
  73. <div class="default text">{{.i18n.Tr "repo.license_helper"}}</div>
  74. <div class="menu">
  75. <div class="item" data-value="">{{.i18n.Tr "repo.license_helper"}}</div>
  76. {{range .Licenses}}
  77. <div class="item" data-value="{{.}}">{{.}}</div>
  78. {{end}}
  79. </div>
  80. </div>
  81. </div>
  82. <div class="inline field">
  83. <label>{{.i18n.Tr "repo.readme"}}</label>
  84. <div class="ui selection dropdown">
  85. <input type="hidden" name="readme" value="{{.readme}}">
  86. <div class="default text">{{.i18n.Tr "repo.readme_helper"}}</div>
  87. <div class="menu">
  88. {{range .Readmes}}
  89. <div class="item" data-value="{{.}}">{{.}}</div>
  90. {{end}}
  91. </div>
  92. </div>
  93. </div>
  94. <div class="inline field">
  95. <div class="ui checkbox" id="auto-init">
  96. <input class="hidden" name="auto_init" type="checkbox" tabindex="0" {{if .auto_init}}checked{{end}}>
  97. <label>{{.i18n.Tr "repo.auto_init"}}</label>
  98. </div>
  99. </div>
  100. <div class="inline field">
  101. <label></label>
  102. <button class="ui green button">
  103. {{.i18n.Tr "repo.create_repo"}}
  104. </button>
  105. <a class="ui button" href="{{AppSubUrl}}/">{{.i18n.Tr "cancel"}}</a>
  106. </div>
  107. </div>
  108. </form>
  109. </div>
  110. </div>
  111. </div>
  112. {{template "base/footer" .}}