diff --git a/openslides/core/static/js/core/base.js b/openslides/core/static/js/core/base.js index 169a1aa66..e812b601e 100644 --- a/openslides/core/static/js/core/base.js +++ b/openslides/core/static/js/core/base.js @@ -267,6 +267,20 @@ angular.module('OpenSlidesApp.core', [ } ]) +.filter('osFilter', [ + '$filter', + function ($filter) { + return function (array, string, getFilterString) { + if (!string) { + return array; + } + return Array.prototype.filter.call(array, function (item) { + return getFilterString(item).toLowerCase().indexOf(string.toLowerCase()) > -1; + }); + } + } +]) + /* Options for CKEditor used in various create and edit views. */ .value('CKEditorOptions', { allowedContent: diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 08e14f313..38436a5e2 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -284,12 +284,24 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions']) $scope.filterPresent = ''; $scope.reverse = false; // function to sort by clicked column - $scope.toggleSort = function ( column ) { + $scope.toggleSort = function (column) { if ( $scope.sortColumn === column ) { $scope.reverse = !$scope.reverse; } $scope.sortColumn = column; }; + $scope.getFilterString = function (motion) { + if (motion.category) { + var category = motion.category.name; + } else { + var category = '' + } + return [ + motion.getTitle(), + motion.getText(), + _.map(motion.submitters, function (submitter) {return submitter.get_short_name()}).join(" "), + category].join(" "); + } // collect all states of all workflows // TODO: regard workflows only which are used by motions diff --git a/openslides/motions/static/templates/motions/motion-list.html b/openslides/motions/static/templates/motions/motion-list.html index bad9a75fa..8ce25726b 100644 --- a/openslides/motions/static/templates/motions/motion-list.html +++ b/openslides/motions/static/templates/motions/motion-list.html @@ -112,7 +112,7 @@ ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
-