create.tmpl 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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="user_id" name="user_id" 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="{{.LoggedUser.ID}}">
  23. <img class="ui mini image" src="{{.LoggedUser.RelAvatarLink}}">
  24. {{.LoggedUser.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" | Safe}}</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.visiblity_helper_forced" | Safe}}</label>
  46. {{else}}
  47. <input name="private" type="checkbox" {{if .private}}checked{{end}}>
  48. <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}}</label>
  49. {{end}}
  50. </div>
  51. </div>
  52. <div class="inline field">
  53. <label></label>
  54. <div class="ui checkbox">
  55. <input name="unlisted" type="checkbox">
  56. <label>{{.i18n.Tr "repo.unlisted_helper" | Safe}}</label>
  57. </div>
  58. </div>
  59. <div class="inline field {{if .Err_Description}}error{{end}}">
  60. <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label>
  61. <textarea class="autosize" id="description" name="description" rows="3">{{.description}}</textarea>
  62. <span class="help">{{.i18n.Tr "repo.repo_description_helper" | Safe}}</span>
  63. <span class="help">{{.i18n.Tr "repo.repo_description_length"}}: <span id="descLength"></span></span>
  64. </div>
  65. <div class="ui divider"></div>
  66. <div class="inline field">
  67. <label>.gitignore</label>
  68. <div class="ui multiple search normal selection dropdown">
  69. <input type="hidden" name="gitignores" value="{{.gitignores}}">
  70. <div class="default text">{{.i18n.Tr "repo.repo_gitignore_helper"}}</div>
  71. <div class="menu">
  72. {{range .Gitignores}}
  73. <div class="item" data-value="{{.}}">{{.}}</div>
  74. {{end}}
  75. </div>
  76. </div>
  77. </div>
  78. <div class="inline field">
  79. <label>{{.i18n.Tr "repo.license"}}</label>
  80. <div class="ui search selection dropdown">
  81. <input type="hidden" name="license" value="{{.license}}">
  82. <div class="default text">{{.i18n.Tr "repo.license_helper"}}</div>
  83. <div class="menu">
  84. {{range .Licenses}}
  85. <div class="item" data-value="{{.}}">{{.}}</div>
  86. {{end}}
  87. </div>
  88. </div>
  89. </div>
  90. <div class="inline field">
  91. <label>{{.i18n.Tr "repo.readme"}} <a target="_blank" rel="noopener noreferrer" href="https://github.com/gogits/go-gogs-client/wiki/Repositories#litte-notes-on-readme-template"><span class="octicon octicon-question"></span></a></label>
  92. <div class="ui selection dropdown">
  93. <input type="hidden" name="readme" value="{{.readme}}">
  94. <div class="default text">{{.i18n.Tr "repo.readme_helper"}}</div>
  95. <div class="menu">
  96. {{range .Readmes}}
  97. <div class="item" data-value="{{.}}">{{.}}</div>
  98. {{end}}
  99. </div>
  100. </div>
  101. </div>
  102. <div class="inline field">
  103. <div class="ui checkbox" id="auto-init">
  104. <input class="hidden" name="auto_init" type="checkbox" tabindex="0" {{if .auto_init}}checked{{end}}>
  105. <label>{{.i18n.Tr "repo.auto_init"}}</label>
  106. </div>
  107. </div>
  108. <div class="inline field">
  109. <label></label>
  110. <button class="ui green button">
  111. {{.i18n.Tr "repo.create_repo"}}
  112. </button>
  113. <a class="ui button" href="{{AppSubURL}}/">{{.i18n.Tr "cancel"}}</a>
  114. </div>
  115. </div>
  116. </form>
  117. </div>
  118. </div>
  119. </div>
  120. {{template "base/footer" .}}