create.tmpl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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.AvatarLink}}">
  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.AvatarLink}}">
  24. {{.SignedUser.ShortName 20}}
  25. </div>
  26. {{range .Orgs}}
  27. <div class="item" data-value="{{.ID}}">
  28. <img class="ui mini image" src="{{.AvatarLink}}">
  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 id="description" name="description">{{.description}}</textarea>
  55. </div>
  56. <div class="ui divider"></div>
  57. <div class="inline field">
  58. <label>{{.i18n.Tr "repo.repo_lang"}}</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_lang_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. {{range .Licenses}}
  76. <div class="item" data-value="{{.}}">{{.}}</div>
  77. {{end}}
  78. </div>
  79. </div>
  80. </div>
  81. <div class="inline field">
  82. <label>{{.i18n.Tr "repo.readme"}} <a target="_blank" href="https://github.com/gogits/go-gogs-client/wiki/Repositories#litte-notes-on-readme-template"><span class="octicon octicon-question"></span></a></label>
  83. <div class="ui selection dropdown">
  84. <input type="hidden" name="readme" value="{{.readme}}">
  85. <div class="default text">{{.i18n.Tr "repo.readme_helper"}}</div>
  86. <div class="menu">
  87. {{range .Readmes}}
  88. <div class="item" data-value="{{.}}">{{.}}</div>
  89. {{end}}
  90. </div>
  91. </div>
  92. </div>
  93. <div class="inline field">
  94. <div class="ui checkbox" id="auto-init">
  95. <input class="hidden" name="auto_init" type="checkbox" tabindex="0" {{if .auto_init}}checked{{end}}>
  96. <label>{{.i18n.Tr "repo.auto_init"}}</label>
  97. </div>
  98. </div>
  99. <div class="inline field">
  100. <label></label>
  101. <button class="ui green button">
  102. {{.i18n.Tr "repo.create_repo"}}
  103. </button>
  104. <a class="ui button" href="{{AppSubUrl}}/">{{.i18n.Tr "cancel"}}</a>
  105. </div>
  106. </div>
  107. </form>
  108. </div>
  109. </div>
  110. </div>
  111. {{template "base/footer" .}}