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.

211 lines
11 KiB

10 years ago
  1. {{template "base/head" .}}
  2. <div class="install">
  3. <div class="ui middle very relaxed page grid">
  4. <div class="sixteen wide center aligned centered column">
  5. <h3 class="ui top attached header">
  6. {{.i18n.Tr "install.title"}}
  7. </h3>
  8. <div class="ui attached segment">
  9. {{template "base/alert" .}}
  10. <form class="ui form" action="{{AppSubUrl}}/install" method="post">
  11. {{.CsrfTokenHtml}}
  12. <!-- Dtabase Settings -->
  13. <h4 class="ui dividing header">{{.i18n.Tr "install.db_title"}}</h4>
  14. <p>{{.i18n.Tr "install.requite_db_desc"}}</p>
  15. <div class="inline required field {{if .Err_DbType}}error{{end}}">
  16. <label>{{.i18n.Tr "install.db_type"}}</label>
  17. <div class="ui selection database type dropdown">
  18. <input type="hidden" id="db_type" name="db_type" value="{{.CurDbOption}}">
  19. <div class="default text">{{.CurDbOption}}</div>
  20. <i class="dropdown icon"></i>
  21. <div class="menu">
  22. {{range .DbOptions}}
  23. <div class="item" data-value="{{.}}">{{.}}</div>
  24. {{end}}
  25. </div>
  26. </div>
  27. </div>
  28. <div id="sql_settings" class="{{if eq .CurDbOption "SQLite3"}}hide{{end}}">
  29. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  30. <label for="db_host">{{.i18n.Tr "install.host"}}</label>
  31. <input id="db_host" name="db_host" value="{{.db_host}}">
  32. </div>
  33. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  34. <label for="db_user">{{.i18n.Tr "install.user"}}</label>
  35. <input id="db_user" name="db_user" value="{{.db_user}}">
  36. </div>
  37. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  38. <label for="db_passwd">{{.i18n.Tr "install.password"}}</label>
  39. <input id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}">
  40. </div>
  41. <div class="inline required field {{if .Err_DbSetting}}error{{end}}">
  42. <label for="db_name">{{.i18n.Tr "install.db_name"}}</label>
  43. <input id="db_name" name="db_name" value="{{.db_name}}">
  44. <span class="help">{{.i18n.Tr "install.db_helper"}}</span>
  45. </div>
  46. </div>
  47. <div id="pgsql_settings" class="{{if not (eq .CurDbOption "PostgreSQL")}}hide{{end}}">
  48. <div class="inline required field">
  49. <label>{{.i18n.Tr "install.ssl_mode"}}</label>
  50. <div class="ui selection database type dropdown">
  51. <input type="hidden" name="ssl_mode" value="{{if .ssl_mode}}{{.ssl_mode}}{{else}}disable{{end}}">
  52. <div class="default text">disable</div>
  53. <i class="dropdown icon"></i>
  54. <div class="menu">
  55. <div class="item" data-value="disable">Disable</div>
  56. <div class="item" data-value="require">Require</div>
  57. <div class="item" data-value="verify-full">Verify Full</div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div id="sqlite_settings" class="{{if not (eq .CurDbOption "SQLite3")}}hide{{end}}">
  63. <div class="inline required field {{if .Err_DbPath}}error{{end}}">
  64. <label for="db_path">{{.i18n.Tr "install.path"}}</label>
  65. <input id="db_path" name="db_path" value="{{.db_path}}">
  66. <span class="help">{{.i18n.Tr "install.sqlite_helper"}}</span>
  67. </div>
  68. </div>
  69. <!-- General Settings -->
  70. <h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4>
  71. <div class="inline required field {{if .Err_AppName}}error{{end}}">
  72. <label for="app_name">{{.i18n.Tr "install.app_name"}}</label>
  73. <input id="app_name" name="app_name" value="{{.app_name}}" required>
  74. <span class="help">{{.i18n.Tr "install.app_name_helper"}}</span>
  75. </div>
  76. <div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
  77. <label for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label>
  78. <input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>
  79. <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span>
  80. </div>
  81. <div class="inline required field {{if .Err_RunUser}}error{{end}}">
  82. <label for="run_user">{{.i18n.Tr "install.run_user"}}</label>
  83. <input id="run_user" name="run_user" value="{{.run_user}}" required>
  84. <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span>
  85. </div>
  86. <div class="inline required field">
  87. <label for="domain">{{.i18n.Tr "install.domain"}}</label>
  88. <input id="domain" name="domain" value="{{.domain}}" required>
  89. <span class="help">{{.i18n.Tr "install.domain_helper"}}</span>
  90. </div>
  91. <div class="inline required field">
  92. <label for="http_port">{{.i18n.Tr "install.http_port"}}</label>
  93. <input id="http_port" name="http_port" value="{{.http_port}}" required>
  94. <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span>
  95. </div>
  96. <div class="inline required field">
  97. <label for="app_url">{{.i18n.Tr "install.app_url"}}</label>
  98. <input id="app_url" name="app_url" value="{{.app_url}}" required>
  99. <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
  100. </div>
  101. <!-- Optional Settings -->
  102. <h4 class="ui dividing header">{{.i18n.Tr "install.optional_title"}}</h4>
  103. <div class="ui accordion optional field">
  104. <div class="title {{if .Err_SMTP}}text-error{{end}}">
  105. <i class="icon dropdown"></i>
  106. {{.i18n.Tr "install.email_title"}}
  107. </div>
  108. <div class="content">
  109. <div class="inline field">
  110. <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label>
  111. <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
  112. </div>
  113. <div class="inline field {{if .Err_SMTPFrom}}error{{end}}">
  114. <label for="smtp_from">{{.i18n.Tr "install.smtp_from"}}</label>
  115. <input id="smtp_from" name="smtp_from" value="{{.smtp_from}}">
  116. <span class="help">{{.i18n.Tr "install.smtp_from_helper"}}</span>
  117. </div>
  118. <div class="inline field {{if .Err_SMTPEmail}}error{{end}}">
  119. <label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label>
  120. <input id="smtp_user" name="smtp_user" value="{{.smtp_user}}">
  121. </div>
  122. <div class="inline field">
  123. <label for="smtp_passwd">{{.i18n.Tr "install.mailer_password"}}</label>
  124. <input id="smtp_passwd" name="smtp_passwd" type="password" value="{{.smtp_passwd}}">
  125. </div>
  126. <div class="inline field">
  127. <div class="ui checkbox">
  128. <label><strong>{{.i18n.Tr "install.register_confirm"}}</strong></label>
  129. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  130. </div>
  131. </div>
  132. <div class="inline field">
  133. <div class="ui checkbox">
  134. <label><strong>{{.i18n.Tr "install.mail_notify"}}</strong></label>
  135. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. <div class="ui accordion optional field">
  141. <div class="title">
  142. <i class="icon dropdown"></i>
  143. {{.i18n.Tr "install.server_service_title"}}
  144. </div>
  145. <div class="content">
  146. <div class="inline field">
  147. <div class="ui checkbox">
  148. <label class="poping up" data-content="{{.i18n.Tr "install.offline_mode_popup"}}"><strong>{{.i18n.Tr "install.offline_mode"}}</strong></label>
  149. <input name="offline_mode" type="checkbox" {{if .offline_mode}}checked{{end}}>
  150. </div>
  151. </div>
  152. <div class="inline field">
  153. <div class="ui checkbox">
  154. <label class="poping up" data-content="{{.i18n.Tr "install.disable_registration_popup"}}"><strong>{{.i18n.Tr "install.disable_registration"}}</strong></label>
  155. <input name="disable_registration" type="checkbox" {{if .disable_registration}}checked{{end}}>
  156. </div>
  157. </div>
  158. <div class="inline field">
  159. <div class="ui checkbox">
  160. <label class="poping up" data-content="{{.i18n.Tr "install.require_sign_in_view_popup"}}"><strong>{{.i18n.Tr "install.require_sign_in_view"}}</strong></label>
  161. <input name="require_sign_in_view" type="checkbox" {{if .require_sign_in_view}}checked{{end}}>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="ui accordion optional field">
  167. <div class="title {{if .Err_Admin}}text-error{{end}}">
  168. <i class="icon dropdown"></i>
  169. {{.i18n.Tr "install.admin_title"}}
  170. </div>
  171. <div class="content">
  172. <p class="center">{{.i18n.Tr "install.admin_setting_desc"}}</p>
  173. <div class="inline field {{if .Err_AdminName}}error{{end}}">
  174. <label for="admin_name">{{.i18n.Tr "install.admin_name"}}</label>
  175. <input id="admin_name" name="admin_name" value="{{.admin_name}}">
  176. </div>
  177. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  178. <label for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label>
  179. <input id="admin_passwd" name="admin_passwd" type="password" value="{{.admin_passwd}}">
  180. </div>
  181. <div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
  182. <label for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label>
  183. <input id="admin_confirm_passwd" name="admin_confirm_passwd" type="password" value="{{.admin_confirm_passwd}}">
  184. </div>
  185. <div class="inline field {{if .Err_AdminEmail}}error{{end}}">
  186. <label for="admin_email">{{.i18n.Tr "install.admin_email"}}</label>
  187. <input id="admin_email" name="admin_email" value="{{.admin_email}}">
  188. </div>
  189. </div>
  190. </div>
  191. <div class="ui divider"></div>
  192. <div class="inline field">
  193. <label></label>
  194. <button class="ui primary button">{{.i18n.Tr "install.install_gogs"}}</button>
  195. </div>
  196. </form>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. {{template "base/footer" .}}