diff --git a/app/controllers/sessions.js b/app/controllers/sessions.js index 9ced69b..25883f1 100644 --- a/app/controllers/sessions.js +++ b/app/controllers/sessions.js @@ -2,10 +2,6 @@ var Session = require('../models/session'); var sessions = {} -sessions.find = function (id, cb) { - Session.findById(id, cb) -} - sessions.valid = function (session) { return session.started.setSeconds(session.started.getSeconds() + 3600) > new Date() } diff --git a/public/js/app.js b/public/js/app.js index 949ac57..736dc1a 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1 +1 @@ -angular.module('ciApp', ['ngRoute', 'appRoutes', 'MembreCtrl', 'SessionsServ', 'SessionsCtrl', 'ConnectCtrl']); \ No newline at end of file +angular.module('ciApp', ['ngRoute', 'appRoutes', 'SessionsServ', 'SessionsCtrl', 'ConnectCtrl', 'MembreCtrl']); \ No newline at end of file diff --git a/public/js/controllers/MembreCtrl.js b/public/js/controllers/MembreCtrl.js index 2974b08..d59f927 100644 --- a/public/js/controllers/MembreCtrl.js +++ b/public/js/controllers/MembreCtrl.js @@ -1,6 +1,8 @@ -angular.module('MembreCtrl', []).controller('MembreController', ['$scope', '$http', - function ($scope, $http) { +angular.module('MembreCtrl', []).controller('MembreController', ['$scope', '$http', 'SessionService', + function ($scope, $http, SessionService) { $scope.formData = {}; + $scope.canAdd = SessionService.logged + $scope.canDel = SessionService.logged // when landing on the page, get all Membres and show them $http.get('/api/membres') diff --git a/public/views/membres.html b/public/views/membres.html index 73dd17e..2ca9fc4 100644 --- a/public/views/membres.html +++ b/public/views/membres.html @@ -10,7 +10,7 @@ Nom Section RĂ´le - Action + Action @@ -18,13 +18,13 @@ {{ membre.login }} {{ membre.section }} {{ membre.role }} - - + -- libgit2 0.21.2