<commit_before>angular.module('starter.controllers', [])

.controller('AppCtrl', function($scope, $ionicPopover, $ionicSideMenuDelegate, $timeout, api, $timeout, $rootScope) {
    /* Disable until this is needed
    api.coordinates().then(function(position) {
            $rootScope.coordinates = position;
    },
    function(err) {
        console.error(err);
    });
    */
    if (localStorage.getItem('isloggedinwithname') !== null) {
        $rootScope.adminname = localStorage.getItem('adminname');
        $rootScope.isloggedin = (localStorage.getItem('isloggedinwithname') == 1);
    }
    setTimeout(function() {
        $ionicSideMenuDelegate.toggleLeft();
        $rootScope.isSideMenuOpen = false;
    }, 100);

    $rootScope.isAddActive = true;
    $scope.menuClicked = function() {
        $rootScope.isSideMenuOpen= $ionicSideMenuDelegate.isOpen();
    };
    $rootScope.addIconToggle = function(){
        $rootScope.isAddActive = $rootScope.isAddActive?false:true;
    }
    $ionicPopover.fromTemplateUrl('templates/addMenu.html', {
        scope: $rootScope,
    }).then(function(popover) {
        $rootScope.popover = popover;
    });
    api.init();
})
.controller('SectionCtrl', function($scope, $rootScope, api, $stateParams, $ionicPopup, $window, DistrictSelectService) {
    $rootScope.selected = {};

    $scope.$on('$ionicView.beforeEnter', function() {
        $scope.name = $stateParams.sectionid;
        $rootScope.toles = [];
        $rootScope.districts = [];
        $rootScope.sectionName = $stateParams.sectionid;
        var refresh = $scope.dataset?false:true;
        $scope.getData(refresh);
    });

    $scope.$on(ConstEvents.UPDATE_DISTRICTS, function(evnt, newSelectedDistricts) {
        $rootScope.items = DistrictSelectService.filterResourcesByDistricts($scope.dataset, $scope.name, newSelectedDistricts);
    });

    $scope.$on(ConstEvents.REFRESH_DATASET, function() {
        $rootScope.doRefresh();
    });

    $rootScope.updateDistrict = function(){
        //$rootScope.toles = api.location.tole($scope.dataset, $scope.name, $rootScope.selected.district);
        $rootScope.items = api.filter.location.district($scope.dataset, $scope.name, $rootScope.selected.district);
    }
    $rootScope.updateTole = function(){
        $rootScope.items = api.filter.location.tole($rootScope.items, $scope.name,  $rootScope.selected.tole);
    }

    $scope.loadItem = function(item){
        $rootScope.selectedItem = item;
        api.selected.set(item);
        window.location = "#/app/item/"+item.uuid;
    }
<commit_msg>fix: accidental removal of search_options from sectionctrl<commit_after>angular.module('starter.controllers', [])

.controller('AppCtrl', function($scope, $ionicPopover, $ionicSideMenuDelegate, $timeout, api, $timeout, $rootScope) {
    /* Disable until this is needed
    api.coordinates().then(function(position) {
            $rootScope.coordinates = position;
    },
    function(err) {
        console.error(err);
    });
    */
    if (localStorage.getItem('isloggedinwithname') !== null) {
        $rootScope.adminname = localStorage.getItem('adminname');
        $rootScope.isloggedin = (localStorage.getItem('isloggedinwithname') == 1);
    }
    setTimeout(function() {
        $ionicSideMenuDelegate.toggleLeft();
        $rootScope.isSideMenuOpen = false;
    }, 100);

    $rootScope.isAddActive = true;
    $scope.menuClicked = function() {
        $rootScope.isSideMenuOpen= $ionicSideMenuDelegate.isOpen();
    };
    $rootScope.addIconToggle = function(){
        $rootScope.isAddActive = $rootScope.isAddActive?false:true;
    }
    $ionicPopover.fromTemplateUrl('templates/addMenu.html', {
        scope: $rootScope,
    }).then(function(popover) {
        $rootScope.popover = popover;
    });
    api.init();
})
.controller('SectionCtrl', function($scope, $rootScope, api, $stateParams, $ionicPopup, $window, DistrictSelectService) {
    $rootScope.selected = {};
    $scope.search_options = [
        {search:'#needverified', label:'Show verified needs'},
        {search:'#need', label:'Show all needs'},
        {search:'#supply', label:'Show all supplies'},
        {search:'#unverified', label:'Show unverfied resources'}
    ];
    $scope.searchMenu = function(){
        $scope.search.value = "";
        return $scope.showHide=!$scope.showHide;
    };
    $scope.selecionar = function(item){
        $scope.search.value = item.search;
        $scope.showHide = false;
    };
    $scope.$on('$ionicView.beforeEnter', function() {
        $scope.name = $stateParams.sectionid;
        $rootScope.toles = [];
        $rootScope.districts = [];
        $rootScope.sectionName = $stateParams.sectionid;
        var refresh = $scope.dataset?false:true;
        $scope.getData(refresh);
    });

    $scope.$on(ConstEvents.UPDATE_DISTRICTS, function(evnt, newSelectedDistricts) {
        $rootScope.items = DistrictSelectService.filterResourcesByDistricts($scope.dataset, $scope.name, newSelectedDistricts);
    });

    $scope.$on(ConstEvents.REFRESH_DATASET, function() {
        $rootScope.doRefresh();
    });

    $rootScope.updateDistrict = function(){
        //$rootScope.toles = api.location.tole($scope.dataset, $scope.name, $rootScope.selected.district);
        $rootScope.items = api.filter.location.district($scope.dataset, $scope.name, $rootScope.selected.district);
    }
    $rootScope.updateTole = function(){
        $rootScope.items = api.filter.location.tole($rootScope.items, $scope.name,  $rootScope.selected.tole);
    }

    $scope.loadItem = function(item){
        $rootScope.selectedItem = item;
        api.selected.set(item);
        window.location = "#/app/item/"+item.uuid;
    }

{'fraction_non_alphanumeric': 0.1531452602067636, 'fraction_numerical': 0.0014017872787804452, 'mean_word_length': 3.3840245775729647, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '738710', 'n_tokens_mistral': 1776, 'n_tokens_neox': 1734, 'n_words': 240}