This commit is contained in:
parent
0f322720a4
commit
7d333d4f3b
@ -37,6 +37,7 @@ Motions:
|
||||
- Bugfix: Several bugfixes regarding splitting list items in
|
||||
change recommendations [#3288]
|
||||
- Added inline Editing for motion reason [#3361].
|
||||
- Added multiselect filter for motion comments [#3372].
|
||||
|
||||
Users:
|
||||
- User without permission to see users can now see agenda item speakers,
|
||||
|
@ -898,13 +898,24 @@ angular.module('OpenSlidesApp.motions.site', [
|
||||
// always order by identifier (after custom ordering)
|
||||
$scope.motions = _.orderBy(Motion.getAll(), ['identifier']);
|
||||
_.forEach($scope.motions, function (motion) {
|
||||
MotionComment.populateFields(motion);
|
||||
motion.personalNote = PersonalNoteManager.getNote(motion);
|
||||
// For filtering, we cannot filter for .personalNote.star
|
||||
motion.star = motion.personalNote ? motion.personalNote.star : false;
|
||||
if (motion.star === undefined) {
|
||||
motion.star = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
$scope.alert = {};
|
||||
|
||||
// Motion comments
|
||||
$scope.commentsFields = Config.get('motions_comments').value;
|
||||
$scope.commentsFieldsNoSpecialComments = _.filter($scope.commentsFields, function (field) {
|
||||
var specialComment = field.forState || field.forRecommendation;
|
||||
return !specialComment;
|
||||
});
|
||||
|
||||
// collect all states and all recommendations of all workflows
|
||||
$scope.states = [];
|
||||
$scope.recommendations = [];
|
||||
@ -952,6 +963,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
||||
motionBlock: [],
|
||||
tag: [],
|
||||
recommendation: [],
|
||||
comment: [],
|
||||
};
|
||||
$scope.filter.booleanFilters = {
|
||||
isFavorite: {
|
||||
@ -971,20 +983,33 @@ angular.module('OpenSlidesApp.motions.site', [
|
||||
function (motion) {return motion.category ? motion.category.name : '';},
|
||||
function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';},
|
||||
function (motion) {return motion.recommendation ? motion.getRecommendationName() : '';},
|
||||
function (motion) {return motion.comments.join(' ');},
|
||||
];
|
||||
$scope.filter.propertyDict = {
|
||||
'submitters' : function (submitter) {
|
||||
'submitters': function (submitter) {
|
||||
return submitter.get_short_name();
|
||||
},
|
||||
'supporters' : function (supporter) {
|
||||
'supporters': function (supporter) {
|
||||
return supporter.get_short_name();
|
||||
},
|
||||
'tags' : function (tag) {
|
||||
'tags': function (tag) {
|
||||
return tag.name;
|
||||
},
|
||||
};
|
||||
$scope.getItemId = {
|
||||
state: function (motion) {return motion.state_id;},
|
||||
comment: function (motion) {
|
||||
// Map all populated fields to their names
|
||||
return _.map(
|
||||
// Returns all fields that are populated
|
||||
_.filter($scope.commentsFieldsNoSpecialComments, function (field) {
|
||||
return motion['comment ' + field.name];
|
||||
}),
|
||||
function (field) {
|
||||
return field.name;
|
||||
}
|
||||
);
|
||||
},
|
||||
category: function (motion) {return motion.category_id;},
|
||||
motionBlock: function (motion) {return motion.motion_block_id;},
|
||||
tag: function (motion) {return motion.tags_id;},
|
||||
@ -1006,7 +1031,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
||||
display_name: gettext('Identifier')},
|
||||
{name: 'getTitle()',
|
||||
display_name: gettext('Title')},
|
||||
{name: 'submitters',
|
||||
{name: 'submitters[0].get_short_name()',
|
||||
display_name: gettext('Submitters')},
|
||||
{name: 'category.name',
|
||||
display_name: gettext('Category')},
|
||||
@ -1095,9 +1120,6 @@ angular.module('OpenSlidesApp.motions.site', [
|
||||
|
||||
// open new/edit dialog
|
||||
$scope.openDialog = function (motion) {
|
||||
if (motion) {
|
||||
MotionComment.populateFields(motion);
|
||||
}
|
||||
ngDialog.open(MotionForm.getDialog(motion));
|
||||
};
|
||||
// Export dialog
|
||||
|
@ -168,6 +168,32 @@
|
||||
</li>
|
||||
</ul>
|
||||
</span>
|
||||
<!-- Comment filter -->
|
||||
<span os-perms="motions.can_see_and_manage_comments">
|
||||
<span uib-dropdown ng-if="commentsFieldsNoSpecialComments.length > 0">
|
||||
<span class="pointer" id="dropdownComment" uib-dropdown-toggle
|
||||
ng-class="{'bold': filter.multiselectFilters.comment.length > 0, 'disabled': isSelectMode}"
|
||||
ng-disabled="isSelectMode">
|
||||
<translate>Comment</translate>
|
||||
<span class="caret"></span>
|
||||
</span>
|
||||
<ul class="dropdown-menu dropdown-menu-left" aria-labelledby="dropdownComment">
|
||||
<li ng-repeat="commentsField in commentsFieldsNoSpecialComments">
|
||||
<a href ng-click="filter.operateMultiselectFilter('comment', commentsField.name, isSelectMode)">
|
||||
<i class="fa fa-check" ng-if="filter.multiselectFilters.comment.indexOf(commentsField.name) > -1"></i>
|
||||
{{ commentsField.name }} <translate>is set</translate>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
<a href ng-click="filter.operateMultiselectFilter('comment', -1, isSelectMode)">
|
||||
<i class="fa fa-check" ng-if="filter.multiselectFilters.comment.indexOf(-1) > -1"></i>
|
||||
<translate>No comments set</translate>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</span>
|
||||
</span>
|
||||
<!-- recommendation filter -->
|
||||
<span uib-dropdown ng-if="config('motions_recommendations_by') != ''">
|
||||
<span class="pointer" id="dropdownRecommendation" uib-dropdown-toggle
|
||||
@ -353,6 +379,22 @@
|
||||
<i class="fa fa-times-circle"></i>
|
||||
<translate>done</translate>
|
||||
</span>
|
||||
<!-- comment -->
|
||||
<span ng-repeat="commentsField in commentsFields" class="pointer spacer-left-lg"
|
||||
ng-if="filter.multiselectFilters.comment.indexOf(commentsField.name) > -1"
|
||||
ng-click="filter.operateMultiselectFilter('comment', commentsField.name, isSelectMode)"
|
||||
ng-class="{'disabled': isSelectMode}">
|
||||
<span class="nobr">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
{{ commentsField.name | translate }}
|
||||
</span>
|
||||
</span>
|
||||
<span ng-if="filter.multiselectFilters.comment.indexOf(-1) > -1" class="pointer spacer-left-lg"
|
||||
ng-click="filter.operateMultiselectFilter('comment', -1, isSelectMode)"
|
||||
ng-class="{'disabled': isSelectMode}">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
<translate>No comments set</translate>
|
||||
</span>
|
||||
<!-- category -->
|
||||
<span ng-repeat="category in categories" class="pointer spacer-left-lg"
|
||||
ng-if="filter.multiselectFilters.category.indexOf(category.id) > -1"
|
||||
@ -434,6 +476,7 @@
|
||||
ng-repeat="motion in motionsFiltered = (motions
|
||||
| osFilter: filter.filterString : filter.getObjectQueryString
|
||||
| MultiselectFilter: stateFilter : getItemId.state
|
||||
| MultiselectFilter: filter.multiselectFilters.comment : getItemId.comment
|
||||
| MultiselectFilter: filter.multiselectFilters.category : getItemId.category
|
||||
| MultiselectFilter: filter.multiselectFilters.motionBlock : getItemId.motionBlock
|
||||
| MultiselectFilter: filter.multiselectFilters.recommendation : getItemId.recommendation
|
||||
|
Loading…
Reference in New Issue
Block a user