create.tmpl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 {{if .Err_Description}}error{{end}}">
  53. <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label>
  54. <textarea class="autosize" id="description" name="description" rows="3">{{.description}}</textarea>
  55. <span class="help">{{.i18n.Tr "repo.repo_description_helper" | Safe}}</span>
  56. <span class="help">{{.i18n.Tr "repo.repo_description_length"}}: <span id="descLength"></span></span>
  57. </div>
  58. <div class="ui divider"></div>
  59. <div class="inline field">
  60. <label>.gitignore</label>
  61. <div class="ui multiple search normal selection dropdown">
  62. <input type="hidden" name="gitignores" value="{{.gitignores}}">
  63. <div class="default text">{{.i18n.Tr "repo.repo_gitignore_helper"}}</div>
  64. <div class="menu">
  65. {{range .Gitignores}}
  66. <div class="item" data-value="{{.}}">{{.}}</div>
  67. {{end}}
  68. </div>
  69. </div>
  70. </div>
  71. <div class="inline field">
  72. <label>{{.i18n.Tr "repo.license"}}</label>
  73. <div class="ui search selection dropdown">
  74. <input type="hidden" name="license" value="{{.license}}">
  75. <div class="default text">{{.i18n.Tr "repo.license_helper"}}</div>
  76. <div class="menu">
  77. {{range .Licenses}}
  78. <div class="item" data-value="{{.}}">{{.}}</div>
  79. {{end}}
  80. </div>
  81. </div>
  82. </div>
  83. <div class="inline field">
  84. <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>
  85. <div class="ui selection dropdown">
  86. <input type="hidden" name="readme" value="{{.readme}}">
  87. <div class="default text">{{.i18n.Tr "repo.readme_helper"}}</div>
  88. <div class="menu">
  89. {{range .Readmes}}
  90. <div class="item" data-value="{{.}}">{{.}}</div>
  91. {{end}}
  92. </div>
  93. </div>
  94. </div>
  95. <div class="inline field">
  96. <div class="ui checkbox" id="auto-init">
  97. <input class="hidden" name="auto_init" type="checkbox" tabindex="0" {{if .auto_init}}checked{{end}}>
  98. <label>{{.i18n.Tr "repo.auto_init"}}</label>
  99. </div>
  100. </div>
  101. <div class="inline field">
  102. <label></label>
  103. <button class="ui green button">
  104. {{.i18n.Tr "repo.create_repo"}}
  105. </button>
  106. <a class="ui button" href="{{AppSubURL}}/">{{.i18n.Tr "cancel"}}</a>
  107. </div>
  108. </div>
  109. </form>
  110. </div>
  111. </div>
  112. </div>
  113. {{template "base/footer" .}}