Explorar o código

Merge branch 'footer'

Torkel Ödegaard %!s(int64=9) %!d(string=hai) anos
pai
achega
8f0240a295

+ 11 - 7
pkg/api/dtos/index.go

@@ -1,13 +1,17 @@
 package dtos
 package dtos
 
 
 type IndexViewData struct {
 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 {
 type PluginCss struct {

+ 9 - 5
pkg/api/index.go

@@ -36,11 +36,15 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
 			LightTheme:     prefs.Theme == "light",
 			LightTheme:     prefs.Theme == "light",
 			Timezone:       prefs.Timezone,
 			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 {
 	if setting.DisableGravatar {

+ 0 - 9
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() {
     $scope.submit = function() {
       if ($scope.loginMode) {
       if ($scope.loginMode) {
         $scope.login();
         $scope.login();

+ 0 - 9
public/app/partials/login.html

@@ -73,14 +73,5 @@
 			</div>
 			</div>
 		</div>
 		</div>
 
 
-		<div class="row" style="margin-top: 50px">
-			<div class="version-footer text-center small">
-				Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}},
-				build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }}
-			</div>
-			<div class="version-footer text-center small" ng-show="buildInfo.hasUpdate">
-				<a class="external-link" target="_blank" href="http://grafana.org/download">New Grafana Version Available ({{buildInfo.latestVersion}})</a>
-			</div>
-		</div>
 	</div>
 	</div>
 </div>
 </div>

+ 0 - 1
public/app/partials/signup_step2.html

@@ -67,7 +67,6 @@
 			</form>
 			</form>
 		</div>
 		</div>
 
 
-
 	</div>
 	</div>
 </div>
 </div>
 
 

+ 32 - 1
public/sass/components/_footer.scss

@@ -1,9 +1,40 @@
+.page-dashboard footer {
+	display: none;
+}
+
+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 {
 .grafana-version-info {
   position: absolute;
   position: absolute;
   bottom: 2px;
   bottom: 2px;
   left: 3px;
   left: 3px;
-  font-size: 80%;
   color: darken($gray-1, 25%);
   color: darken($gray-1, 25%);
   a { color: darken($gray-1, 25%); }
   a { color: darken($gray-1, 25%); }
 }
 }
 
 
+.footer {
+  padding: 5rem 0 1rem 0;
+}

+ 1 - 1
public/sass/layout/_page.scss

@@ -4,7 +4,7 @@
 }
 }
 
 
 .main-view {
 .main-view {
-  height: 100%;
+  // height: 100%; REMOVED FOR FOOTER TRW
 }
 }
 
 
 .page-container {
 .page-container {

+ 35 - 0
public/views/index.html

@@ -39,6 +39,41 @@
 			</div>
 			</div>
 
 
 			<div ng-view class="main-view"></div>
 			<div ng-view class="main-view"></div>
+			<footer class="footer">
+				<div class="row text-center">
+					<ul>
+						<li>
+							<a href="http://docs.grafana.org" target="_blank">
+								<i class="fa fa-file-code-o"></i>
+								Docs
+							</a>
+						</li>
+						<li>
+							<a href="https://grafana.net/support/plans" target="_blank">
+								<i class="fa fa-support"></i>
+								Support Plans
+							</a>
+						</li>
+						<li>
+							<a href="https://grafana.org/community" target="_blank">
+								<i class="fa fa-comments-o"></i>
+								Community
+							</a>
+						</li>
+						<li>	
+							<a href="http://grafana.org" target="_blank">Grafana</a>
+							<span class="muted">v[[.BuildVersion]] (commit: [[.BuildCommit]])</span>
+						</li>
+						<li>
+							[[if .NewGrafanaVersionExists]]
+								<a href="http://grafana.org/download" target="_blank" bs-tooltip="'[[.NewGrafanaVersion]]'">
+									New version available!
+								</a>
+							[[end]]
+						</li>
+					</ul>
+				</div>
+			</footer>
 		</grafana-app>
 		</grafana-app>
   </body>
   </body>