<commit_before>"use strict"

angular.module("schoolines").directive("deadline", function() {
    return {
        restrict: "AE",
        templateUrl: "/app/directives/deadline.html",
        controller: ["$mdSidenav", "$scope", "$timeout", "$log", "AuthService", "IVLEService", "Session", "DeadlineService", "$localStorage",
        function($mdSidenav, $scope, $timeout, $log, AuthService, IVLEService, Session, DeadlineService, $localStorage) {
            AuthService.autologin().then(function() {

                IVLEService.getModules(Session.token).then(function() {
                    $scope.modules = ["All"];
                    $scope.modules = $scope.modules.concat($localStorage.modules);
                    DeadlineService.getDeadline().then(function(){

                        var deadlines = JSON.parse($localStorage.deadlines.deadlineArray);
                        $scope.deadlines = deadlines;

                        $scope.filter = function(mod){
                            if(mod == "All"){
                                $scope.deadlines = deadlines;
                                return ;
                            }
                            var d = [];
                            for(var deadline of deadlines){
                                if(deadline.module == mod)

                                    d.push(deadline);
                            }
                            $scope.deadlines = d;
                            $scope.close();
                        }

                        for (var d of $scope.deadlines) {
                            // TODO change color

                            d.color = "red";
                        }
                    });

                });
            });

<commit_msg>close sidebar when click<commit_after>"use strict"

angular.module("schoolines").directive("deadline", function() {
    return {
        restrict: "AE",
        templateUrl: "/app/directives/deadline.html",
        controller: ["$mdSidenav", "$scope", "$timeout", "$log", "AuthService", "IVLEService", "Session", "DeadlineService", "$localStorage",
        function($mdSidenav, $scope, $timeout, $log, AuthService, IVLEService, Session, DeadlineService, $localStorage) {
            AuthService.autologin().then(function() {

                IVLEService.getModules(Session.token).then(function() {
                    $scope.modules = ["All"];
                    $scope.modules = $scope.modules.concat($localStorage.modules);
                    DeadlineService.getDeadline().then(function(){

                        var deadlines = JSON.parse($localStorage.deadlines.deadlineArray);
                        $scope.deadlines = deadlines;

                        $scope.filter = function(mod){
                            if(mod == "All"){
                                $scope.deadlines = deadlines;
                                $scope.close();
                                return ;
                            }
                            var d = [];
                            for(var deadline of deadlines){
                                if(deadline.module == mod)

                                    d.push(deadline);
                            }
                            $scope.deadlines = d;
                            $scope.close();
                        }

                        for (var d of $scope.deadlines) {
                            // TODO change color

                            d.color = "red";
                        }
                    });

                });
            });


{'fraction_non_alphanumeric': 0.1153098082800778, 'fraction_numerical': 0.0, 'mean_word_length': 1.102803738317757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4429575', 'n_tokens_mistral': 846, 'n_tokens_neox': 790, 'n_words': 142}