install.tmpl 11 KB

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