Some stylistic changes and new motion filter option

This commit is contained in:
FinnStutzenstein 2016-12-09 11:21:55 +01:00
parent fe0801c671
commit f7fcb69cc2
6 changed files with 123 additions and 41 deletions

View File

@ -925,6 +925,10 @@ img {
min-height: 1px;
}
.os-table .id-col-space {
width: calc(100% - 50px);
}
.os-table .header-row {
border-top: 1px solid #ddd;
background-color: #f5f5f5;

View File

@ -1038,6 +1038,9 @@ angular.module('OpenSlidesApp.core.site', [
countdown.editFlag = false;
countdown.description = countdown.new_description;
Countdown.save(countdown);
if (!countdown.running) {
countdown.reset();
}
};
$scope.addCountdown = function () {
var default_time = parseInt($scope.config('projector_default_countdown'));

View File

@ -130,8 +130,7 @@
</div>
</a>
<!-- projector control buttons -->
<div os-perms="core.can_manage_projector">
<div os-perms="core.can_manage_projector" class="nobr">
<!-- edit -->
<a ng-click="editCurrentSlide(projector)"
class="btn btn-default btn-sm"

View File

@ -31,19 +31,20 @@
</style>
<div class="projectorSelector">
<div>
<div class="dropdown" ng-show="projectors.length > 1">
<div ng-show="projectors.length > 1" uib-dropdown>
<button class="btn btn-default btn-sm dropdown-toggle" id="menuProjector" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
{{ active_projector.name | translate }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-entries" aria-labelledby="menuProjector">
<li ng-repeat="projector in projectors"
ng-class="{'projected': projector === active_projector}"
ng-click="changeProjector(projector)">
<i ng-show="projector === active_projector" class="fa fa-check"></i>
{{ projector.name | translate }}
<i ng-show="projector.id == broadcast" class="fa fa-star-o spacer-left"></i>
<li ng-repeat="projector in projectors">
<a href ng-class="{'projected': projector === active_projector}"
ng-click="changeProjector(projector)">
<i ng-show="projector === active_projector" class="fa fa-check"></i>
{{ projector.name | translate }}
<i ng-show="projector.id == broadcast" class="fa fa-star-o spacer-left"></i>
</a>
</li>
</ul>
</div>
@ -82,8 +83,7 @@
</div>
</a>
<!-- projector control buttons -->
<div os-perms="core.can_manage_projector">
<div os-perms="core.can_manage_projector" class="nobr">
<!-- edit -->
<a ng-click="editCurrentSlide(active_projector)"
class="btn btn-default btn-sm"
@ -198,14 +198,9 @@
<div class="input-group">
<input data-ng-model="countdown.default_time" min-sec-format
type="text" placeholder="mm:ss" class="form-control input-sm">
<div class="input-group-addon pointer" uib-tooltip="{{ 'Reset countdown' | translate }}"
ng-click="countdown.reset()">
<i class="fa fa-undo"></i>
</div>
</div>
</div>
<button type="submit"
title="{{ 'Save' | translate}}"
<button type="submit" title="{{ 'Save' | translate}}"
class="btn btn-sm btn-primary">
<i class="fa fa-check"></i>
</button>

View File

@ -806,6 +806,25 @@ angular.module('OpenSlidesApp.motions.site', [
});
$scope.alert = {};
// collect all states and all recommendations of all workflows
$scope.states = [];
$scope.recommendations = [];
var workflows = Workflow.getAll();
_.forEach(workflows, function (workflow) {
var workflowHeader = {
headername: workflow.name,
workflowHeader: true,
};
$scope.states.push(workflowHeader);
$scope.recommendations.push(workflowHeader);
_.forEach(workflow.states, function (state) {
$scope.states.push(state);
if (state.recommendation_label) {
$scope.recommendations.push(state);
}
});
});
// Filtering
$scope.filter = osTableFilter.createInstance('MotionTableFilter');
@ -814,7 +833,8 @@ angular.module('OpenSlidesApp.motions.site', [
state: [],
category: [],
motionBlock: [],
tag: []
tag: [],
recommendation: [],
};
}
$scope.filter.propertyList = ['identifier', 'origin'];
@ -824,6 +844,7 @@ angular.module('OpenSlidesApp.motions.site', [
function (motion) {return motion.getReason();},
function (motion) {return motion.category ? motion.category.name : '';},
function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';},
function (motion) {return motion.recommendation ? motion.getRecommendationName() : '';},
];
$scope.filter.propertyDict = {
'submitters' : function (submitter) {
@ -840,7 +861,8 @@ angular.module('OpenSlidesApp.motions.site', [
state: function (motion) {return motion.state_id;},
category: function (motion) {return motion.category_id;},
motionBlock: function (motion) {return motion.motion_block_id;},
tag: function (motion) {return motion.tags_id;}
tag: function (motion) {return motion.tags_id;},
recommendation: function (motion) {return motion.recommendation_id;},
};
// Sorting
$scope.sort = osTableSort.createInstance();
@ -864,30 +886,22 @@ angular.module('OpenSlidesApp.motions.site', [
display_name: 'Last modified'},
];
// collect all states of all workflows
// TODO: regard workflows only which are used by motions
$scope.states = [];
var workflows = Workflow.getAll();
angular.forEach(workflows, function (workflow) {
if (workflows.length > 1) {
var wf = {};
wf.name = workflow.name;
wf.workflowHeader = true;
$scope.states.push(wf);
}
angular.forEach(workflow.states, function (state) {
$scope.states.push(state);
});
});
// update state
$scope.updateState = function (motion, state_id) {
$http.put('/rest/motions/motion/' + motion.id + '/set_state/', {'state': state_id});
};
// reset state
$scope.reset_state = function (motion) {
$scope.resetState = function (motion) {
$http.put('/rest/motions/motion/' + motion.id + '/set_state/', {});
};
// update recommendation
$scope.updateRecommendation = function (motion, recommendation_id) {
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {'recommendation': recommendation_id});
};
// reset recommendation
$scope.resetRecommendation = function (motion) {
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {});
};
$scope.hasTag = function (motion, tag) {
return _.indexOf(motion.tags_id, tag.id) > -1;
@ -1166,7 +1180,7 @@ angular.module('OpenSlidesApp.motions.site', [
$scope.updateRecommendation = function (recommendation_id) {
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {'recommendation': recommendation_id});
};
// reset state
// reset recommendation
$scope.resetRecommendation = function () {
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {});
};

View File

@ -121,7 +121,7 @@
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownState">
<li ng-repeat="state in states" ng-class="state.workflowHeader ? 'dropdown-header' : ''">
<a ng-if="state.workflowHeader">
{{ state.name | translate }}
{{ state.headername | translate }}
</a>
<a href ng-if="!state.workflowHeader"
ng-click="filter.operateMultiselectFilter('state', state.id, isSelectMode)">
@ -179,6 +179,34 @@
</li>
</ul>
</span>
<!-- recommendation filter -->
<span uib-dropdown ng-if="config('motions_recommendations_by') != ''">
<span class="pointer" id="dropdownRecommendation" uib-dropdown-toggle
ng-class="{'bold': filter.multiselectFilters.recommendation.length > 0, 'disabled': isSelectMode}"
ng-disabled="isSelectMode">
<translate>Recommendation</translate>
<span class="caret"></span>
</span>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownRecommentation">
<li ng-repeat="recommendation in recommendations" ng-class="recommendation.workflowHeader ? 'dropdown-header' : ''">
<a ng-if="recommendation.workflowHeader">
{{ recommendation.headername | translate }}
</a>
<a href ng-if="!recommendation.workflowHeader"
ng-click="filter.operateMultiselectFilter('recommendation', recommendation.id, isSelectMode)">
<i class="fa fa-check" ng-if="filter.multiselectFilters.recommendation.indexOf(recommendation.id) > -1"></i>
{{ recommendation.recommendation_label | translate }}
</a>
</li>
<li class="divider"></li>
<li>
<a href ng-click="filter.operateMultiselectFilter('recommendation', -1, isSelectMode)">
<i class="fa fa-check" ng-if="filter.multiselectFilters.recommendation.indexOf(-1) > -1"></i>
<translate>No recommendation set</translate>
</a>
</li>
</ul>
</span>
<!-- Tag filter -->
<span uib-dropdown ng-if="tags.length > 0">
<span class="pointer" id="dropdownTag" uib-dropdown-toggle
@ -284,6 +312,16 @@
{{ motionBlock.title }}
</span>
</span>
<!-- recommendation -->
<span ng-repeat="recommendation in recommendations" class="pointer spacer-left-lg"
ng-if="filter.multiselectFilters.recommendation.indexOf(recommendation.id) > -1"
ng-click="filter.operateMultiselectFilter('recommendation', recommendation.id, isSelectMode)"
ng-class="{'disabled': isSelectMode}">
<span class="nobr">
<i class="fa fa-times-circle"></i>
{{ recommendation.recommendation_label | translate }}
</span>
</span>
<span ng-if="filter.multiselectFilters.motionBlock.indexOf(-1) > -1" class="pointer spacer-left-lg"
ng-click="filter.operateMultiselectFilter('motionBlock', -1, isSelectMode)"
ng-class="{'disabled': isSelectMode}">
@ -319,6 +357,7 @@
| MultiselectFilter: filter.multiselectFilters.state : getItemId.state
| MultiselectFilter: filter.multiselectFilters.category : getItemId.category
| MultiselectFilter: filter.multiselectFilters.motionBlock : getItemId.motionBlock
| MultiselectFilter: filter.multiselectFilters.recommendation : getItemId.recommendation
| MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag
| toArray
| orderBy: sort.column : sort.reverse)">
@ -340,14 +379,17 @@
{{ motion.identifier }}
</span>
</div>
<div>
<div class="id-col-space">
<!-- ID and title -->
<div>
<strong>
<a class="title" ui-sref="motions.motion.detail({id: motion.id})">{{ motion.getTitle() }}</a>
</strong>
<i class="fa fa-paperclip" ng-if="motion.attachments_id.length > 0"></i>
<span style="padding: 5px;" ng-mouseover="motion.stateHover=true" ng-mouseleave="motion.stateHover=false">
</div>
<!-- state -->
<div>
<span ng-mouseover="motion.stateHover=true" ng-mouseleave="motion.stateHover=false">
<span class="label" ng-class="'label-'+motion.state.css_class">
{{ motion.getStateName() }}
</span>
@ -359,7 +401,7 @@
</li>
<li class="divider" ng-if="motion.state.getNextStates().length"></li>
<li>
<a href ng-if="motion.isAllowed('reset_state')" ng-click="reset_state(motion)">
<a href ng-if="motion.isAllowed('reset_state')" ng-click="resetState(motion)">
<i class="fa fa-exclamation-triangle"></i>
<translate>Reset state</translate>
</a>
@ -368,6 +410,31 @@
</span>
</span>
</div>
<!-- recommendation -->
<div ng-if="motion.recommendation">
<span ng-mouseover="motion.recommendationHover=true" ng-mouseleave="motion.recommendationHover=false">
<span class="label" ng-class="'label-'+motion.recommendation.css_class" uib-tooltip="{{ config('motions_recommendations_by') }}">
{{ motion.getRecommendationName() }}
</span>
<span os-perms="motions.can_manage" ng-class="{'hiddenDiv': !motion.recommendationHover}" uib-dropdown>
<i class="fa fa-cog pointer" uib-dropdown-toggle id="recommendationDropdown{{ motion.id }}"></i>
<ul class="dropdown-menu" aria-labelledby="recommendationDropdown{{ motion.id }}">
<li ng-repeat="recommendation in motion.state.getRecommendations()">
<a href ng-click="updateRecommendation(motion, recommendation.id)">
{{ recommendation.recommendation_label | translate }}
</a>
</li>
<li class="divider" ng-if="motion.state.getRecommendations().length && motion.recommendation"></li>
<li ng-if="motion.recommendation">
<a href ng-click="resetRecommendation(motion)">
<i class="fa fa-exclamation-triangle"></i>
<translate>Reset recommendation</translate>
</a>
</li>
</ul>
</span>
</span>
</div>
<!-- Submitters -->
<div ng-if="motion.submitters.length">
<small>