From 4dad8d946e0523838139e27a93283120529ff13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 31 Oct 2018 13:40:58 -0700 Subject: [PATCH 1/2] Updated login page logo & wordmark and responsive behavior --- pkg/api/dtos/index.go | 1 + pkg/api/index.go | 12 ++++++ pkg/setting/setting.go | 12 +++--- public/app/partials/login.html | 2 +- public/sass/components/_footer.scss | 6 +-- public/sass/pages/_login.scss | 60 +++++++++++++---------------- public/views/index.template.html | 2 +- 7 files changed, 52 insertions(+), 43 deletions(-) diff --git a/pkg/api/dtos/index.go b/pkg/api/dtos/index.go index 77004899fc3..bd3ac76eec8 100644 --- a/pkg/api/dtos/index.go +++ b/pkg/api/dtos/index.go @@ -14,6 +14,7 @@ type IndexViewData struct { NewGrafanaVersionExists bool NewGrafanaVersion string AppName string + AppNameBodyClass string } type PluginCss struct { diff --git a/pkg/api/index.go b/pkg/api/index.go index e61620f9586..fe7c9e79a17 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -83,6 +83,7 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er NewGrafanaVersion: plugins.GrafanaLatestVersion, NewGrafanaVersionExists: plugins.GrafanaHasUpdate, AppName: setting.ApplicationName, + AppNameBodyClass: getAppNameBodyClass(setting.ApplicationName), } if setting.DisableGravatar { @@ -377,3 +378,14 @@ func (hs *HTTPServer) NotFoundHandler(c *m.ReqContext) { c.HTML(404, "index", data) } + +func getAppNameBodyClass(name string) string { + switch name { + case setting.APP_NAME: + return "app-grafana" + case setting.APP_NAME_ENTERPRISE: + return "app-enterprise" + default: + return "" + } +} diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 077822a37a4..3750e95e6a4 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -31,9 +31,11 @@ const ( ) const ( - DEV string = "development" - PROD string = "production" - TEST string = "test" + DEV = "development" + PROD = "production" + TEST = "test" + APP_NAME = "Grafana" + APP_NAME_ENTERPRISE = "Grafana Enterprise" ) var ( @@ -531,9 +533,9 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error { // Temporary keep global, to make refactor in steps Raw = cfg.Raw - ApplicationName = "Grafana" + ApplicationName = APP_NAME if IsEnterprise { - ApplicationName += " Enterprise" + ApplicationName = APP_NAME_ENTERPRISE } Env = iniFile.Section("").Key("app_mode").MustString("development") diff --git a/public/app/partials/login.html b/public/app/partials/login.html index 260de80e389..a2bc8173766 100644 --- a/public/app/partials/login.html +++ b/public/app/partials/login.html @@ -2,7 +2,7 @@