new.tmpl 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. {{template "org/base/header" .}}
  4. <div id="repo-wrapper">
  5. <form id="team-create-form" class="form form-align panel panel-radius" action="{{if .PageIsOrgTeamsNew}}{{.OrgLink}}/teams/new{{else}}{{.OrgLink}}/teams/{{.Team.LowerName}}/edit{{end}}" data-delete-url="{{.OrgLink}}/teams/{{.Team.LowerName}}/delete" method="post">
  6. {{.CsrfTokenHtml}}
  7. <div class="panel-header">
  8. <h2>
  9. {{if .PageIsOrgTeamsNew}}{{.i18n.Tr "org.create_new_team"}}{{else}}{{.i18n.Tr "org.teams.settings"}}{{end}}
  10. </h2>
  11. </div>
  12. <div class="panel-content">
  13. {{template "ng/base/alert" .}}
  14. <div class="field">
  15. <label class="req" for="team-name">{{.i18n.Tr "org.team_name"}}</label>
  16. {{if eq .Team.LowerName "owners"}}
  17. <input type="hidden" name="team_name" value="{{.team_name}}">
  18. {{end}}
  19. <input class="ipt ipt-large ipt-radius {{if .Err_TeamName}}ipt-error{{end}}" id="team-name" name="team_name" value="{{.team_name}}" required {{if eq .Team.LowerName "owners"}}disabled{{end}} />
  20. <span class="form-label"></span>
  21. <span class="help">{{.i18n.Tr "org.team_name_helper"}}</span>
  22. </div>
  23. <div class="field">
  24. <label for="desc">{{.i18n.Tr "org.team_desc"}}</label>
  25. <input class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc" value="{{.desc}}" />
  26. <span class="form-label"></span>
  27. <span class="help">{{.i18n.Tr "org.team_desc_helper"}}</span>
  28. </div>
  29. {{if not (eq .Team.LowerName "owners")}}
  30. <div class="field">
  31. <h4 class="text-center">{{.i18n.Tr "org.team_permission_desc"}}</h4>
  32. <label></label>
  33. <input name="permission" type="radio" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.Authorize 1)}}checked{{end}}> {{.i18n.Tr "org.teams.read_access"}}
  34. <label></label>
  35. <p class="text-grey note">{{.i18n.Tr "org.teams.read_access_helper"}}</p>
  36. <label></label>
  37. <input name="permission" type="radio" value="write" {{if eq .Team.Authorize 2}}checked{{end}}> {{.i18n.Tr "org.teams.write_access"}}
  38. <label></label>
  39. <p class="text-grey note">{{.i18n.Tr "org.teams.write_access_helper"}}</p>
  40. <label></label>
  41. <input name="permission" type="radio" value="admin" {{if eq .Team.Authorize 3}}checked{{end}}> {{.i18n.Tr "org.teams.admin_access"}}
  42. <label></label>
  43. <p class="text-grey note">{{.i18n.Tr "org.teams.admin_access_helper"}}</p>
  44. </div>
  45. <hr>
  46. {{end}}
  47. <div class="field">
  48. <label></label>
  49. {{if .PageIsOrgTeamsNew}}
  50. <button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "org.create_new_team"}}</button>
  51. <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="{{.OrgLink}}/teams"><strong>{{.i18n.Tr "cancel"}}</strong></a>
  52. {{else}}
  53. <button class="btn btn-large btn-green btn-radius">{{.i18n.Tr "org.teams.update_settings"}}</button>
  54. {{if not (eq .Team.LowerName "owners")}}
  55. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  56. <button class="btn btn-large btn-red btn-radius" id="org-team-delete" href="#delete-team-modal">{{.i18n.Tr "org.teams.delete_team"}}</button>
  57. <div class="white-popup-block mfp-hide" id="delete-team-modal">
  58. <h1 class="text-red">{{.i18n.Tr "org.teams.delete_team_title"}}</h1>
  59. <p>{{.i18n.Tr "org.teams.delete_team_desc"}}</p>
  60. <br>
  61. <button class="btn btn-red btn-large btn-radius" id="delete-team-submit">{{.i18n.Tr "settings.continue"}}</button>
  62. <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  63. </div>
  64. {{end}}
  65. {{end}}
  66. </div>
  67. </div>
  68. </form>
  69. </div>
  70. {{template "ng/base/footer" .}}