new.tmpl 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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="domain">{{.i18n.Tr "admin.auths.domain"}}</label>
  32. <input class="ipt ipt-large ipt-radius {{if .Err_Domain}}ipt-error{{end}}" id="domain" name="domain" value="{{.domain}}" />
  33. </div>
  34. <div class="field">
  35. <label class="req" for="host">{{.i18n.Tr "admin.auths.host"}}</label>
  36. <input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.host}}" />
  37. </div>
  38. <div class="field">
  39. <label class="req" for="port">{{.i18n.Tr "admin.auths.port"}}</label>
  40. <input class="ipt ipt-large ipt-radius {{if .Err_Port}}ipt-error{{end}}" id="port" name="port" value="{{.port}}" />
  41. </div>
  42. <div class="field">
  43. <label class="req" for="base_dn">{{.i18n.Tr "admin.auths.base_dn"}}</label>
  44. <input class="ipt ipt-large ipt-radius {{if .Err_BaseDN}}ipt-error{{end}}" id="base_dn" name="base_dn" value="{{.base_dn}}" />
  45. </div>
  46. <div class="field">
  47. <label class="req" for="attribute_username">{{.i18n.Tr "admin.auths.attribute_username"}}</label>
  48. <input class="ipt ipt-large ipt-radius {{if .Err_AttributeUsername}}ipt-error{{end}}" id="attribute_username" name="attribute_username" value="{{.attribute_username}}" />
  49. </div>
  50. <div class="field">
  51. <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
  52. <input class="ipt ipt-large ipt-radius {{if .Err_AttributeName}}ipt-error{{end}}" id="attribute_name" name="attribute_name" value="{{.attribute_name}}" />
  53. </div>
  54. <div class="field">
  55. <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
  56. <input class="ipt ipt-large ipt-radius {{if .Err_AttributeSurname}}ipt-error{{end}}" id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}" />
  57. </div>
  58. <div class="field">
  59. <label class="req" for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
  60. <input class="ipt ipt-large ipt-radius {{if .Err_AttributeMail}}ipt-error{{end}}" id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" />
  61. </div>
  62. <div class="field">
  63. <label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
  64. <input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.filter}}" />
  65. </div>
  66. <div class="field">
  67. <label class="req" for="ms_ad_sa">{{.i18n.Tr "admin.auths.ms_ad_sa"}}</label>
  68. <input class="ipt ipt-large ipt-radius {{if .Err_MsAdSA}}ipt-error{{end}}" id="ms_ad_sa" name="ms_ad_sa" value="{{.ms_ad_sa}}" />
  69. </div>
  70. </div>
  71. <div class="smtp hidden">
  72. <div class="field">
  73. <label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  74. <select name="smtp_auth">
  75. {{range .SMTPAuths}}
  76. <option value="{{.}}">{{.}}</option>
  77. {{end}}
  78. </select>
  79. </div>
  80. <div class="field">
  81. <label class="req" for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  82. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtp_host" name="smtp_host" value="{{.smtp_host}}" />
  83. </div>
  84. <div class="field">
  85. <label class="req" for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  86. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtp_port" name="smtp_port" value="{{.smtp_port}}" />
  87. </div>
  88. </div>
  89. <div class="field">
  90. <div class="smtp hidden">
  91. <label></label>
  92. <input name="tls" type="checkbox" {{if .tls}}checked{{end}}>
  93. <strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
  94. <br>
  95. </div>
  96. <label></label>
  97. <input name="allowautoregister" type="checkbox" {{if .allowautoregister}}checked{{end}}>
  98. <strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong>
  99. </div>
  100. <div class="field">
  101. <label></label>
  102. <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "admin.auths.new"}}</button>
  103. </div>
  104. </form>
  105. </div>
  106. <br>
  107. <div class="panel panel-radius">
  108. <div class="panel-header">
  109. {{.i18n.Tr "admin.auths.tips"}}
  110. </div>
  111. <div class="panel-body admin-panel">
  112. <h5>GMail Setting:</h5>
  113. <p>Host: smtp.gmail.com, Post: 587, Enable TLS Encryption: true</p>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. {{template "ng/base/footer" .}}