UI: install - new version
This commit is contained in:
		
							parent
							
								
									5dd3dd71a0
								
							
						
					
					
						commit
						5cf3732339
					
				
					 17 changed files with 212 additions and 196 deletions
				
			
		|  | @ -60,6 +60,7 @@ db_helper = Please use INNODB engine with utf8_general_ci charset for MySQL. | ||||||
| ssl_mode = SSL Mode | ssl_mode = SSL Mode | ||||||
| path = Path | path = Path | ||||||
| sqlite_helper = The file path of SQLite3 database. | sqlite_helper = The file path of SQLite3 database. | ||||||
|  | err_empty_sqlite_path = SQLite3 database path cannot be empty. | ||||||
| 
 | 
 | ||||||
| general_title = Application General Settings | general_title = Application General Settings | ||||||
| repo_path = Repository Root Path | repo_path = Repository Root Path | ||||||
|  | @ -72,13 +73,16 @@ http_port = HTTP Port | ||||||
| http_port_helper = Port number which application will listen on. | http_port_helper = Port number which application will listen on. | ||||||
| app_url = Application URL | app_url = Application URL | ||||||
| app_url_helper = This affects HTTP/HTTPS clone URL and somewhere in e-mail. | app_url_helper = This affects HTTP/HTTPS clone URL and somewhere in e-mail. | ||||||
| email_title = E-mail Service Settings (Optional) | 
 | ||||||
