Adds a modal help

This commit is contained in:
2016-01-25 18:08:40 +01:00
parent 56bda18611
commit 686b4b3207
4 changed files with 46 additions and 8 deletions

View File

@@ -121,7 +121,7 @@ func (a *appData) buildRouter() http.Handler {
})))
dirs := []string{"css", "js", "img", "fonts"}
dirs := []string{"css", "js", "img", "fonts", "html"}
for _, d := range dirs {
router.ServeFiles(path.Join("/", d, "/*filepath"), http.Dir(filepath.Join("static", d)))
}

View File

@@ -11,7 +11,18 @@
</head>
<body ng-app="satbd.satellite.bar">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container" ng-controller="NavbarCollapse">
<div class="container" ng-controller="NavbarCollapseCtrl">
<script type="text/ng-template" id="help.html">
<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>
</script>
<div class="navbar-header">
<button type="button" class="navbar-toggle" ng-click="isCollapsed = !isCollapsed" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
@@ -32,6 +43,9 @@
<input type="text" class="form-control" 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')">
<span class="glyphicon glyphicon-question-sign" aria-label="help"></span>
</button>
</div>
</div>
</form>
@@ -42,15 +56,14 @@
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>Hello World !!</h1>
<h1>Bonjour tout le monde !</h1>
</div>
<p class="lead">This page would holds various results</p>
<p>Need some help ?</p>
<p class="lead">Cette page contiendra le resultat de toutes des recherches</p>
</div>
<script src="/js/angular.min.js"></script>
<script src="/js/angular-animate.min.js"></script>
<script src="/js/ui-bootstrap-1.1.0.min.js"></script>
<script src="/js/ui-bootstrap-tpls-1.1.0.min.js"></script>
<script src="/js/satbd.satellite.bar.js"></script>
</body>
</html>

View File

@@ -1,5 +1,20 @@
angular.module('satbd.satellite.bar', ['ui.bootstrap']);
angular.module('satbd.satellite.bar', ['ui.bootstrap','ngAnimate']);
angular.module('satbd.satellite.bar').controller('NavbarCollapse', function ($scope) {
angular.module('satbd.satellite.bar').controller('NavbarCollapseCtrl', function ($scope, $uibModal) {
$scope.isCollapsed = true;
$scope.openModal = function (size) {
var modalInstance = $uibModal.open({
templateUrl: 'help.html',
controller: 'HelpInstanceCtrl',
size: size,
keyboard: true,
});
};
});
angular.module('satbd.satellite.bar').controller('HelpInstanceCtrl', function($scope, $uibModalInstance) {
$scope.ok = function () {
$uibModalInstance.close('');
};
});

File diff suppressed because one or more lines are too long