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.

155 lines
10 KiB

10 years ago
10 years ago
  1. {{template "ng/base/head" .}}
  2. <div id="setting-wrapper" class="main-wrapper">
  3. <div class="container clear">
  4. <div class="setting-content">
  5. {{template "ng/base/alert" .}}
  6. <div id="setting-content">
  7. <div class="panel panel-radius">
  8. <div class="panel-header">
  9. <strong>{{.i18n.Tr "install.title"}}</strong>
  10. </div>
  11. <form class="form form-align panel-body" id="install-form" action="{{AppSubUrl}}/install" method="post">
  12. {{.CsrfTokenHtml}}
  13. <div class="text-center panel-desc">{{.i18n.Tr "install.requite_db_desc"}}</div>
  14. <div class="field">
  15. <label class="req">{{.i18n.Tr "install.db_type"}}</label>
  16. <select name="db_type" id="install-database" class="form-control">
  17. {{range .DbOptions}}
  18. <option value="{{.}}"{{if eq $.CurDbOption .}}selected{{end}}>{{.}}</option>
  19. {{end}}
  20. </select>
  21. </div>
  22. <div class="server-sql {{if eq .CurDbOption "SQLite3"}}hide{{end}}">
  23. <div class="field">
  24. <label class="req" for="db_host">{{.i18n.Tr "install.host"}}</label>
  25. <input class="ipt ipt-large ipt-radius {{if .Err_DbHost}}ipt-error{{end}}" id="db_host" name="db_host" value="{{.db_host}}" />
  26. </div>
  27. <div class="field">
  28. <label class="req" for="db_user">{{.i18n.Tr "install.user"}}</label>
  29. <input class="ipt ipt-large ipt-radius {{if .Err_DbUser}}ipt-error{{end}}" id="db_user" name="db_user" value="{{.db_user}}" />
  30. </div>
  31. <div class="field">
  32. <label class="req" for="db_passwd">{{.i18n.Tr "install.password"}}</label>
  33. <input class="ipt ipt-large ipt-radius {{if .Err_DbPasswd}}ipt-error{{end}}" id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}" />
  34. </div>
  35. <div class="field">
  36. <label class="req" for="db_name">{{.i18n.Tr "install.db_name"}}</label>
  37. <input class="ipt ipt-large ipt-radius {{if .Err_DbName}}ipt-error{{end}}" id="db_name" name="db_name" value="{{.db_name}}" />
  38. <label></label>
  39. <span class="help">{{.i18n.Tr "install.db_helper"}}</span>
  40. </div>
  41. </div>
  42. <div class="field pgsql-setting {{if not (eq .CurDbOption "PostgreSQL")}}hide{{end}}">
  43. <label class="req">{{.i18n.Tr "install.ssl_mode"}}</label>
  44. <select name="ssl_mode" class="form-control">
  45. <option value="disable">Disable</option>
  46. <option value="require">Require</option>
  47. <option value="verify-full">Verify Full</option>
  48. </select>
  49. </div>
  50. <div class="field sqlite-setting {{if not (eq .CurDbOption "SQLite3")}}hide{{end}}">
  51. <label class="req" for="db_path">{{.i18n.Tr "install.path"}}</label>
  52. <input class="ipt ipt-large ipt-radius {{if .Err_DbPath}}ipt-error{{end}}" id="db_path" name="db_path" value="{{.db_path}}" />
  53. <label></label>
  54. <span class="help">{{.i18n.Tr "install.sqlite_helper"}}</span>
  55. </div>
  56. <hr>
  57. <div class="text-center panel-desc">{{.i18n.Tr "install.general_title"}}</div>
  58. <div class="field">
  59. <label class="req" for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label>
  60. <input class="ipt ipt-large ipt-radius {{if .Err_RepoRootPath}}ipt-error{{end}}" id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required />
  61. <label></label>
  62. <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span>
  63. </div>
  64. <div class="field">
  65. <label class="req" for="run_user">{{.i18n.Tr "install.run_user"}}</label>
  66. <input class="ipt ipt-large ipt-radius {{if .Err_RunUser}}ipt-error{{end}}" id="run_user" name="run_user" value="{{.run_user}}" required />
  67. <label></label>
  68. <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span>
  69. </div>
  70. <div class="field">
  71. <label class="req" for="domain">{{.i18n.Tr "install.domain"}}</label>
  72. <input class="ipt ipt-large ipt-radius {{if .Err_Domain}}ipt-error{{end}}" id="domain" name="domain" value="{{.domain}}" required />
  73. <label></label>
  74. <span class="help">{{.i18n.Tr "install.domain_helper"}}</span>
  75. </div>
  76. <div class="field">
  77. <label class="req" for="http_port">{{.i18n.Tr "install.http_port"}}</label>
  78. <input class="ipt ipt-large ipt-radius {{if .Err_HttpPort}}ipt-error{{end}}" id="http_port" name="http_port" value="{{.http_port}}" required />
  79. <label></label>
  80. <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span>
  81. </div>
  82. <div class="field">
  83. <label class="req" for="app_url">{{.i18n.Tr "install.app_url"}}</label>
  84. <input class="ipt ipt-large ipt-radius {{if .Err_AppUrl}}ipt-error{{end}}" id="app_url" name="app_url" value="{{.app_url}}" required />
  85. <label></label>
  86. <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
  87. </div>
  88. <hr>
  89. <div class="text-center panel-desc">{{.i18n.Tr "install.email_title"}}</div>
  90. <div class="field">
  91. <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label>
  92. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtp_host" name="smtp_host" value="{{.smtp_host}}" />
  93. </div>
  94. <div class="field">
  95. <label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label>
  96. <input class="ipt ipt-large ipt-radius {{if .Err_SMTPEmail}}ipt-error{{end}}" id="smtp_user" name="smtp_user" value="{{.smtp_user}}" />
  97. </div>
  98. <div class="field">
  99. <label for="smtp_pwd">{{.i18n.Tr "install.mailer_password"}}</label>
  100. <input class="ipt ipt-large ipt-radius {{if .Err_SMTPPasswd}}ipt-error{{end}}" id="smtp_pwd" name="smtp_pwd" type="password" value="{{.smtp_pwd}}" />
  101. </div>
  102. <hr>
  103. <div class="text-center panel-desc">{{.i18n.Tr "install.notify_title"}}</div>
  104. <div class="field">
  105. <label></label>
  106. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  107. <strong>{{.i18n.Tr "install.register_confirm"}}</strong>
  108. <br>
  109. <label></label>
  110. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  111. <strong>{{.i18n.Tr "install.mail_notify"}}</strong>
  112. </div>
  113. <hr>
  114. <div class="text-center panel-desc">{{.i18n.Tr "install.admin_title"}}</div>
  115. <div class="field">
  116. <label class="req" for="admin_name">{{.i18n.Tr "install.admin_name"}}</label>
  117. <input class="ipt ipt-large ipt-radius {{if .Err_AdminName}}ipt-error{{end}}" id="admin_name" name="admin_name" value="{{.admin_name}}" required />
  118. </div>
  119. <div class="field">
  120. <label class="req" for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label>
  121. <input class="ipt ipt-large ipt-radius {{if .Err_AdminPasswd}}ipt-error{{end}}" id="admin_passwd" name="admin_passwd" type="password" value="{{.admin_passwd}}" required />
  122. </div>
  123. <div class="field">
  124. <label class="req" for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label>
  125. <input class="ipt ipt-large ipt-radius {{if .Err_AdminPasswd}}ipt-error{{end}}" id="admin_confirm_passwd" name="admin_confirm_passwd" type="password" required />
  126. </div>
  127. <div class="field">
  128. <label class="req" for="admin_email">{{.i18n.Tr "install.admin_email"}}</label>
  129. <input class="ipt ipt-large ipt-radius {{if .Err_AdminEmail}}ipt-error{{end}}" id="admin_email" name="admin_email" value="{{.admin_email}}" required />
  130. </div>
  131. <hr>
  132. <div class="field">
  133. <label></label>
  134. <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "install.install_gogs"}}</button>
  135. </div>
  136. </form>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. {{template "ng/base/footer" .}}