Manage slogan config in installation form

This commit is contained in:
mirko 2024-05-16 20:45:42 +02:00
parent 34bf246ffe
commit 6991dcc13d
4 changed files with 10 additions and 0 deletions

View File

@ -267,6 +267,8 @@ err_admin_name_is_invalid = Administrator Username is invalid
general_title = General settings
app_name = Instance title
app_name_helper = You can enter your company name here.
app_slogan = Instance slogan
app_slogan_helper = You can enter your slogan here. This field is optional
repo_path = Repository root path
repo_path_helper = Remote Git repositories will be saved to this directory.
lfs_path = Git LFS root path

View File

@ -116,6 +116,7 @@ func Install(ctx *context.Context) {
// Application general settings
form.AppName = setting.AppName
form.AppSlogan = setting.AppSlogan
form.RepoRootPath = setting.RepoRootPath
form.LFSRootPath = setting.LFS.Storage.Path
@ -383,6 +384,7 @@ func SubmitInstall(ctx *context.Context) {
}
cfg.Section("").Key("APP_NAME").SetValue(form.AppName)
cfg.Section("").Key("APP_SLOGAN").SetValue(form.AppSlogan)
cfg.Section("").Key("RUN_USER").SetValue(form.RunUser)
cfg.Section("").Key("WORK_PATH").SetValue(setting.AppWorkPath)
cfg.Section("").Key("RUN_MODE").SetValue("prod")

View File

@ -31,6 +31,7 @@ type InstallForm struct {
DbSchema string
AppName string `binding:"Required" locale:"install.app_name"`
AppSlogan string
RepoRootPath string `binding:"Required"`
LFSRootPath string
RunUser string `binding:"Required"`

View File

@ -107,6 +107,11 @@
<input id="app_name" name="app_name" value="{{.app_name}}" required>
<span class="help">{{ctx.Locale.Tr "install.app_name_helper"}}</span>
</div>
<div class="inline field">
<label for="app_slogan">{{ctx.Locale.Tr "install.app_slogan"}}</label>
<input id="app_slogan" name="app_slogan" value="{{.app_slogan}}">
<span class="help">{{ctx.Locale.Tr "install.app_slogan_helper"}}</span>
</div>
<div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
<label for="repo_root_path">{{ctx.Locale.Tr "install.repo_path"}}</label>
<input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>