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.

new.tmpl 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. {{template "base/head" .}}
  2. <div role="main" aria-label="{{.Title}}" class="page-content admin new authentication">
  3. {{template "admin/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <h4 class="ui top attached header">
  7. {{.locale.Tr "admin.auths.new"}}
  8. </h4>
  9. <div class="ui attached segment">
  10. <form class="ui form" action="{{.Link}}" method="post">
  11. {{template "base/disable_form_autofill"}}
  12. {{.CsrfTokenHtml}}
  13. <!-- Types and name -->
  14. <div class="inline required field {{if .Err_Type}}error{{end}}">
  15. <label>{{.locale.Tr "admin.auths.auth_type"}}</label>
  16. <div class="ui selection type dropdown">
  17. <input type="hidden" id="auth_type" name="type" value="{{.type}}">
  18. <div class="text">{{.CurrentTypeName}}</div>
  19. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  20. <div class="menu">
  21. {{range .AuthSources}}
  22. <div class="item" data-value="{{.Type.Int}}">{{.Name}}</div>
  23. {{end}}
  24. </div>
  25. </div>
  26. </div>
  27. <div class="required inline field {{if .Err_Name}}error{{end}}">
  28. <label for="name">{{.locale.Tr "admin.auths.auth_name"}}</label>
  29. <input id="name" name="name" value="{{.name}}" autofocus required>
  30. </div>
  31. <!-- LDAP and DLDAP -->
  32. {{template "admin/auth/source/ldap" .}}
  33. <!-- SMTP -->
  34. {{template "admin/auth/source/smtp" .}}
  35. <!-- PAM -->
  36. <div class="pam required field {{if not (eq .type 4)}}hide{{end}}">
  37. <label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
  38. <input id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}" />
  39. <label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label>
  40. <input id="pam_email_domain" name="pam_email_domain" value="{{.pam_email_domain}}">
  41. </div>
  42. <div class="pam optional field {{if not (eq .type 4)}}hide{{end}}">
  43. <div class="ui checkbox">
  44. <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
  45. <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}>
  46. <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
  47. </div>
  48. </div>
  49. <!-- OAuth2 -->
  50. {{template "admin/auth/source/oauth" .}}
  51. <!-- SSPI -->
  52. {{template "admin/auth/source/sspi" .}}
  53. <div class="ldap field">
  54. <div class="ui checkbox">
  55. <label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
  56. <input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}>
  57. </div>
  58. </div>
  59. <div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}">
  60. <div class="ui checkbox">
  61. <label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label>
  62. <input name="is_sync_enabled" type="checkbox" {{if .is_sync_enabled}}checked{{end}}>
  63. </div>
  64. </div>
  65. <div class="inline field">
  66. <div class="ui checkbox">
  67. <label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label>
  68. <input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}>
  69. </div>
  70. </div>
  71. <div class="field">
  72. <button class="ui green button">{{.locale.Tr "admin.auths.new"}}</button>
  73. </div>
  74. </form>
  75. </div>
  76. <h4 class="ui top attached header">
  77. {{.locale.Tr "admin.auths.tips"}}
  78. </h4>
  79. <div class="ui attached segment">
  80. <h5>GMail Settings:</h5>
  81. <p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p>
  82. <h5>{{.locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
  83. <p>{{.locale.Tr "admin.auths.tips.oauth2.general.tip"}}</p>
  84. <h5 class="ui top attached header">{{.locale.Tr "admin.auths.tip.oauth2_provider"}}</h5>
  85. <div class="ui attached segment">
  86. <li>Bitbucket</li>
  87. <span>{{.locale.Tr "admin.auths.tip.bitbucket"}}</span>
  88. <li>Dropbox</li>
  89. <span>{{.locale.Tr "admin.auths.tip.dropbox"}}</span>
  90. <li>Facebook</li>
  91. <span>{{.locale.Tr "admin.auths.tip.facebook"}}</span>
  92. <li>GitHub</li>
  93. <span>{{.locale.Tr "admin.auths.tip.github"}}</span>
  94. <li>GitLab</li>
  95. <span>{{.locale.Tr "admin.auths.tip.gitlab"}}</span>
  96. <li>Google</li>
  97. <span>{{.locale.Tr "admin.auths.tip.google_plus"}}</span>
  98. <li>OpenID Connect</li>
  99. <span>{{.locale.Tr "admin.auths.tip.openid_connect"}}</span>
  100. <li>Twitter</li>
  101. <span>{{.locale.Tr "admin.auths.tip.twitter"}}</span>
  102. <li>Discord</li>
  103. <span>{{.locale.Tr "admin.auths.tip.discord"}}</span>
  104. <li>Gitea</li>
  105. <span>{{.locale.Tr "admin.auths.tip.gitea"}}</span>
  106. <li>Nextcloud</li>
  107. <span>{{.locale.Tr "admin.auths.tip.nextcloud"}}</span>
  108. <li>Yandex</li>
  109. <span>{{.locale.Tr "admin.auths.tip.yandex"}}</span>
  110. <li>Mastodon</li>
  111. <span>{{.locale.Tr "admin.auths.tip.mastodon"}}</span>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. {{template "base/footer" .}}