<commit_before>Application.Directives.directive('projectTabs', projectTabsDirective);

function projectTabsDirective() {
    return {
        scope: {
            project: "="
        },
        controller: 'projectTabsDirectiveController',
        restrict: "AE",
        templateUrl: "application/core/projects/project/project-tabs.html"
    };
}

Application.Controllers.controller('projectTabsDirectiveController',
                                  ["$scope", "$state","projectColors", "pubsub", "model.projects", "$stateParams", "$filter", projectTabsDirectiveController]);

function projectTabsDirectiveController($scope, $state, projectColors, pubsub, Projects,$stateParams, $filter) {

    pubsub.waitOn($scope, "update-tab-count.change", function () {
            Projects.get($stateParams.id).then(function (project) {
                $scope.project.reviews = project.reviews;
                $scope.project.samples = project.samples;
                $scope.project.notes = project.notes;
                $scope.updateTabCounts();
            });
    });
    var activeTab = "overview";

    if ($state.current.name == 'projects.project.reviews.view'){
        activeTab = "reviews";
    }
    $scope.colors = projectColors;
    $scope.inactiveColor = projectColors.getInactiveColor();

    $scope.setActiveTab = function(tabID) {
        activeTab = tabID;
    };

    $scope.isActiveTab = function (tabID) {
        return tabID == activeTab;
    };

    $scope.getActiveStyle = function() {
        var color = projectColors.getCurrentProjectColor();
        return {
            background: color,
            'border-bottom-style': 'solid',
            'border-bottom-color': color,
            color: 'white',
            'font-weight': 'bold',
            outline: 0
        };
    };

    $scope.getInactiveStyle = function() {
        var color = projectColors.getCurrentProjectColorLight();
        var fontColor = projectColors.getInactiveColor();
        return {
            color: fontColor,
            background: color
        };
    };

    $scope.updateTabCounts = function(){
        $scope.tabs = [
            {
                id: "overview",
                icon: "fa-list",
                name: "Overview",
                hasCount: false,
                defaulttab: "view"
            },

            {
                id: "files",
                icon: "fa-files-o",
                name: "Files",
                hasCount: false,
                defaulttab: "view"
            },

            {
                id: "samples",
                icon: "fa-cubes",
                name: "Samples",
                hasCount: true,
                count: $scope.project.samples.length,
                defaulttab: "view"
            },

            {
                id: "provenance",
                icon: "fa-code-fork",
                name: "Provenance",
                hasCount: true,
                count: $scope.project.processes.length,
                defaulttab: "view"
            },

            {
                id: "reviews",
                icon: "fa-comment",
                name: "Reviews",
                hasCount: true,
                count: ($filter('byKey')($scope.project.reviews, 'status', 'open')).length ,
                defaulttab: "view"
            },

            {
                id: "notes",
                icon: "fa-edit",
                name: "Notes",
                hasCount: true,
                count: $scope.project.notes.length,
                defaulttab: "view"
            }
        ];
    }
    function init(){
        console.dir($scope.project);
        $scope.updateTabCounts();
    }
    init();


}<commit_msg>removed console from project tabs<commit_after>Application.Directives.directive('projectTabs', projectTabsDirective);

function projectTabsDirective() {
    return {
        scope: {
            project: "="
        },
        controller: 'projectTabsDirectiveController',
        restrict: "AE",
        templateUrl: "application/core/projects/project/project-tabs.html"
    };
}

Application.Controllers.controller('projectTabsDirectiveController',
                                  ["$scope", "$state","projectColors", "pubsub", "model.projects", "$stateParams", "$filter", projectTabsDirectiveController]);

function projectTabsDirectiveController($scope, $state, projectColors, pubsub, Projects,$stateParams, $filter) {

    pubsub.waitOn($scope, "update-tab-count.change", function () {
            Projects.get($stateParams.id).then(function (project) {
                $scope.project.reviews = project.reviews;
                $scope.project.samples = project.samples;
                $scope.project.notes = project.notes;
                $scope.updateTabCounts();
            });
    });
    var activeTab = "overview";

    if ($state.current.name == 'projects.project.reviews.view'){
        activeTab = "reviews";
    }
    $scope.colors = projectColors;
    $scope.inactiveColor = projectColors.getInactiveColor();

    $scope.setActiveTab = function(tabID) {
        activeTab = tabID;
    };

    $scope.isActiveTab = function (tabID) {
        return tabID == activeTab;
    };

    $scope.getActiveStyle = function() {
        var color = projectColors.getCurrentProjectColor();
        return {
            background: color,
            'border-bottom-style': 'solid',
            'border-bottom-color': color,
            color: 'white',
            'font-weight': 'bold',
            outline: 0
        };
    };

    $scope.getInactiveStyle = function() {
        var color = projectColors.getCurrentProjectColorLight();
        var fontColor = projectColors.getInactiveColor();
        return {
            color: fontColor,
            background: color
        };
    };

    $scope.updateTabCounts = function(){
        $scope.tabs = [
            {
                id: "overview",
                icon: "fa-list",
                name: "Overview",
                hasCount: false,
                defaulttab: "view"
            },

            {
                id: "files",
                icon: "fa-files-o",
                name: "Files",
                hasCount: false,
                defaulttab: "view"
            },

            {
                id: "samples",
                icon: "fa-cubes",
                name: "Samples",
                hasCount: true,
                count: $scope.project.samples.length,
                defaulttab: "view"
            },

            {
                id: "provenance",
                icon: "fa-code-fork",
                name: "Provenance",
                hasCount: true,
                count: $scope.project.processes.length,
                defaulttab: "view"
            },

            {
                id: "reviews",
                icon: "fa-comment",
                name: "Reviews",
                hasCount: true,
                count: ($filter('byKey')($scope.project.reviews, 'status', 'open')).length ,
                defaulttab: "view"
            },

            {
                id: "notes",
                icon: "fa-edit",
                name: "Notes",
                hasCount: true,
                count: $scope.project.notes.length,
                defaulttab: "view"
            }
        ];
    }
    function init(){
        $scope.updateTabCounts();
    }
    init();


}
{'fraction_non_alphanumeric': 0.12478007849506023, 'fraction_numerical': 0.0002706726214643389, 'mean_word_length': 1.5, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '936083', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1920, 'n_words': 345}