From ca9dd5042967039ba1eca2359c55697c51402857 Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Thu, 11 Feb 2016 17:14:47 +0100 Subject: [PATCH] Reimplements the help modal --- .gitignore | 1 + router.go | 2 +- webapp/html/help.html | 9 +++++++++ webapp/html/index.html | 2 +- webapp/js/controllers.js | 22 ++++++++++++++++++++-- 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 webapp/html/help.html diff --git a/.gitignore b/.gitignore index dfc6418..ea84285 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ _testmain.go tmp/ bower_components node_modules +/webapp/index.html diff --git a/router.go b/router.go index 4889142..0e79905 100644 --- a/router.go +++ b/router.go @@ -126,7 +126,7 @@ func (a *appData) buildRouter() http.Handler { }))) - dirs := []string{"css", "js", "img", "bower_components"} + dirs := []string{"css", "js", "img", "bower_components", "html"} for _, d := range dirs { router.ServeFiles(path.Join("/", d, "/*filepath"), http.Dir(filepath.Join("webapp", d))) } diff --git a/webapp/html/help.html b/webapp/html/help.html new file mode 100644 index 0000000..6a8017a --- /dev/null +++ b/webapp/html/help.html @@ -0,0 +1,9 @@ + + + diff --git a/webapp/html/index.html b/webapp/html/index.html index ebc5979..0336f65 100644 --- a/webapp/html/index.html +++ b/webapp/html/index.html @@ -32,7 +32,7 @@
-
diff --git a/webapp/js/controllers.js b/webapp/js/controllers.js index 0bdb536..38a8528 100644 --- a/webapp/js/controllers.js +++ b/webapp/js/controllers.js @@ -5,13 +5,31 @@ var controllers = angular.module('satbd.satellite.bar.controllers',[ 'ngAnimate' ]); -controllers.controller('NavBarCtrl',function($scope,$location) { +controllers.controller('NavBarCtrl',function($scope,$location,$uibModal) { $scope.isCollapsed = true; $scope.isActive = function(loc) { return loc === $location.path(); }; $scope.search = function(searchTerms) { - $location.url('/search?q='+ encodeURIComponent(searchTerms)); + if (searchTerms) { + $location.url('/search?q='+ encodeURIComponent(searchTerms)); + } } + + $scope.openHelpModal = function () { + var modalInstance = $uibModal.open({ + templateUrl: 'html/help.html', + controller: 'HelpInstanceCtrl', + size: 'large', + keyboard: true, + }); + }; +}); + + +controllers.controller('HelpInstanceCtrl',function($scope, $uibModalInstance) { + $scope.ok = function () { + $uibModalInstance.close(''); + }; });