Added is amendment filter, fixed ckeditor image browser logo, changed motion table header layout

This commit is contained in:
FinnStutzenstein 2017-11-24 13:25:38 +01:00
parent 3ac1c3c756
commit 34ac4a347c
6 changed files with 54 additions and 24 deletions

View File

@ -51,6 +51,8 @@ Motions:
- Show the number of next speakers in motion list view [#3470]. - Show the number of next speakers in motion list view [#3470].
- Reference to motions by id in state and recommendation special field [#3498]. - Reference to motions by id in state and recommendation special field [#3498].
- Added new change recommendation type "other" [#3495]. - Added new change recommendation type "other" [#3495].
- Combined all boolean filters into one dropdown menu and added a filter
for amendments [#3501].
Elections: Elections:
- Added pagination for list view [#3393]. - Added pagination for list view [#3393].

View File

@ -1118,6 +1118,7 @@ img {
.os-table .main-header .form-inline { .os-table .main-header .form-inline {
margin-left: 15px; margin-left: 15px;
width: 100%;
} }
.os-table .content > div { /* horizontal blocks */ .os-table .content > div { /* horizontal blocks */

View File

@ -81,7 +81,7 @@ angular.module('OpenSlidesApp.mediafiles.image-plugin', [
}); });
// Set the toolbar icon to the default image icon. // Set the toolbar icon to the default image icon.
CKEDITOR.on('instanceReady', function () { CKEDITOR.on('instanceReady', function () {
var toolbarIcon = $('span.cke_button_icon.cke_button__image.browser_icon'); var toolbarIcon = $('span.cke_button_icon.cke_button__bildbrowser_icon');
toolbarIcon.removeClass('cke_button__image browser_icon'); toolbarIcon.removeClass('cke_button__image browser_icon');
toolbarIcon.addClass('cke_button__image_icon'); toolbarIcon.addClass('cke_button__image_icon');
}); });

View File

@ -240,6 +240,11 @@ angular.module('OpenSlidesApp.motions', [
MotionComment.populateFieldsReverse(data); MotionComment.populateFieldsReverse(data);
callback(null, data); callback(null, data);
}, },
computed: {
isAmendment: function () {
return this.parent_id !== null;
},
},
methods: { methods: {
getResourceName: function () { getResourceName: function () {
return name; return name;
@ -505,9 +510,6 @@ angular.module('OpenSlidesApp.motions', [
] ]
}); });
}, },
isAmendment: function () {
return this.parent_id !== null;
},
hasAmendments: function () { hasAmendments: function () {
return DS.filter('motions/motion', {parent_id: this.id}).length > 0; return DS.filter('motions/motion', {parent_id: this.id}).length > 0;
}, },
@ -591,8 +593,8 @@ angular.module('OpenSlidesApp.motions', [
return ( return (
operator.hasPerms('motions.can_create') && operator.hasPerms('motions.can_create') &&
Config.get('motions_amendments_enabled').value && Config.get('motions_amendments_enabled').value &&
( !this.isAmendment() || ( !this.isAmendment ||
(this.isAmendment() && OpenSlidesSettings.MOTIONS_ALLOW_AMENDMENTS_OF_AMENDMENTS)) (this.isAmendment && OpenSlidesSettings.MOTIONS_ALLOW_AMENDMENTS_OF_AMENDMENTS))
); );
default: default:
return false; return false;

View File

@ -1024,6 +1024,9 @@ angular.module('OpenSlidesApp.motions.site', [
// collect all states and all recommendations of all workflows // collect all states and all recommendations of all workflows
$scope.collectStatesAndRecommendations = function () { $scope.collectStatesAndRecommendations = function () {
// Special case: If it is the first time updated, update the state filter.
// This causes to set the done/undone states correct on page load.
var doStateFilterUpdate = !$scope.states;
$scope.states = []; $scope.states = [];
$scope.recommendations = []; $scope.recommendations = [];
var workflows = $scope.collectAllUsedWorkflows(); var workflows = $scope.collectAllUsedWorkflows();
@ -1049,6 +1052,9 @@ angular.module('OpenSlidesApp.motions.site', [
} }
}); });
}); });
if (doStateFilterUpdate) {
updateStateFilter();
}
}; };
$scope.collectAllUsedWorkflows = function () { $scope.collectAllUsedWorkflows = function () {
return _.filter(Workflow.getAll(), function (workflow) { return _.filter(Workflow.getAll(), function (workflow) {
@ -1101,6 +1107,11 @@ angular.module('OpenSlidesApp.motions.site', [
comment: [], comment: [],
}; };
$scope.filter.booleanFilters = { $scope.filter.booleanFilters = {
isAmendment: {
value: undefined,
choiceYes: gettext('Is an amendment'),
choiceNo: gettext('Is not an amendment'),
},
isFavorite: { isFavorite: {
value: undefined, value: undefined,
choiceYes: gettext('Marked as favorite'), choiceYes: gettext('Marked as favorite'),
@ -1113,7 +1124,6 @@ angular.module('OpenSlidesApp.motions.site', [
}, },
}; };
} }
updateStateFilter();
$scope.filter.propertyList = ['identifier', 'origin']; $scope.filter.propertyList = ['identifier', 'origin'];
$scope.filter.propertyFunctionList = [ $scope.filter.propertyFunctionList = [
function (motion) {return motion.getTitle();}, function (motion) {return motion.getTitle();},

View File

@ -135,19 +135,12 @@
<div class="os-table container-fluid"> <div class="os-table container-fluid">
<div class="row header-row"> <div class="row header-row">
<div class="col-xs-1 centered" ng-show="isSelectMode"> <div class="col-xs-1 centered" ng-if="isSelectMode">
<i class="fa text-danger pointer" ng-class=" selectedAll ? 'fa-check-square-o' : 'fa-square-o'" <i class="fa text-danger pointer" ng-class=" selectedAll ? 'fa-check-square-o' : 'fa-square-o'"
ng-click="checkAll()"></i> ng-click="checkAll()"></i>
</div> </div>
<div class="col-xs-11 main-header"> <div class="col-xs-11 main-header" ng-style="{'width': isSelectMode ? '' : '100%'}">
<span class="form-inline text-right pull-right"> <div class="form-inline text-right pull-right">
<!-- clear all filters -->
<span class="sort-spacer pointer" ng-click="resetFilters()"
ng-if="filter.areFiltersSet()" ng-disabled="isSelectMode"
ng-class="{'disabled': isSelectMode}">
<i class="fa fa-times-circle"></i>
<translate>Filter</translate>
</span>
<!-- State filter --> <!-- State filter -->
<span uib-dropdown> <span uib-dropdown>
<span class="pointer" id="dropdownState" uib-dropdown-toggle <span class="pointer" id="dropdownState" uib-dropdown-toggle
@ -308,14 +301,28 @@
</span> </span>
<!-- boolean Filters (customized!) --> <!-- boolean Filters (customized!) -->
<span ng-if="operator.user.id" uib-dropdown> <span ng-if="operator.user.id" uib-dropdown>
<span class="pointer" id="dropdownPrivate" uib-dropdown-toggle <span class="pointer" id="dropdownMisc" uib-dropdown-toggle
ng-class="{'bold': (filter.booleanFilters.isFavorite.value !== undefined) || ng-class="{'bold': (filter.booleanFilters.isFavorite.value !== undefined) ||
(filter.booleanFilters.hasPersonalNote.value !== undefined), 'disabled': isSelectMode}" (filter.booleanFilters.hasPersonalNote.value !== undefined) ||
(filter.booleanFilters.isAmendment.value !== undefined), 'disabled': isSelectMode}"
ng-disabled="isSelectMode"> ng-disabled="isSelectMode">
<translate>Private</translate> <translate>Misc</translate>
<span class="caret"></span> <span class="caret"></span>
</span> </span>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownPrivate"> <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMisc">
<li>
<a href ng-click="filter.booleanFilters.isAmendment.value = (filter.booleanFilters.isAmendment.value ? undefined : true); filter.save();">
<i class="fa" ng-class="{'fa-check': filter.booleanFilters.isAmendment.value === true}"></i>
{{ filter.booleanFilters.isAmendment.choiceYes | translate }}
</a>
</li>
<li>
<a href ng-click="filter.booleanFilters.isAmendment.value = (filter.booleanFilters.isAmendment.value === false) ? undefined : false; filter.save();">
<i class="fa" ng-class="{'fa-check': filter.booleanFilters.isAmendment.value === false}"></i>
{{ filter.booleanFilters.isAmendment.choiceNo | translate }}
</a>
</li>
<li class="divider"></li>
<li> <li>
<a href ng-click="filter.booleanFilters.isFavorite.value = (filter.booleanFilters.isFavorite.value ? undefined : true); filter.save();"> <a href ng-click="filter.booleanFilters.isFavorite.value = (filter.booleanFilters.isFavorite.value ? undefined : true); filter.save();">
<i class="fa" ng-class="{'fa-check': filter.booleanFilters.isFavorite.value === true}"></i> <i class="fa" ng-class="{'fa-check': filter.booleanFilters.isFavorite.value === true}"></i>
@ -385,9 +392,16 @@
ng-change="filter.save()"> ng-change="filter.save()">
</span> </span>
</span> </span>
</span> </div>
<!-- show all selected multiselectoptions --> <!-- show all selected multiselectoptions -->
<span> <div>
<!-- clear all filters -->
<span class="spacer-left-lg pointer" ng-click="resetFilters()"
ng-if="filter.areFiltersSet()" ng-disabled="isSelectMode"
ng-class="{'disabled': isSelectMode}">
<i class="fa fa-times-circle"></i>
<strong translate>All Filters</strong>
</span>
<!-- state --> <!-- state -->
<span ng-repeat="state in states" class="pointer spacer-left-lg" <span ng-repeat="state in states" class="pointer spacer-left-lg"
ng-if="!state.workflowHeader && filter.multiselectFilters.state.indexOf(state.id) > -1" ng-if="!state.workflowHeader && filter.multiselectFilters.state.indexOf(state.id) > -1"
@ -496,7 +510,7 @@
{{ booleanFilter.value ? booleanFilter.choiceYes : booleanFilter.choiceNo | translate }} {{ booleanFilter.value ? booleanFilter.choiceYes : booleanFilter.choiceNo | translate }}
</span> </span>
</span> </span>
</span> </div>
</div> </div>
</div> </div>
@ -515,6 +529,7 @@
| MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag | MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag
| filter: {star: filter.booleanFilters.isFavorite.value} | filter: {star: filter.booleanFilters.isFavorite.value}
| filter: {hasPersonalNote: filter.booleanFilters.hasPersonalNote.value} | filter: {hasPersonalNote: filter.booleanFilters.hasPersonalNote.value}
| filter: {isAmendment: filter.booleanFilters.isAmendment.value}
| toArray | toArray
| orderByEmptyLast: sort.column : sort.reverse) | orderByEmptyLast: sort.column : sort.reverse)
| limitTo : itemsPerPage : limitBegin"> | limitTo : itemsPerPage : limitBegin">