From b8fb6200f0e8f66a0cafb2c0e1d1509e5697fb4e Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Wed, 15 Jan 2014 11:38:38 +0200 Subject: [PATCH] Show description in dashboard. --- rd_ui/app/scripts/controllers.js | 8 ++++++-- rd_ui/app/views/dashboard.html | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/rd_ui/app/scripts/controllers.js b/rd_ui/app/scripts/controllers.js index 4a62a109..87e05b3f 100644 --- a/rd_ui/app/scripts/controllers.js +++ b/rd_ui/app/scripts/controllers.js @@ -5,7 +5,7 @@ }); }; - var WidgetCtrl = function ($scope, $http, Query) { + var WidgetCtrl = function ($scope, $http, $location, Query) { $scope.deleteWidget = function() { if (!confirm('Are you sure you want to remove "' + $scope.widget.query.name + '" from the dashboard?')) { return; @@ -18,6 +18,10 @@ }) }); }); + }; + + $scope.open = function(query) { + $location.path('/queries/' + query.id); } $scope.query = new Query($scope.widget.query); @@ -363,7 +367,7 @@ angular.module('redash.controllers', []) .controller('DashboardCtrl', ['$scope', '$routeParams', '$http', 'Dashboard', DashboardCtrl]) - .controller('WidgetCtrl', ['$scope', '$http', 'Query', WidgetCtrl]) + .controller('WidgetCtrl', ['$scope', '$http', '$location', 'Query', WidgetCtrl]) .controller('QueriesCtrl', ['$scope', '$http', '$location', '$filter', 'Query', QueriesCtrl]) .controller('QueryFiddleCtrl', ['$scope', '$window', '$routeParams', '$http', '$location', 'growl', 'notifications', 'Query', QueryFiddleCtrl]) .controller('IndexCtrl', ['$scope', 'Dashboard', IndexCtrl]) diff --git a/rd_ui/app/views/dashboard.html b/rd_ui/app/views/dashboard.html index b16ac3ea..676ec6d2 100644 --- a/rd_ui/app/views/dashboard.html +++ b/rd_ui/app/views/dashboard.html @@ -21,16 +21,11 @@
-

- - {{query.name}} - - - +

+

+ +

+

@@ -39,6 +34,13 @@
+