Reimplements the help modal

This commit is contained in:
2016-02-11 17:14:47 +01:00
parent e109e116f5
commit ca9dd50429
5 changed files with 32 additions and 4 deletions

1
.gitignore vendored
View File

@@ -31,3 +31,4 @@ _testmain.go
tmp/
bower_components
node_modules
/webapp/index.html

View File

@@ -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)))
}

9
webapp/html/help.html Normal file
View File

@@ -0,0 +1,9 @@
<div class="modal-header">
<h3 class="modal-title">Aide</h3>
</div>
<div class="modal-body">
<p> Bientôt disponible </p>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
</div>

View File

@@ -32,7 +32,7 @@
<input type="text" class="form-control" ng-model="searchTerms" placeholder="Chercher ...">
<div class="input-group-btn">
<button class="btn btn-default" type="submit">Go!</button>
<button type="button" class="btn btn-default" ng-click="openModal('lg')">
<button type="button" class="btn btn-default" ng-click="openHelpModal()">
<span class="glyphicon glyphicon-question-sign" aria-label="help"></span>
</button>
</div>

View File

@@ -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('');
};
});