From fce2c5857ccd25d5b8778807ecd2e01251dbfd10 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 8 Mar 2018 09:31:16 +0100 Subject: [PATCH] Disable the agenda hierachy just for searchning, not for filtering --- openslides/agenda/static/js/agenda/site.js | 14 ++++++++++++++ .../agenda/static/templates/agenda/item-list.html | 14 +++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/openslides/agenda/static/js/agenda/site.js b/openslides/agenda/static/js/agenda/site.js index 4c2a38864..0c2ccdb35 100644 --- a/openslides/agenda/static/js/agenda/site.js +++ b/openslides/agenda/static/js/agenda/site.js @@ -246,6 +246,20 @@ angular.module('OpenSlidesApp.agenda.site', [ }); }; + // Check, if an item has childs in all filtered items + $scope.hasChildren = function (item) { + return _.some($scope.itemsFiltered, function (_item) { + return _item.parent_id == item.id; + }); + }; + + // returns true, if the agenda has at least two layers + $scope.agendaHasMultipleLayers = function () { + return _.some($scope.items, function (item) { + return item.parent_id; + }); + }; + /** Agenda item functions **/ // open dialog for new topics // TODO Remove this. Don't forget import button in template. $scope.newDialog = function () { diff --git a/openslides/agenda/static/templates/agenda/item-list.html b/openslides/agenda/static/templates/agenda/item-list.html index 4617e7e47..6d8fa955c 100644 --- a/openslides/agenda/static/templates/agenda/item-list.html +++ b/openslides/agenda/static/templates/agenda/item-list.html @@ -148,7 +148,7 @@ - + · Expand all @@ -235,8 +235,8 @@ ng-mouseleave="item.hover=false" ng-class="{'projected': item.isProjected().length, 'related-projected': item.isRelatedProjected().length}" - ng-repeat="item in itemsFiltered = (items - | osFilter: filter.filterString : filter.getObjectQueryString + ng-repeat="item in itemsFiltered = (itemsSearched = (items + | osFilter: filter.filterString : filter.getObjectQueryString) | filter: {closed: filter.booleanFilters.closed.value} | filter: {is_hidden: filter.booleanFilters.is_hidden.value}) | collapsedItemFilter @@ -288,14 +288,14 @@