new.tmpl 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. <div id="admin-wrapper">
  4. <div id="setting-wrapper" class="main-wrapper">
  5. <div id="admin-setting" class="container clear">
  6. {{template "admin/nav" .}}
  7. <div class="grid-4-5 left">
  8. <div class="setting-content">
  9. {{template "ng/base/alert" .}}
  10. <div id="setting-content">
  11. <div class="panel panel-radius">
  12. <div class="panel-header">
  13. <strong>{{.i18n.Tr "admin.auths.new"}}</strong>
  14. </div>
  15. <form class="form form-align panel-body" id="repo-setting-form" action="{{AppSubUrl}}/admin/auths/new" method="post">
  16. {{.CsrfTokenHtml}}
  17. <div class="field">
  18. <label class="req">{{.i18n.Tr "admin.auths.auth_type"}}</label>
  19. <select id="auth-type" name="type">
  20. {{range $key, $val := .LoginTypes}}
  21. <option value="{{$key}}">{{$val}}</option>
  22. {{end}}
  23. </select>
  24. </div>
  25. <div class="field">
  26. <label class="req" for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
  27. <input class="ipt ipt-large ipt-radius {{if .Err_AuthName}}ipt-error{{end}}" id="name" name="name" value="{{.name}}" required />
  28. </div>
  29. <div class="ldap">
  30. <div class="field">
  31. <label class="req" for="host">{{.i18n.Tr "admin.auths.host"}}</label>
  32. <input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.host}}" />
  33. </div>
  34. <div class="field">
  35. <label class="req" for="port">{{.i18n.Tr "admin.auths.port"}}</label>
  36. <input class="ipt ipt-large ipt-radius {{if .Err_Port}}ipt-error{{end}}" id="port" name="port" value="{{.port}}" />
  37. </div>
  38. <div class="field">
  39. <label for="use_ssl">{{.i18n.Tr "admin.auths.enable_tls"}}</label>
  40. <input name="use_ssl" type="checkbox" {{if .use_ssl}}checked{{end}}>
  41. </div>
  42. <div class="field">
  43. <label class="req" for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
  44. <input class="ipt ipt-large ipt-radius {{if .Err_BindDN}}ipt-error{{end}}" id="bind_dn" name="bind_dn" value="{{.bind_dn}}" />
  45. </div>
  46. <div class="field">
  47. <label class="req" for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label>
  48. <input class="ipt ipt-large ipt-radius {{if .Err_BindPassword}}ipt-error{{end}}" id="bind_password" name="bind_password" type="password" value="{{.bind_password}}" />
  49. </div>
  50. <div class="field">
  51. <label class="req" for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
  52. <input class="ipt ipt-large ipt-radius {{if .Err_UserBase}}ipt-error{{end}}" id="user_base" name="user_base" value="{{.user_base}}" />
  53. </div>
  54. <div class="field">
  55. <label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
  56. <input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.filter}}" />
  57. </div>
  58. <div class="field">
  59. <label for="filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
  60. <input class="ipt ipt-large ipt-radius {{if .Err_AdminFilter}}ipt-error{{end}}" id="admin_filter" name="admin_filter" value="{{.admin_filter}}" />
  61. </div>
  62. <div class="field">
  63. <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
  64. <input class="ipt ipt-large ipt-radius {{if .Err_AttributeName}}ipt-error{{end}}" id="attribute_name" name="attribute_name" value="{{.attribute_name}}" />
  65. </div>
  66. <div class="field">
  67. <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
  68. <input class="ipt ipt-large ipt-radius {{if .Err_AttributeSurname}}ipt-error{{end}}" id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}" />
  69. </div>
  70. <div class="field">
  71. <label class="req" for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
  72. <input class="ipt ipt-large ipt-radius {{if .Err_AttributeMail}}ipt-error{{end}}" id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" />
  73. </div>
  74. </div>
  75. <div class="smtp hidden">
  76. <div class="field">
  77. <label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  78. <select name="smtp_auth">
  79. {{range .SMTPAuths}}
  80. <option value="{{.}}">{{.}}</option>
  81. {{end}}
  82. </select>
  83. </div>
  84. <div class="field">
  85. <label class="req" for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  86. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtp_host" name="smtp_host" value="{{.smtp_host}}" />
  87. </div>
  88. <div class="field">
  89. <label class="req" for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  90. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtp_port" name="smtp_port" value="{{.smtp_port}}" />
  91. </div>
  92. </div>
  93. <div class="pam hidden">
  94. <div class="field">
  95. <label class="req" for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label>
  96. <input class="ipt ipt-large ipt-radius {{if .Err_PAMServiceName}}ipt-error{{end}}" id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}" />
  97. </div>
  98. </div>
  99. <div class="field">
  100. <div class="smtp hidden">
  101. <label></label>
  102. <input name="tls" type="checkbox" {{if .tls}}checked{{end}}>
  103. <strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
  104. <br>
  105. </div>
  106. <label></label>
  107. <input name="allowautoregister" type="checkbox" {{if .allowautoregister}}checked{{end}}>
  108. <strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong>
  109. </div>
  110. <div class="field">
  111. <label></label>
  112. <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "admin.auths.new"}}</button>
  113. </div>
  114. </form>
  115. </div>
  116. <br>
  117. <div class="panel panel-radius">
  118. <div class="panel-header">
  119. {{.i18n.Tr "admin.auths.tips"}}
  120. </div>
  121. <div class="panel-body admin-panel">
  122. <h5>GMail Setting:</h5>
  123. <p>Host: smtp.gmail.com, Post: 587, Enable TLS Encryption: true</p>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. {{template "ng/base/footer" .}}