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.

149 lines
9.7 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="database" 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="host">{{.i18n.Tr "install.host"}}</label>
  25. <input class="ipt ipt-large ipt-radius {{if .Err_DbHost}}ipt-error{{end}}" id="host" name="host" value="{{.host}}" />
  26. </div>
  27. <div class="field">
  28. <label class="req" for="user">{{.i18n.Tr "install.user"}}</label>
  29. <input class="ipt ipt-large ipt-radius {{if .Err_DbUser}}ipt-error{{end}}" id="user" name="user" value="{{.user}}" />
  30. </div>
  31. <div class="field">
  32. <label class="req" for="passwd">{{.i18n.Tr "install.password"}}</label>
  33. <input class="ipt ipt-large ipt-radius {{if .Err_DbPasswd}}ipt-error{{end}}" id="passwd" name="passwd" type="password" value="{{.passwd}}" />
  34. </div>
  35. <div class="field">
  36. <label class="req" for="database_name">{{.i18n.Tr "install.db_name"}}</label>
  37. <input class="ipt ipt-large ipt-radius {{if .Err_DatabaseName}}ipt-error{{end}}" id="database_name" name="database_name" value="{{.database_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="database_path">{{.i18n.Tr "install.path"}}</label>
  52. <input class="ipt ipt-large ipt-radius {{if .Err_DatabasePath}}ipt-error{{end}}" id="database_path" name="database_path" value="{{.database_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_path">{{.i18n.Tr "install.repo_path"}}</label>
  60. <input class="ipt ipt-large ipt-radius {{if .Err_RepoRootPath}}ipt-error{{end}}" id="repo_path" name="repo_path" value="{{.repo_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="app_url">{{.i18n.Tr "install.app_url"}}</label>
  78. <input class="ipt ipt-large ipt-radius {{if .Err_AppUrl}}ipt-error{{end}}" id="app_url" name="app_url" value="{{.app_url}}" required />
  79. <label></label>
  80. <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
  81. </div>
  82. <hr>
  83. <div class="text-center panel-desc">{{.i18n.Tr "install.email_title"}}</div>
  84. <div class="field">
  85. <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</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 for="mailer_user">{{.i18n.Tr "install.mailer_user"}}</label>
  90. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpEmail}}ipt-error{{end}}" id="mailer_user" name="mailer_user" value="{{.mailer_user}}" />
  91. </div>
  92. <div class="field">
  93. <label for="mailer_pwd">{{.i18n.Tr "install.mailer_password"}}</label>
  94. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPasswd}}ipt-error{{end}}" id="mailer_pwd" name="mailer_pwd" type="password" value="{{.mailer_pwd}}" />
  95. </div>
  96. <hr>
  97. <div class="text-center panel-desc">{{.i18n.Tr "install.notify_title"}}</div>
  98. <div class="field">
  99. <label></label>
  100. <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
  101. <strong>{{.i18n.Tr "install.register_confirm"}}</strong>
  102. <br>
  103. <label></label>
  104. <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
  105. <strong>{{.i18n.Tr "install.mail_notify"}}</strong>
  106. </div>
  107. <hr>
  108. <div class="text-center panel-desc">{{.i18n.Tr "install.admin_title"}}</div>
  109. <div class="field">
  110. <label class="req" for="admin_name">{{.i18n.Tr "install.admin_name"}}</label>
  111. <input class="ipt ipt-large ipt-radius {{if .Err_AdminName}}ipt-error{{end}}" id="admin_name" name="admin_name" value="{{.admin_name}}" required />
  112. </div>
  113. <div class="field">
  114. <label class="req" for="admin_pwd">{{.i18n.Tr "install.admin_password"}}</label>
  115. <input class="ipt ipt-large ipt-radius {{if .Err_AdminPasswd}}ipt-error{{end}}" id="admin_pwd" name="admin_pwd" type="password" value="{{.admin_pwd}}" required />
  116. </div>
  117. <div class="field">
  118. <label class="req" for="confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label>
  119. <input class="ipt ipt-large ipt-radius {{if .Err_AdminPasswd}}ipt-error{{end}}" id="confirm_passwd" name="confirm_passwd" type="password" required />
  120. </div>
  121. <div class="field">
  122. <label class="req" for="admin_email">{{.i18n.Tr "install.admin_email"}}</label>
  123. <input class="ipt ipt-large ipt-radius {{if .Err_AdminEmail}}ipt-error{{end}}" id="admin_email" name="admin_email" value="{{.admin_email}}" required />
  124. </div>
  125. <hr>
  126. <div class="field">
  127. <label></label>
  128. <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "install.install_gogs"}}</button>
  129. </div>
  130. </form>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. {{template "ng/base/footer" .}}