Browse Source

CMS version to template vars

Vova Tkach 6 years ago
parent
commit
a162c01c47
4 changed files with 4 additions and 1 deletions
  1. 1 0
      consts/consts.go
  2. 1 1
      hosts/localhost/template/header.html
  3. 1 0
      utils/utils.go
  4. 1 0
      utils/utils_test.go

+ 1 - 0
consts/consts.go

@@ -50,6 +50,7 @@ type TmplSystem struct {
 	PathJsCpScripts  string
 	PathThemeStyles  string
 	PathThemeScripts string
+	InfoVersion      string
 }
 
 type TmplError struct {

+ 1 - 1
hosts/localhost/template/header.html

@@ -24,7 +24,7 @@
 		<div id="wrap">
 			<nav class="navbar navbar-expand-lg navbar-light bg-light">
 				<div class="container">
-					<a class="navbar-brand" href="/">Fave 1.0.0</a>
+					<a class="navbar-brand" href="/">Fave {{$.System.InfoVersion}}</a>
 					<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
 						<span class="navbar-toggler-icon"></span>
 					</button>

+ 1 - 0
utils/utils.go

@@ -104,6 +104,7 @@ func GetTmplSystemData() consts.TmplSystem {
 		PathJsCpScripts:  GetAssetsUrl(consts.AssetsCpScriptsJs),
 		PathThemeStyles:  "/assets/theme/styles.css",
 		PathThemeScripts: "/assets/theme/scripts.js",
+		InfoVersion:      consts.ServerVersion,
 	}
 }
 

+ 1 - 0
utils/utils_test.go

@@ -98,6 +98,7 @@ func TestGetTmplSystemData(t *testing.T) {
 		PathJsCpScripts:  "/assets/cp/scripts.js?v=" + consts.AssetsVersion,
 		PathThemeStyles:  "/assets/theme/styles.css",
 		PathThemeScripts: "/assets/theme/scripts.js",
+		InfoVersion:      consts.ServerVersion,
 	})
 }