|  | optional_title = Optional Settings | ||||||
|  | email_title = E-mail Service Settings | ||||||
| smtp_host = SMTP Host | smtp_host = SMTP Host | ||||||
| mailer_user = Sender E-mail | mailer_user = Sender E-mail | ||||||
| mailer_password = Sender Password | mailer_password = Sender Password | ||||||
| notify_title = Notification Settings (Optional) | notify_title = Notification Settings | ||||||
| register_confirm = Enable Register Confirmation | register_confirm = Enable Register Confirmation | ||||||
| mail_notify = Enable Mail Notification | mail_notify = Enable Mail Notification | ||||||
|  | admin_setting_desc = You do not have to create an admin account right now, user whoever ID=1 will gain admin access automatically. | ||||||
| admin_title = Admin Account Settings | admin_title = Admin Account Settings | ||||||
| admin_name = Username | admin_name = Username | ||||||
| admin_password = Password | admin_password = Password | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							|  | @ -17,7 +17,7 @@ import ( | ||||||
| 	"github.com/gogits/gogs/modules/setting" | 	"github.com/gogits/gogs/modules/setting" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| const APP_VER = "0.6.1.0707 Beta" | const APP_VER = "0.6.1.0708 Beta" | ||||||
| 
 | 
 | ||||||
| func init() { | func init() { | ||||||
| 	runtime.GOMAXPROCS(runtime.NumCPU()) | 	runtime.GOMAXPROCS(runtime.NumCPU()) | ||||||
|  |  | ||||||
|  | @ -208,7 +208,14 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro | ||||||
| 
 | 
 | ||||||
| 		if errs[0].FieldNames[0] == field.Name { | 		if errs[0].FieldNames[0] == field.Name { | ||||||
| 			data["Err_"+field.Name] = true | 			data["Err_"+field.Name] = true | ||||||
| 			trName := l.Tr("form." + field.Name) | 
 | ||||||
|  | 			trName := field.Tag.Get("locale") | ||||||
|  | 			if len(trName) == 0 { | ||||||
|  | 				trName = l.Tr("form." + field.Name) | ||||||
|  | 			} else { | ||||||
|  | 				trName = l.Tr(trName) | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
| 			switch errs[0].Classification { | 			switch errs[0].Classification { | ||||||
| 			case binding.ERR_REQUIRED: | 			case binding.ERR_REQUIRED: | ||||||
| 				data["ErrorMsg"] = trName + l.Tr("form.require_error") | 				data["ErrorMsg"] = trName + l.Tr("form.require_error") | ||||||
|  |  | ||||||
|  | @ -17,22 +17,22 @@ type InstallForm struct { | ||||||
| 	DbUser             string | 	DbUser             string | ||||||
| 	DbPasswd           string | 	DbPasswd           string | ||||||
| 	DbName             string | 	DbName             string | ||||||
| 	SSLMode            string | 	SSLMode            string `form:"ssl_mode"` | ||||||
| 	DbPath             string | 	DbPath             string | ||||||
| 	RepoRootPath       string `binding:"Required"` | 	RepoRootPath       string `binding:"Required"` | ||||||
| 	RunUser            string `binding:"Required"` | 	RunUser            string `binding:"Required"` | ||||||
| 	Domain             string `binding:"Required"` | 	Domain             string `binding:"Required"` | ||||||
| 	HTTPPort           string `binding:"Required"` | 	HTTPPort           string `form:"http_port" binding:"Required"` | ||||||
| 	AppUrl             string `binding:"Required"` | 	AppUrl             string `binding:"Required"` | ||||||
| 	SMTPHost           string | 	SMTPHost           string `form:"smtp_host"` | ||||||
| 	SMTPEmail          string | 	SMTPEmail          string `form:"smtp_user" binding:"OmitEmpty;Email;MaxSize(50)" locale:"install.mailer_user"` | ||||||
| 	SMTPPasswd         string | 	SMTPPasswd         string `form:"smtp_passwd"` | ||||||
| 	RegisterConfirm    string | 	RegisterConfirm    bool | ||||||
| 	MailNotify         string | 	MailNotify         bool | ||||||
| 	AdminName          string `binding:"Required;AlphaDashDot;MaxSize(30)"` | 	AdminName          string `binding:"OmitEmpty;AlphaDashDot;MaxSize(30)" locale:"install.admin_name"` | ||||||
| 	AdminPasswd        string `binding:"Required;MinSize(6);MaxSize(255)"` | 	AdminPasswd        string `binding:"OmitEmpty;MinSize(6);MaxSize(255)" locale:"install.admin_password"` | ||||||
| 	AdminConfirmPasswd string `binding:"Required;MinSize(6);MaxSize(255)"` | 	AdminConfirmPasswd string | ||||||
| 	AdminEmail         string `binding:"Required;Email;MaxSize(50)"` | 	AdminEmail         string `binding:"OmitEmpty;Email;MaxSize(50)" locale:"install.admin_email"` | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (f *InstallForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { | func (f *InstallForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { | ||||||
|  |  | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -106,6 +106,12 @@ func (ctx *Context) HasError() bool { | ||||||
| 	return hasErr.(bool) | 	return hasErr.(bool) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // HasValue returns true if value of given name exists.
 | ||||||
|  | func (ctx *Context) HasValue(name string) bool { | ||||||
|  | 	_, ok := ctx.Data[name] | ||||||
|  | 	return ok | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // HTML calls Context.HTML and converts template name to string.
 | // HTML calls Context.HTML and converts template name to string.
 | ||||||
| func (ctx *Context) HTML(status int, name base.TplName) { | func (ctx *Context) HTML(status int, name base.TplName) { | ||||||
| 	ctx.Context.HTML(status, string(name)) | 	ctx.Context.HTML(status, string(name)) | ||||||
|  | @ -140,7 +146,7 @@ func (ctx *Context) Handle(status int, title string, err error) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (ctx *Context) HandleText(status int, title string) { | func (ctx *Context) HandleText(status int, title string) { | ||||||
| 	if (status / 100 == 4) || (status / 100 == 5) { | 	if (status/100 == 4) || (status/100 == 5) { | ||||||
| 		log.Error(4, "%s", title) | 		log.Error(4, "%s", title) | ||||||
| 	} | 	} | ||||||
| 	ctx.RenderData(status, []byte(title)) | 	ctx.RenderData(status, []byte(title)) | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								public/css/gogs.min.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								public/css/gogs.min.css
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -38,6 +38,8 @@ $(document).ready(function () { | ||||||
|     $('.slide.up.dropdown').dropdown({ |     $('.slide.up.dropdown').dropdown({ | ||||||
|         transition: 'slide up' |         transition: 'slide up' | ||||||
|     }); |     }); | ||||||
|  |     $('.ui.accordion').accordion(); | ||||||
|  |     $('.ui.checkbox').checkbox(); | ||||||
| 
 | 
 | ||||||
|     initInstall(); |     initInstall(); | ||||||
| }); | }); | ||||||
|  | @ -66,6 +66,13 @@ footer { | ||||||
| .hide { | .hide { | ||||||
| 	display: none; | 	display: none; | ||||||
| } | } | ||||||
|  | .center { | ||||||
|  | 	text-align: center; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .text-error { | ||||||
|  | 	color: #d95c5c !important; | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| .generate-img(16); | .generate-img(16); | ||||||
| .generate-img(@n, @i: 1) when (@i =< @n) { | .generate-img(@n, @i: 1) when (@i =< @n) { | ||||||
|  |  | ||||||
|  | @ -17,6 +17,17 @@ | ||||||
| 			.help { | 			.help { | ||||||
| 				margin-left: 41%; | 				margin-left: 41%; | ||||||
| 			} | 			} | ||||||
|  | 			&.optional .title { | ||||||
|  | 				margin-left: 38%; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	.ui { | ||||||
|  | 		.checkbox { | ||||||
|  | 			margin-left: 40% !important; | ||||||
|  | 			label { | ||||||
|  | 				width: auto !important; | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | @ -126,6 +126,15 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { | ||||||
| 	ctx.Data["CurDbOption"] = form.DbType | 	ctx.Data["CurDbOption"] = form.DbType | ||||||
| 
 | 
 | ||||||
| 	if ctx.HasError() { | 	if ctx.HasError() { | ||||||
|  | 		if ctx.HasValue("Err_SMTPEmail") { | ||||||
|  | 			ctx.Data["Err_SMTP"] = true | ||||||
|  | 		} | ||||||
|  | 		if ctx.HasValue("Err_AdminName") || | ||||||
|  | 			ctx.HasValue("Err_AdminPasswd") || | ||||||
|  | 			ctx.HasValue("Err_AdminEmail") { | ||||||
|  | 			ctx.Data["Err_Admin"] = true | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		ctx.HTML(200, INSTALL) | 		ctx.HTML(200, INSTALL) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  | @ -146,12 +155,20 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { | ||||||
| 	models.DbCfg.SSLMode = form.SSLMode | 	models.DbCfg.SSLMode = form.SSLMode | ||||||
| 	models.DbCfg.Path = form.DbPath | 	models.DbCfg.Path = form.DbPath | ||||||
| 
 | 
 | ||||||
|  | 	if models.DbCfg.Type == "sqlite3" && len(models.DbCfg.Path) == 0 { | ||||||
|  | 		ctx.Data["Err_DbPath"] = true | ||||||
|  | 		ctx.RenderWithErr(ctx.Tr("install.err_empty_sqlite_path"), INSTALL, &form) | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	// Set test engine.
 | 	// Set test engine.
 | ||||||
| 	var x *xorm.Engine | 	var x *xorm.Engine | ||||||
| 	if err := models.NewTestEngine(x); err != nil { | 	if err := models.NewTestEngine(x); err != nil { | ||||||
| 		if strings.Contains(err.Error(), `Unknown database type: sqlite3`) { | 		if strings.Contains(err.Error(), `Unknown database type: sqlite3`) { | ||||||
|  | 			ctx.Data["Err_DbType"] = true | ||||||
| 			ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "http://gogs.io/docs/installation/install_from_binary.html"), INSTALL, &form) | 			ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "http://gogs.io/docs/installation/install_from_binary.html"), INSTALL, &form) | ||||||
| 		} else { | 		} else { | ||||||
|  | 			ctx.Data["Err_DbSetting"] = true | ||||||
| 			ctx.RenderWithErr(ctx.Tr("install.invalid_db_setting", err), INSTALL, &form) | 			ctx.RenderWithErr(ctx.Tr("install.invalid_db_setting", err), INSTALL, &form) | ||||||
| 		} | 		} | ||||||
| 		return | 		return | ||||||
|  | @ -214,8 +231,8 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { | ||||||
| 		cfg.Section("mailer").Key("USER").SetValue(form.SMTPEmail) | 		cfg.Section("mailer").Key("USER").SetValue(form.SMTPEmail) | ||||||
| 		cfg.Section("mailer").Key("PASSWD").SetValue(form.SMTPPasswd) | 		cfg.Section("mailer").Key("PASSWD").SetValue(form.SMTPPasswd) | ||||||
| 
 | 
 | ||||||
| 		cfg.Section("service").Key("REGISTER_EMAIL_CONFIRM").SetValue(com.ToStr(form.RegisterConfirm == "on")) | 		cfg.Section("service").Key("REGISTER_EMAIL_CONFIRM").SetValue(com.ToStr(form.RegisterConfirm)) | ||||||
| 		cfg.Section("service").Key("ENABLE_NOTIFY_MAIL").SetValue(com.ToStr(form.MailNotify == "on")) | 		cfg.Section("service").Key("ENABLE_NOTIFY_MAIL").SetValue(com.ToStr(form.MailNotify)) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	cfg.Section("").Key("RUN_MODE").SetValue("prod") | 	cfg.Section("").Key("RUN_MODE").SetValue("prod") | ||||||
|  | @ -237,16 +254,23 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { | ||||||
| 	GlobalInit() | 	GlobalInit() | ||||||
| 
 | 
 | ||||||
| 	// Create admin account.
 | 	// Create admin account.
 | ||||||
| 	if err := models.CreateUser(&models.User{Name: form.AdminName, Email: form.AdminEmail, Passwd: form.AdminPasswd, | 	if len(form.AdminName) > 0 { | ||||||
| 		IsAdmin: true, IsActive: true}); err != nil { | 		if err := models.CreateUser(&models.User{ | ||||||
| 		if !models.IsErrUserAlreadyExist(err) { | 			Name:     form.AdminName, | ||||||
| 			setting.InstallLock = false | 			Email:    form.AdminEmail, | ||||||
| 			ctx.Data["Err_AdminName"] = true | 			Passwd:   form.AdminPasswd, | ||||||
| 			ctx.Data["Err_AdminEmail"] = true | 			IsAdmin:  true, | ||||||
| 			ctx.RenderWithErr(ctx.Tr("install.invalid_admin_setting", err), INSTALL, &form) | 			IsActive: true, | ||||||
| 			return | 		}); err != nil { | ||||||
|  | 			if !models.IsErrUserAlreadyExist(err) { | ||||||
|  | 				setting.InstallLock = false | ||||||
|  | 				ctx.Data["Err_AdminName"] = true | ||||||
|  | 				ctx.Data["Err_AdminEmail"] = true | ||||||
|  | 				ctx.RenderWithErr(ctx.Tr("install.invalid_admin_setting", err), INSTALL, &form) | ||||||
|  | 				return | ||||||
|  | 			} | ||||||
|  | 			log.Info("Admin account already exist") | ||||||
| 		} | 		} | ||||||
| 		log.Info("Admin account already exist") |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	log.Info("First-time run install finished!") | 	log.Info("First-time run install finished!") | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| 0.6.1.0707 Beta | 0.6.1.0708 Beta | ||||||
|  | @ -1,2 +1,5 @@ | ||||||
| {{if .Flash.ErrorMsg}}<div class="alert alert-danger form-error">{{.Flash.ErrorMsg}}</div>{{end}} | {{if .Flash.ErrorMsg}} | ||||||
| {{if .Flash.SuccessMsg}}<div class="alert alert-success">{{.Flash.SuccessMsg}}</div>{{end}} | <div class="ui negative message"> | ||||||
|  |   <p>{{.Flash.ErrorMsg}}</p> | ||||||
|  | </div> | ||||||
|  | {{end}} | ||||||
							
								
								
									
										2
									
								
								templates/base/alert_old.tmpl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								templates/base/alert_old.tmpl
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,2 @@ | ||||||
|  | {{if .Flash.ErrorMsg}}<div class="alert alert-danger form-error">{{.Flash.ErrorMsg}}</div>{{end}} | ||||||
|  | {{if .Flash.SuccessMsg}}<div class="alert alert-success">{{.Flash.SuccessMsg}}</div>{{end}} | ||||||
|  | @ -2,17 +2,21 @@ | ||||||
| <div class="install"> | <div class="install"> | ||||||
| 	<div class="ui middle very relaxed page grid"> | 	<div class="ui middle very relaxed page grid"> | ||||||
| 		<div class="sixteen wide center aligned centered column"> | 		<div class="sixteen wide center aligned centered column"> | ||||||
|  |        | ||||||
|  | 
 | ||||||
| 			<h3 class="ui top attached header"> | 			<h3 class="ui top attached header"> | ||||||
| 			  {{.i18n.Tr "install.title"}} | 			  {{.i18n.Tr "install.title"}} | ||||||
| 			</h3> | 			</h3> | ||||||
| 			<div class="ui attached segment"> | 			<div class="ui attached segment"> | ||||||
|  |         {{template "base/alert" .}} | ||||||
|  |          | ||||||
| 			  <form class="ui form" action="{{AppSubUrl}}/install" method="post"> | 			  <form class="ui form" action="{{AppSubUrl}}/install" method="post"> | ||||||
| 			  	{{.CsrfTokenHtml}} | 			  	{{.CsrfTokenHtml}} | ||||||
| 
 | 
 | ||||||
| 			  	<!-- Dtabase Settings --> | 			  	<!-- Dtabase Settings --> | ||||||
| 			  	<h4 class="ui dividing header">{{.i18n.Tr "install.db_title"}}</h4> | 			  	<h4 class="ui dividing header">{{.i18n.Tr "install.db_title"}}</h4> | ||||||
| 			  	<p>{{.i18n.Tr "install.requite_db_desc"}}</p> | 			  	<p>{{.i18n.Tr "install.requite_db_desc"}}</p> | ||||||
| 			  	<div class="inline required field"> | 			  	<div class="inline required field {{if .Err_DbType}}error{{end}}"> | ||||||
| 	  	      <label>{{.i18n.Tr "install.db_type"}}</label> | 	  	      <label>{{.i18n.Tr "install.db_type"}}</label> | ||||||
| 			      <div class="ui selection database type dropdown"> | 			      <div class="ui selection database type dropdown"> | ||||||
| 			        <input type="hidden" id="db_type" name="db_type" value="{{.CurDbOption}}"> | 			        <input type="hidden" id="db_type" name="db_type" value="{{.CurDbOption}}"> | ||||||
|  | @ -27,19 +31,19 @@ | ||||||
| 	  	    </div> | 	  	    </div> | ||||||
| 
 | 
 | ||||||
|           <div id="sql_settings" class="{{if eq .CurDbOption "SQLite3"}}hide{{end}}"> |           <div id="sql_settings" class="{{if eq .CurDbOption "SQLite3"}}hide{{end}}"> | ||||||
|             <div class="inline required field"> |             <div class="inline required field {{if .Err_DbSetting}}error{{end}}"> | ||||||
|               <label for="db_host">{{.i18n.Tr "install.host"}}</label> |               <label for="db_host">{{.i18n.Tr "install.host"}}</label> | ||||||
|               <input id="db_host" name="db_host" value="{{.db_host}}"> |               <input id="db_host" name="db_host" value="{{.db_host}}"> | ||||||
|             </div> |             </div> | ||||||
|             <div class="inline required field"> |             <div class="inline required field {{if .Err_DbSetting}}error{{end}}"> | ||||||
|               <label for="db_user">{{.i18n.Tr "install.user"}}</label> |               <label for="db_user">{{.i18n.Tr "install.user"}}</label> | ||||||
|               <input id="db_user" name="db_user" value="{{.db_user}}"> |               <input id="db_user" name="db_user" value="{{.db_user}}"> | ||||||
|             </div> |             </div> | ||||||
|             <div class="inline required field"> |             <div class="inline required field {{if .Err_DbSetting}}error{{end}}"> | ||||||
|               <label for="db_passwd">{{.i18n.Tr "install.password"}}</label> |               <label for="db_passwd">{{.i18n.Tr "install.password"}}</label> | ||||||
|               <input id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}"> |               <input id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}"> | ||||||
|             </div> |             </div> | ||||||
|             <div class="inline required field"> |             <div class="inline required field {{if .Err_DbSetting}}error{{end}}"> | ||||||
|               <label for="db_name">{{.i18n.Tr "install.db_name"}}</label> |               <label for="db_name">{{.i18n.Tr "install.db_name"}}</label> | ||||||
|               <input id="db_name" name="db_name" value="{{.db_name}}"> |               <input id="db_name" name="db_name" value="{{.db_name}}"> | ||||||
|               <span class="help">{{.i18n.Tr "install.db_helper"}}</span> |               <span class="help">{{.i18n.Tr "install.db_helper"}}</span> | ||||||
|  | @ -50,7 +54,7 @@ | ||||||
|             <div class="inline required field"> |             <div class="inline required field"> | ||||||
|               <label>{{.i18n.Tr "install.ssl_mode"}}</label> |               <label>{{.i18n.Tr "install.ssl_mode"}}</label> | ||||||
|               <div class="ui selection database type dropdown"> |               <div class="ui selection database type dropdown"> | ||||||
|                 <input type="hidden" name="ssl_mode" value="disable"> |                 <input type="hidden" name="ssl_mode" value="{{if .ssl_mode}}{{.ssl_mode}}{{else}}disable{{end}}"> | ||||||
|                 <div class="default text">disable</div> |                 <div class="default text">disable</div> | ||||||
|                 <i class="dropdown icon"></i> |                 <i class="dropdown icon"></i> | ||||||
|                 <div class="menu"> |                 <div class="menu"> | ||||||
|  | @ -63,7 +67,7 @@ | ||||||
|           </div> |           </div> | ||||||
| 
 | 
 | ||||||
|           <div id="sqlite_settings" class="{{if not (eq .CurDbOption "SQLite3")}}hide{{end}}"> |           <div id="sqlite_settings" class="{{if not (eq .CurDbOption "SQLite3")}}hide{{end}}"> | ||||||
|             <div class="inline required field"> |             <div class="inline required field {{if .Err_DbPath}}error{{end}}"> | ||||||
|               <label for="db_path">{{.i18n.Tr "install.path"}}</label> |               <label for="db_path">{{.i18n.Tr "install.path"}}</label> | ||||||
|               <input id="db_path" name="db_path" value="{{.db_path}}"> |               <input id="db_path" name="db_path" value="{{.db_path}}"> | ||||||
|               <span class="help">{{.i18n.Tr "install.sqlite_helper"}}</span> |               <span class="help">{{.i18n.Tr "install.sqlite_helper"}}</span> | ||||||
|  | @ -72,6 +76,107 @@ | ||||||
| 
 | 
 | ||||||
| 					<!-- General Settings --> | 					<!-- General Settings --> | ||||||
| 					<h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4> | 					<h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4> | ||||||
|  |           <div class="inline required field {{if .Err_RepoRootPath}}error{{end}}"> | ||||||
|  |             <label for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label> | ||||||
|  |             <input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required> | ||||||
|  |             <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span> | ||||||
|  |           </div> | ||||||
|  |           <div class="inline required field {{if .Err_RunUser}}error{{end}}"> | ||||||
|  |             <label for="run_user">{{.i18n.Tr "install.run_user"}}</label> | ||||||
|  |             <input id="run_user" name="run_user" value="{{.run_user}}" required> | ||||||
|  |             <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span> | ||||||
|  |           </div> | ||||||
|  |           <div class="inline required field"> | ||||||
|  |             <label for="domain">{{.i18n.Tr "install.domain"}}</label> | ||||||
|  |             <input id="domain" name="domain" value="{{.domain}}" required> | ||||||
|  |             <span class="help">{{.i18n.Tr "install.domain_helper"}}</span> | ||||||
|  |           </div> | ||||||
|  |           <div class="inline required field"> | ||||||
|  |             <label for="http_port">{{.i18n.Tr "install.http_port"}}</label> | ||||||
|  |             <input id="http_port" name="http_port" value="{{.http_port}}" required> | ||||||
|  |             <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span> | ||||||
|  |           </div> | ||||||
|  |           <div class="inline required field"> | ||||||
|  |             <label for="app_url">{{.i18n.Tr "install.app_url"}}</label> | ||||||
|  |             <input id="app_url" name="app_url" value="{{.app_url}}" required> | ||||||
|  |             <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span> | ||||||
|  |           </div> | ||||||
|  | 
 | ||||||
|  |           <!-- Optional Settings --> | ||||||
|  |           <h4 class="ui dividing header">{{.i18n.Tr "install.optional_title"}}</h4> | ||||||
|  |           <div class="ui accordion optional field"> | ||||||
|  |             <div class="title {{if .Err_SMTP}}text-error{{end}}"> | ||||||
|  |               <i class="icon dropdown"></i> | ||||||
|  |               {{.i18n.Tr "install.email_title"}} | ||||||
|  |             </div> | ||||||
|  |             <div class="content"> | ||||||
|  |               <div class="inline field"> | ||||||
|  |                 <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label> | ||||||
|  |                 <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}"> | ||||||
|  |               </div> | ||||||
|  |               <div class="inline field {{if .Err_SMTPEmail}}error{{end}}"> | ||||||
|  |                 <label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label> | ||||||
|  |                 <input id="smtp_user" name="smtp_user" value="{{.smtp_user}}"> | ||||||
|  |               </div> | ||||||
|  |               <div class="inline field"> | ||||||
|  |                 <label for="smtp_passwd">{{.i18n.Tr "install.mailer_password"}}</label> | ||||||
|  |                 <input id="smtp_passwd" name="smtp_passwd" type="password" value="{{.smtp_passwd}}"> | ||||||
|  |               </div> | ||||||
|  |             </div> | ||||||
|  |           </div> | ||||||
|  | 
 | ||||||
|  |           <div class="ui accordion optional field"> | ||||||
|  |             <div class="title"> | ||||||
|  |               <i class="icon dropdown"></i> | ||||||
|  |               {{.i18n.Tr "install.notify_title"}} | ||||||
|  |             </div> | ||||||
|  |             <div class="content"> | ||||||
|  |               <div class="inline field"> | ||||||
|  |                 <div class="ui checkbox"> | ||||||
|  |                   <label><strong>{{.i18n.Tr "install.register_confirm"}}</strong></label> | ||||||
|  |                   <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}> | ||||||
|  |                 </div> | ||||||
|  |               </div> | ||||||
|  |               <div class="inline field"> | ||||||
|  |                 <div class="ui checkbox"> | ||||||
|  |                   <label><strong>{{.i18n.Tr "install.mail_notify"}}</strong></label> | ||||||
|  |                   <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}> | ||||||
|  |                 </div> | ||||||
|  |               </div> | ||||||
|  |             </div> | ||||||
|  |           </div> | ||||||
|  | 
 | ||||||
|  |           <div class="ui accordion optional field"> | ||||||
|  |             <div class="title {{if .Err_Admin}}text-error{{end}}"> | ||||||
|  |               <i class="icon dropdown"></i> | ||||||
|  |               {{.i18n.Tr "install.admin_title"}} | ||||||
|  |             </div> | ||||||
|  |             <div class="content"> | ||||||
|  |               <p class="center">{{.i18n.Tr "install.admin_setting_desc"}}</p> | ||||||
|  |               <div class="inline field {{if .Err_AdminName}}error{{end}}"> | ||||||
|  |                 <label for="admin_name">{{.i18n.Tr "install.admin_name"}}</label> | ||||||
|  |                 <input id="admin_name" name="admin_name" value="{{.admin_name}}"> | ||||||
|  |               </div> | ||||||
|  |               <div class="inline field {{if .Err_AdminPasswd}}error{{end}}"> | ||||||
|  |                 <label for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label> | ||||||
|  |                 <input id="admin_passwd" name="admin_passwd" value="{{.admin_passwd}}"> | ||||||
|  |               </div> | ||||||
|  |               <div class="inline field {{if .Err_AdminPasswd}}error{{end}}"> | ||||||
|  |                 <label for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label> | ||||||
|  |                 <input id="admin_confirm_passwd" name="admin_confirm_passwd" type="password" value="{{.admin_confirm_passwd}}"> | ||||||
|  |               </div> | ||||||
|  |               <div class="inline field {{if .Err_AdminEmail}}error{{end}}"> | ||||||
|  |                 <label for="admin_email">{{.i18n.Tr "install.admin_email"}}</label> | ||||||
|  |                 <input id="admin_email" name="admin_email" value="{{.admin_email}}"> | ||||||
|  |               </div> | ||||||
|  |             </div> | ||||||
|  |           </div> | ||||||
|  | 
 | ||||||
|  |           <div class="ui divider"></div> | ||||||
|  |           <div class="inline field"> | ||||||
|  |             <label></label> | ||||||
|  |             <button class="ui primary button">{{.i18n.Tr "install.install_gogs"}}</button> | ||||||
|  |           </div> | ||||||
| 			  </form> | 			  </form> | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
|  |  | ||||||
|  | @ -1,155 +0,0 @@ | ||||||
| {{template "ng/base/head" .}} |  | ||||||
| <div id="setting-wrapper" class="main-wrapper"> |  | ||||||
|     <div class="container clear"> |  | ||||||
|         <div class="setting-content"> |  | ||||||
|             {{template "ng/base/alert" .}} |  | ||||||
|             <div id="setting-content"> |  | ||||||
|                 <div class="panel panel-radius"> |  | ||||||
|                     <div class="panel-header"> |  | ||||||
|                         <strong>{{.i18n.Tr "install.title"}}</strong> |  | ||||||
|                     </div> |  | ||||||
|                     <form class="form form-align panel-body" id="install-form" action="{{AppSubUrl}}/install" method="post"> |  | ||||||
|                         {{.CsrfTokenHtml}} |  | ||||||
|                         <div class="text-center panel-desc">{{.i18n.Tr "install.requite_db_desc"}}</div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req">{{.i18n.Tr "install.db_type"}}</label> |  | ||||||
|                             <select name="db_type" id="install-database" class="form-control"> |  | ||||||
|                                 {{range .DbOptions}} |  | ||||||
|                                 <option value="{{.}}"{{if eq $.CurDbOption .}}selected{{end}}>{{.}}</option> |  | ||||||
|                                 {{end}} |  | ||||||
|                             </select> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <div class="server-sql {{if eq .CurDbOption "SQLite3"}}hide{{end}}"> |  | ||||||
|                             <div class="field"> |  | ||||||
|                                 <label class="req" for="db_host">{{.i18n.Tr "install.host"}}</label> |  | ||||||
|                                 <input class="ipt ipt-large ipt-radius {{if .Err_DbHost}}ipt-error{{end}}" id="db_host" name="db_host" value="{{.db_host}}" /> |  | ||||||
|                             </div> |  | ||||||
|                             <div class="field"> |  | ||||||
|                                 <label class="req" for="db_user">{{.i18n.Tr "install.user"}}</label> |  | ||||||
|                                 <input class="ipt ipt-large ipt-radius {{if .Err_DbUser}}ipt-error{{end}}" id="db_user" name="db_user" value="{{.db_user}}" /> |  | ||||||
|                             </div> |  | ||||||
|                             <div class="field"> |  | ||||||
|                                 <label class="req" for="db_passwd">{{.i18n.Tr "install.password"}}</label> |  | ||||||
|                                 <input class="ipt ipt-large ipt-radius {{if .Err_DbPasswd}}ipt-error{{end}}" id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}" /> |  | ||||||
|                             </div> |  | ||||||
|                             <div class="field"> |  | ||||||
|                                 <label class="req" for="db_name">{{.i18n.Tr "install.db_name"}}</label> |  | ||||||
|                                 <input class="ipt ipt-large ipt-radius {{if .Err_DbName}}ipt-error{{end}}" id="db_name" name="db_name" value="{{.db_name}}" /> |  | ||||||
|                                 <label></label> |  | ||||||
|                                 <span class="help">{{.i18n.Tr "install.db_helper"}}</span> |  | ||||||
|                             </div> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <div class="field pgsql-setting {{if not (eq .CurDbOption "PostgreSQL")}}hide{{end}}"> |  | ||||||
|                             <label class="req">{{.i18n.Tr "install.ssl_mode"}}</label> |  | ||||||
|                             <select name="ssl_mode" class="form-control"> |  | ||||||
|                                 <option value="disable">Disable</option> |  | ||||||
|                                 <option value="require">Require</option> |  | ||||||
|                                 <option value="verify-full">Verify Full</option> |  | ||||||
|                             </select> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <div class="field sqlite-setting {{if not (eq .CurDbOption "SQLite3")}}hide{{end}}"> |  | ||||||
|                             <label class="req" for="db_path">{{.i18n.Tr "install.path"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_DbPath}}ipt-error{{end}}" id="db_path" name="db_path" value="{{.db_path}}" /> |  | ||||||
|                             <label></label> |  | ||||||
|                             <span class="help">{{.i18n.Tr "install.sqlite_helper"}}</span> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <hr> |  | ||||||
| 
 |  | ||||||
|                         <div class="text-center panel-desc">{{.i18n.Tr "install.general_title"}}</div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label> |  | ||||||
|                             <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 /> |  | ||||||
|                             <label></label> |  | ||||||
|                             <span class="help">{{.i18n.Tr "install.repo_path_helper"}}</span> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="run_user">{{.i18n.Tr "install.run_user"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_RunUser}}ipt-error{{end}}" id="run_user" name="run_user" value="{{.run_user}}" required /> |  | ||||||
|                             <label></label> |  | ||||||
|                             <span class="help">{{.i18n.Tr "install.run_user_helper"}}</span> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="domain">{{.i18n.Tr "install.domain"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_Domain}}ipt-error{{end}}" id="domain" name="domain" value="{{.domain}}" required /> |  | ||||||
|                             <label></label> |  | ||||||
|                             <span class="help">{{.i18n.Tr "install.domain_helper"}}</span> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="http_port">{{.i18n.Tr "install.http_port"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_HttpPort}}ipt-error{{end}}" id="http_port" name="http_port" value="{{.http_port}}" required /> |  | ||||||
|                             <label></label> |  | ||||||
|                             <span class="help">{{.i18n.Tr "install.http_port_helper"}}</span> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="app_url">{{.i18n.Tr "install.app_url"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_AppUrl}}ipt-error{{end}}" id="app_url" name="app_url" value="{{.app_url}}" required /> |  | ||||||
|                             <label></label> |  | ||||||
|                             <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <hr> |  | ||||||
| 
 |  | ||||||
|                         <div class="text-center panel-desc">{{.i18n.Tr "install.email_title"}}</div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label for="smtp_host">{{.i18n.Tr "install.smtp_host"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtp_host" name="smtp_host" value="{{.smtp_host}}" /> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_SMTPEmail}}ipt-error{{end}}" id="smtp_user" name="smtp_user" value="{{.smtp_user}}" /> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label for="smtp_pwd">{{.i18n.Tr "install.mailer_password"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_SMTPPasswd}}ipt-error{{end}}" id="smtp_pwd" name="smtp_pwd" type="password" value="{{.smtp_pwd}}" /> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <hr> |  | ||||||
| 
 |  | ||||||
|                         <div class="text-center panel-desc">{{.i18n.Tr "install.notify_title"}}</div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label></label> |  | ||||||
|                             <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}> |  | ||||||
|                             <strong>{{.i18n.Tr "install.register_confirm"}}</strong> |  | ||||||
|                             <br> |  | ||||||
|                             <label></label> |  | ||||||
|                             <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}> |  | ||||||
|                             <strong>{{.i18n.Tr "install.mail_notify"}}</strong> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <hr> |  | ||||||
| 
 |  | ||||||
|                         <div class="text-center panel-desc">{{.i18n.Tr "install.admin_title"}}</div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="admin_name">{{.i18n.Tr "install.admin_name"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_AdminName}}ipt-error{{end}}" id="admin_name" name="admin_name" value="{{.admin_name}}" required /> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="admin_passwd">{{.i18n.Tr "install.admin_password"}}</label> |  | ||||||
|                             <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 /> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="admin_confirm_passwd">{{.i18n.Tr "install.confirm_password"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_AdminPasswd}}ipt-error{{end}}" id="admin_confirm_passwd" name="admin_confirm_passwd" type="password" required /> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label class="req" for="admin_email">{{.i18n.Tr "install.admin_email"}}</label> |  | ||||||
|                             <input class="ipt ipt-large ipt-radius {{if .Err_AdminEmail}}ipt-error{{end}}" id="admin_email" name="admin_email" value="{{.admin_email}}" required /> |  | ||||||
|                         </div> |  | ||||||
| 
 |  | ||||||
|                         <hr> |  | ||||||
| 
 |  | ||||||
|                         <div class="field"> |  | ||||||
|                             <label></label> |  | ||||||
|                             <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "install.install_gogs"}}</button> |  | ||||||
|                         </div> |  | ||||||
|                     </form> |  | ||||||
|                 </div> |  | ||||||
|             </div> |  | ||||||
|         </div> |  | ||||||
|     </div> |  | ||||||
| </div> |  | ||||||
| {{template "ng/base/footer" .}} |  | ||||||
|  | @ -7,7 +7,7 @@ | ||||||
|         <div class="col-md-3 filters"> |         <div class="col-md-3 filters"> | ||||||
|             <div class="filter-list"> |             <div class="filter-list"> | ||||||
|                 <ul class="list-unstyled"> |                 <ul class="list-unstyled"> | ||||||
|                     <li><a href="{{.RepoLink}}/issues?state={{.State}}"{{if eq .ViewType "all"}} class="active"{{end}}>All Issues <strong class="pull-right">{{..IssueStats.AllCount}}</strong></a></li> |                     <li><a href="{{.RepoLink}}/issues?state={{.State}}"{{if eq .ViewType "all"}} class="active"{{end}}>All Issues <strong class="pull-right">{{.IssueStats.AllCount}}</strong></a></li> | ||||||
|                     <li><a href="{{.RepoLink}}/issues?type=assigned&state={{.State}}"{{if eq .ViewType "assigned"}} class="active"{{end}}>Assigned to you <strong class="pull-right">{{.IssueStats.AssignCount}}</strong></a></li> |                     <li><a href="{{.RepoLink}}/issues?type=assigned&state={{.State}}"{{if eq .ViewType "assigned"}} class="active"{{end}}>Assigned to you <strong class="pull-right">{{.IssueStats.AssignCount}}</strong></a></li> | ||||||
|                     <li><a href="{{.RepoLink}}/issues?type=created_by&state={{.State}}"{{if eq .ViewType "created_by"}} class="active"{{end}}>Created by you <strong class="pull-right">{{.IssueStats.CreateCount}}</strong></a></li> |                     <li><a href="{{.RepoLink}}/issues?type=created_by&state={{.State}}"{{if eq .ViewType "created_by"}} class="active"{{end}}>Created by you <strong class="pull-right">{{.IssueStats.CreateCount}}</strong></a></li> | ||||||
|                     <li><a href="{{.RepoLink}}/issues?type=mentioned&state={{.State}}"{{if eq .ViewType "mentioned"}} class="active"{{end}}>Mentioning you <strong class="pull-right">{{.IssueStats.MentionCount}}</strong></a></li> |                     <li><a href="{{.RepoLink}}/issues?type=mentioned&state={{.State}}"{{if eq .ViewType "mentioned"}} class="active"{{end}}>Mentioning you <strong class="pull-right">{{.IssueStats.MentionCount}}</strong></a></li> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue