Ver código fonte

admin: fix template error

Also a try to display key-value pairs in table.
Unknwon 8 anos atrás
pai
commit
dd649eb4cc

+ 2 - 1
conf/locale/locale_en-US.ini

@@ -1181,7 +1181,8 @@ config.git_pull_timeout = Pull Operation Timeout
 config.git_gc_timeout = GC Operation Timeout
 
 config.log_config = Log Configuration
-config.log_mode = Log Mode
+config.log_mode = Mode
+config.log_options = Options
 
 monitor.cron = Cron Tasks
 monitor.name = Name

Diferenças do arquivo suprimidas por serem muito extensas
+ 4 - 4
modules/bindata/bindata.go


+ 7 - 0
public/css/gogs.css

@@ -3019,6 +3019,13 @@ footer .ui.language .menu {
 .admin.config #test-mail-btn {
   margin-left: 5px;
 }
+.admin.config table tbody tr td:first-child {
+  font-weight: bold;
+}
+.admin.config pre {
+  background-color: #f7f7f7;
+  padding: 5px;
+}
 .explore {
   padding-top: 15px;
   padding-bottom: 80px;

+ 7 - 0
public/less/_admin.less

@@ -62,5 +62,12 @@
 		#test-mail-btn {
 			margin-left: 5px;
 		}
+		table tbody tr td:first-child {
+			font-weight: bold;
+		}
+		pre {
+			background-color: #f7f7f7;
+			padding: 5px;
+		}
 	}
 }

+ 1 - 1
routers/admin/admin.go

@@ -240,7 +240,7 @@ func Config(ctx *context.Context) {
 			Mode: strings.Title(setting.LogModes[i]),
 		}
 
-		result, _ := json.Marshal(setting.LogConfigs[i])
+		result, _ := json.MarshalIndent(setting.LogConfigs[i], "", "  ")
 		loggers[i].Config = string(result)
 	}
 	ctx.Data["Loggers"] = loggers

+ 12 - 8
templates/admin/config.tmpl

@@ -170,7 +170,7 @@
 						<dd><i class="fa fa{{if .MailerEnabled}}-check{{end}}-square-o"></i></dd>
 						{{if .MailerEnabled}}
 							<dt>{{.i18n.Tr "admin.config.mailer_name"}}</dt>
-							<dd>{{.Mailer.Name}}</dd>
+							<dd>{{.Mailer.Subject}}</dd>
 							<dt>{{.i18n.Tr "admin.config.mailer_disable_helo"}}</dt>
 							<dd><i class="fa fa{{if .Mailer.DisableHelo}}-check{{end}}-square-o"></i></dd>
 							<dt>{{.i18n.Tr "admin.config.mailer_host"}}</dt>
@@ -275,15 +275,19 @@
 				<h4 class="ui top attached header">
 					{{.i18n.Tr "admin.config.log_config"}}
 				</h4>
-				<div class="ui attached table segment">
-					<dl class="dl-horizontal admin-dl-horizontal">
+				<div class="ui attached segment">
+					<table class="ui very basic table">
 						{{range .Loggers}}
-							<dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt>
-							<dd>{{.Mode}}</dd>
-							<dt>{{$.i18n.Tr "admin.config.log_config"}}</dt>
-							<dd><pre><code>{{.Config}}</code></pre></dd>
+							<tr>
+								<td>{{$.i18n.Tr "admin.config.log_mode"}}</td>
+								<td>{{.Mode}}</td>
+							<tr>
+							</tr>
+								<td>{{$.i18n.Tr "admin.config.log_options"}}</td>
+								<td><pre><code>{{.Config}}</code></pre></td>
+							</tr>
 						{{end}}
-					</dl>
+					</table>
 				</div>
 			</div>
 		</div>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff