From de26a17dc7350f9c40e84857f4c999b2a6dd5e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 3 May 2016 09:00:58 +0200 Subject: [PATCH 1/6] feat(footer): began work on page footer --- pkg/api/dtos/index.go | 18 ++++++++------ pkg/api/frontendsettings.go | 8 +++--- pkg/api/index.go | 14 +++++++---- public/app/core/controllers/login_ctrl.js | 9 ------- public/app/partials/login.html | 9 ------- public/app/partials/signup_step2.html | 1 - public/sass/components/_footer.scss | 3 +++ public/views/index.html | 30 +++++++++++++++++++++++ 8 files changed, 56 insertions(+), 36 deletions(-) diff --git a/pkg/api/dtos/index.go b/pkg/api/dtos/index.go index 21201d30adf..b813c78f2bb 100644 --- a/pkg/api/dtos/index.go +++ b/pkg/api/dtos/index.go @@ -1,13 +1,17 @@ package dtos type IndexViewData struct { - User *CurrentUser - Settings map[string]interface{} - AppUrl string - AppSubUrl string - GoogleAnalyticsId string - GoogleTagManagerId string - MainNavLinks []*NavLink + User *CurrentUser + Settings map[string]interface{} + AppUrl string + AppSubUrl string + GoogleAnalyticsId string + GoogleTagManagerId string + MainNavLinks []*NavLink + BuildVersion string + BuildCommit string + NewGrafanaVersionExists bool + NewGrafanaVersion string } type PluginCss struct { diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index dd84f7827eb..f23f416b47a 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -137,11 +137,9 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro "allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin, "authProxyEnabled": setting.AuthProxyEnabled, "buildInfo": map[string]interface{}{ - "version": setting.BuildVersion, - "commit": setting.BuildCommit, - "buildstamp": setting.BuildStamp, - "latestVersion": plugins.GrafanaLatestVersion, - "hasUpdate": plugins.GrafanaHasUpdate, + "version": setting.BuildVersion, + "commit": setting.BuildCommit, + "buildstamp": setting.BuildStamp, }, } diff --git a/pkg/api/index.go b/pkg/api/index.go index 53538fd2775..4e4f4fadfeb 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -36,11 +36,15 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { LightTheme: prefs.Theme == "light", Timezone: prefs.Timezone, }, - Settings: settings, - AppUrl: setting.AppUrl, - AppSubUrl: setting.AppSubUrl, - GoogleAnalyticsId: setting.GoogleAnalyticsId, - GoogleTagManagerId: setting.GoogleTagManagerId, + Settings: settings, + AppUrl: setting.AppUrl, + AppSubUrl: setting.AppSubUrl, + GoogleAnalyticsId: setting.GoogleAnalyticsId, + GoogleTagManagerId: setting.GoogleTagManagerId, + BuildVersion: setting.BuildVersion, + BuildCommit: setting.BuildCommit, + NewGrafanaVersion: plugins.GrafanaLatestVersion, + NewGrafanaVersionExists: plugins.GrafanaHasUpdate, } if setting.DisableGravatar { diff --git a/public/app/core/controllers/login_ctrl.js b/public/app/core/controllers/login_ctrl.js index 4249d55a44f..45a47558ed7 100644 --- a/public/app/core/controllers/login_ctrl.js +++ b/public/app/core/controllers/login_ctrl.js @@ -35,15 +35,6 @@ function (angular, coreModule, config) { } }; - // build info view model - $scope.buildInfo = { - version: config.buildInfo.version, - commit: config.buildInfo.commit, - buildstamp: new Date(config.buildInfo.buildstamp * 1000), - latestVersion: config.buildInfo.latestVersion, - hasUpdate: config.buildInfo.hasUpdate, - }; - $scope.submit = function() { if ($scope.loginMode) { $scope.login(); diff --git a/public/app/partials/login.html b/public/app/partials/login.html index ff8d22451a8..8143ff35125 100644 --- a/public/app/partials/login.html +++ b/public/app/partials/login.html @@ -73,14 +73,5 @@ -
- - -
diff --git a/public/app/partials/signup_step2.html b/public/app/partials/signup_step2.html index 7b72c2357b9..afb6d0d4fc4 100644 --- a/public/app/partials/signup_step2.html +++ b/public/app/partials/signup_step2.html @@ -67,7 +67,6 @@ - diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 9f2674980b0..3796275d7f9 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -7,3 +7,6 @@ a { color: darken($gray-1, 25%); } } +.footer { + padding: 5rem 0 1rem 0; +} diff --git a/public/views/index.html b/public/views/index.html index c4bffae5019..9bf1f9f2f0c 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -39,6 +39,36 @@
+ + From c727c3c441942a9bdcfb9ef37a3925a857844966 Mon Sep 17 00:00:00 2001 From: Trent White Date: Fri, 20 May 2016 15:58:14 -0400 Subject: [PATCH 2/6] resize and color of links --- .bra.toml | 2 +- public/sass/components/_footer.scss | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.bra.toml b/.bra.toml index 54019208984..f56e88fb02a 100644 --- a/.bra.toml +++ b/.bra.toml @@ -3,7 +3,7 @@ init_cmds = [ ["go", "build", "-o", "./bin/grafana-server", "./pkg/cmd/grafana-server"], ["./bin/grafana-server"] ] -watch_all = true +watch_all = false watch_dirs = [ "$WORKDIR/pkg", "$WORKDIR/public/views", diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 3796275d7f9..5f9b433f45b 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -1,8 +1,14 @@ +footer { + font-size: 75%; + a { + color: $gray-1; + } +} + .grafana-version-info { position: absolute; bottom: 2px; left: 3px; - font-size: 80%; color: darken($gray-1, 25%); a { color: darken($gray-1, 25%); } } From cffcc4c7a5de8b12e1e925eb9c1e9b4095204ba5 Mon Sep 17 00:00:00 2001 From: Trent White Date: Fri, 20 May 2016 16:44:19 -0400 Subject: [PATCH 3/6] make footer unordered list. add new icons. --- public/sass/components/_footer.scss | 18 +++++++++ public/views/index.html | 57 ++++++++++++++++------------- 2 files changed, 49 insertions(+), 26 deletions(-) diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 5f9b433f45b..3c8353ecbc7 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -1,8 +1,26 @@ footer { font-size: 75%; + width: 98%; /* was causing horiz scrollbars - need to examine */ a { color: $gray-1; } + ul { + list-style: none; + } + li { display: inline-block; + padding-right: 2px; + &:after { + content: ' | '; + padding-left: 2px; + color: $gray-1; + } + } + li:last-child { + &:after { + padding-left: 0; + content: ''; + } + } } .grafana-version-info { diff --git a/public/views/index.html b/public/views/index.html index 9bf1f9f2f0c..e6f05c4593b 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -39,34 +39,39 @@
- From 75940c1f5dd544451743541c8b4f5d82f8e81f83 Mon Sep 17 00:00:00 2001 From: Trent White Date: Sat, 21 May 2016 13:21:31 -0400 Subject: [PATCH 4/6] turn watch all back on --- .bra.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bra.toml b/.bra.toml index f56e88fb02a..54019208984 100644 --- a/.bra.toml +++ b/.bra.toml @@ -3,7 +3,7 @@ init_cmds = [ ["go", "build", "-o", "./bin/grafana-server", "./pkg/cmd/grafana-server"], ["./bin/grafana-server"] ] -watch_all = false +watch_all = true watch_dirs = [ "$WORKDIR/pkg", "$WORKDIR/public/views", From 76d18e71564d6a26a264061e64d190a2836dfc77 Mon Sep 17 00:00:00 2001 From: Trent White Date: Mon, 23 May 2016 11:45:54 -0400 Subject: [PATCH 5/6] remove height: 100% on .main-view --- public/sass/layout/_page.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sass/layout/_page.scss b/public/sass/layout/_page.scss index 8de65053888..6203f4be083 100644 --- a/public/sass/layout/_page.scss +++ b/public/sass/layout/_page.scss @@ -4,7 +4,7 @@ } .main-view { - height: 100%; + // height: 100%; REMOVED FOR FOOTER TRW } .page-container { From a52869507efcfc899a78feff468718b42376fbe7 Mon Sep 17 00:00:00 2001 From: Trent White Date: Mon, 23 May 2016 12:46:13 -0400 Subject: [PATCH 6/6] hide footer on non-dashboard pages --- public/sass/components/_footer.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 3c8353ecbc7..0f34e4b0dd0 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -1,3 +1,7 @@ +.page-dashboard footer { + display: none; +} + footer { font-size: 75%; width: 98%; /* was causing horiz scrollbars - need to examine */