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.

82 lines
4.6 KiB

10 years ago
  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. <div id="repo-wrapper">
  4. <form id="repo-create-form" class="form form-align panel panel-radius" action="{{AppSubUrl}}/repo/create" method="post">
  5. {{.CsrfTokenHtml}}
  6. <div class="panel-header">
  7. <h2>{{.i18n.Tr "new_repo"}}</h2>
  8. </div>
  9. <div class="panel-content">
  10. {{template "ng/base/alert" .}}
  11. <div class="field">
  12. <label for="owner" class="req">{{.i18n.Tr "repo.owner"}}</label>
  13. <input id="repo-owner-id" type="hidden" name="uid" value="{{.ContextUser.Id}}" />
  14. <div class="inline-block drop">
  15. <a class="drop-bottom">
  16. <img class="avatar" src="{{.ContextUser.AvatarLink}}" id="repo-owner-avatar" alt="user-avatar">
  17. <strong id="repo-owner-name">{{.ContextUser.Name}}</strong>
  18. </a>
  19. <ul class="drop-down menu menu-vertical menu-radius switching-list" id="repo-create-owner-list">
  20. <li {{if eq $.ContextUser.Id .SignedUser.Id}}class="checked"{{end}} data-uid="{{.SignedUser.Id}}">
  21. <a>
  22. <i class="octicon octicon-check"></i>
  23. <img class="avatar" src="{{.SignedUser.AvatarLink}}" alt="user-avatar">
  24. <strong>{{.SignedUser.Name}}</strong>
  25. </a>
  26. </li>
  27. {{range .Orgs}}
  28. <li {{if eq $.ContextUser.Id .Id}}class="checked"{{end}} data-uid="{{.Id}}">
  29. <a>
  30. <i class="octicon octicon-check"></i>
  31. <img class="avatar" src="{{.AvatarLink}}" alt="user-avatar">
  32. <strong>{{.Name}}</strong>
  33. </a>
  34. </li>
  35. {{end}}
  36. </ul>
  37. </div>
  38. </div>
  39. <div class="field">
  40. <label class="req" for="repo-name">{{.i18n.Tr "repo.repo_name"}}</label>
  41. <input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
  42. <span class="form-label"></span>
  43. <span class="help">{{.i18n.Tr "repo.repo_name_helper" | Str2html}}</span>
  44. </div>
  45. <div class="field">
  46. <label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
  47. <input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .private}}checked{{end}} />
  48. <span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
  49. </div>
  50. <div class="field clear">
  51. <label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
  52. <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
  53. </div>
  54. <div class="field">
  55. <label for="lang">{{.i18n.Tr "repo.repo_lang"}}</label>
  56. <select id="lang" name="gitignore">
  57. <option>{{.i18n.Tr "repo.repo_lang_helper"}}</option>
  58. {{range .Gitignores}}
  59. <option value="{{.}}" {{if eq . $.gitignore}}selected{{end}}>{{.}}</option>
  60. {{end}}
  61. </select>
  62. <label for="license">{{.i18n.Tr "repo.license"}}</label>
  63. <select id="license" name="license">
  64. <option>{{.i18n.Tr "repo.license_helper"}}</option>
  65. {{range .Licenses}}
  66. <option value="{{.}}" {{if eq . $.license}}selected{{end}}>{{.}}</option>
  67. {{end}}
  68. </select>
  69. </div>
  70. <div class="field">
  71. <label for="init-readme"></label>
  72. <input class="ipt-chk" id="init-readme" name="auto_init" type="checkbox" {{if .auto_init}}checked{{end}} />
  73. <strong>{{.i18n.Tr "repo.init_readme"}}</strong>
  74. </div>
  75. <div class="field">
  76. <label></label>
  77. <button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "repo.create_repo"}}</button>
  78. <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="{{AppSubUrl}}/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
  79. </div>
  80. </div>
  81. </form>
  82. </div>
  83. {{template "ng/base/footer" .}}