File size: 759 Bytes
2fcec7b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * @ngdoc object
 * @name  NavbarController
 * @description  Viewlogic for Navbar
 */
angular.module('projiSeApp')
    .controller('NavbarController', function($scope, $location, Auth, PanelSwitch, Project) {
    'use strict';

    $scope.Project = Project;

    $scope.navpanelSwitch = function() {
        PanelSwitch.navpanel.switch();
    };

    $scope.chatpanelSwitch = function() {
        PanelSwitch.chatpanel.switch();
    };

    $scope.isLoggedIn = Auth.isLoggedIn;
    $scope.isAdmin = Auth.isAdmin;
    $scope.getCurrentUser = Auth.getCurrentUser;

    $scope.logout = function() {
        Auth.logout();
        $location.path('/login');
    };

    $scope.isActive = function(route) {
        return route === $location.path();
    };
});