Merge pull request #2751 from FinnStutzenstein/Issue2747
Some stylistic changes and new motion filter option
This commit is contained in:
commit
c2edf134e2
@ -926,6 +926,10 @@ img {
|
|||||||
min-height: 1px;
|
min-height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.os-table .id-col-space {
|
||||||
|
width: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
|
||||||
.os-table .header-row {
|
.os-table .header-row {
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
|
@ -1038,6 +1038,9 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
countdown.editFlag = false;
|
countdown.editFlag = false;
|
||||||
countdown.description = countdown.new_description;
|
countdown.description = countdown.new_description;
|
||||||
Countdown.save(countdown);
|
Countdown.save(countdown);
|
||||||
|
if (!countdown.running) {
|
||||||
|
countdown.reset();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
$scope.addCountdown = function () {
|
$scope.addCountdown = function () {
|
||||||
var default_time = parseInt($scope.config('projector_default_countdown'));
|
var default_time = parseInt($scope.config('projector_default_countdown'));
|
||||||
|
@ -130,8 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<!-- projector control buttons -->
|
<!-- projector control buttons -->
|
||||||
<div os-perms="core.can_manage_projector">
|
<div os-perms="core.can_manage_projector" class="nobr">
|
||||||
|
|
||||||
<!-- edit -->
|
<!-- edit -->
|
||||||
<a ng-click="editCurrentSlide(projector)"
|
<a ng-click="editCurrentSlide(projector)"
|
||||||
class="btn btn-default btn-sm"
|
class="btn btn-default btn-sm"
|
||||||
|
@ -31,19 +31,20 @@
|
|||||||
</style>
|
</style>
|
||||||
<div class="projectorSelector">
|
<div class="projectorSelector">
|
||||||
<div>
|
<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"
|
<button class="btn btn-default btn-sm dropdown-toggle" id="menuProjector" data-toggle="dropdown"
|
||||||
aria-haspopup="true" aria-expanded="true">
|
aria-haspopup="true" aria-expanded="true">
|
||||||
{{ active_projector.name | translate }}
|
{{ active_projector.name | translate }}
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu dropdown-entries" aria-labelledby="menuProjector">
|
<ul class="dropdown-menu dropdown-entries" aria-labelledby="menuProjector">
|
||||||
<li ng-repeat="projector in projectors"
|
<li ng-repeat="projector in projectors">
|
||||||
ng-class="{'projected': projector === active_projector}"
|
<a href ng-class="{'projected': projector === active_projector}"
|
||||||
ng-click="changeProjector(projector)">
|
ng-click="changeProjector(projector)">
|
||||||
<i ng-show="projector === active_projector" class="fa fa-check"></i>
|
<i ng-show="projector === active_projector" class="fa fa-check"></i>
|
||||||
{{ projector.name | translate }}
|
{{ projector.name | translate }}
|
||||||
<i ng-show="projector.id == broadcast" class="fa fa-star-o spacer-left"></i>
|
<i ng-show="projector.id == broadcast" class="fa fa-star-o spacer-left"></i>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -82,8 +83,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<!-- projector control buttons -->
|
<!-- projector control buttons -->
|
||||||
<div os-perms="core.can_manage_projector">
|
<div os-perms="core.can_manage_projector" class="nobr">
|
||||||
|
|
||||||
<!-- edit -->
|
<!-- edit -->
|
||||||
<a ng-click="editCurrentSlide(active_projector)"
|
<a ng-click="editCurrentSlide(active_projector)"
|
||||||
class="btn btn-default btn-sm"
|
class="btn btn-default btn-sm"
|
||||||
@ -198,14 +198,9 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input data-ng-model="countdown.default_time" min-sec-format
|
<input data-ng-model="countdown.default_time" min-sec-format
|
||||||
type="text" placeholder="mm:ss" class="form-control input-sm">
|
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>
|
</div>
|
||||||
</div>
|
<button type="submit" title="{{ 'Save' | translate}}"
|
||||||
<button type="submit"
|
|
||||||
title="{{ 'Save' | translate}}"
|
|
||||||
class="btn btn-sm btn-primary">
|
class="btn btn-sm btn-primary">
|
||||||
<i class="fa fa-check"></i>
|
<i class="fa fa-check"></i>
|
||||||
</button>
|
</button>
|
||||||
|
@ -806,6 +806,25 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
});
|
});
|
||||||
$scope.alert = {};
|
$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
|
// Filtering
|
||||||
$scope.filter = osTableFilter.createInstance('MotionTableFilter');
|
$scope.filter = osTableFilter.createInstance('MotionTableFilter');
|
||||||
|
|
||||||
@ -814,7 +833,8 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
state: [],
|
state: [],
|
||||||
category: [],
|
category: [],
|
||||||
motionBlock: [],
|
motionBlock: [],
|
||||||
tag: []
|
tag: [],
|
||||||
|
recommendation: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
$scope.filter.propertyList = ['identifier', 'origin'];
|
$scope.filter.propertyList = ['identifier', 'origin'];
|
||||||
@ -824,6 +844,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
function (motion) {return motion.getReason();},
|
function (motion) {return motion.getReason();},
|
||||||
function (motion) {return motion.category ? motion.category.name : '';},
|
function (motion) {return motion.category ? motion.category.name : '';},
|
||||||
function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';},
|
function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';},
|
||||||
|
function (motion) {return motion.recommendation ? motion.getRecommendationName() : '';},
|
||||||
];
|
];
|
||||||
$scope.filter.propertyDict = {
|
$scope.filter.propertyDict = {
|
||||||
'submitters' : function (submitter) {
|
'submitters' : function (submitter) {
|
||||||
@ -840,7 +861,8 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
state: function (motion) {return motion.state_id;},
|
state: function (motion) {return motion.state_id;},
|
||||||
category: function (motion) {return motion.category_id;},
|
category: function (motion) {return motion.category_id;},
|
||||||
motionBlock: function (motion) {return motion.motion_block_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
|
// Sorting
|
||||||
$scope.sort = osTableSort.createInstance();
|
$scope.sort = osTableSort.createInstance();
|
||||||
@ -864,30 +886,22 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
display_name: 'Last modified'},
|
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
|
// update state
|
||||||
$scope.updateState = function (motion, state_id) {
|
$scope.updateState = function (motion, state_id) {
|
||||||
$http.put('/rest/motions/motion/' + motion.id + '/set_state/', {'state': state_id});
|
$http.put('/rest/motions/motion/' + motion.id + '/set_state/', {'state': state_id});
|
||||||
};
|
};
|
||||||
// reset state
|
// reset state
|
||||||
$scope.reset_state = function (motion) {
|
$scope.resetState = function (motion) {
|
||||||
$http.put('/rest/motions/motion/' + motion.id + '/set_state/', {});
|
$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) {
|
$scope.hasTag = function (motion, tag) {
|
||||||
return _.indexOf(motion.tags_id, tag.id) > -1;
|
return _.indexOf(motion.tags_id, tag.id) > -1;
|
||||||
@ -1166,7 +1180,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
$scope.updateRecommendation = function (recommendation_id) {
|
$scope.updateRecommendation = function (recommendation_id) {
|
||||||
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {'recommendation': recommendation_id});
|
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {'recommendation': recommendation_id});
|
||||||
};
|
};
|
||||||
// reset state
|
// reset recommendation
|
||||||
$scope.resetRecommendation = function () {
|
$scope.resetRecommendation = function () {
|
||||||
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {});
|
$http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {});
|
||||||
};
|
};
|
||||||
|
@ -121,7 +121,7 @@
|
|||||||
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownState">
|
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownState">
|
||||||
<li ng-repeat="state in states" ng-class="state.workflowHeader ? 'dropdown-header' : ''">
|
<li ng-repeat="state in states" ng-class="state.workflowHeader ? 'dropdown-header' : ''">
|
||||||
<a ng-if="state.workflowHeader">
|
<a ng-if="state.workflowHeader">
|
||||||
{{ state.name | translate }}
|
{{ state.headername | translate }}
|
||||||
</a>
|
</a>
|
||||||
<a href ng-if="!state.workflowHeader"
|
<a href ng-if="!state.workflowHeader"
|
||||||
ng-click="filter.operateMultiselectFilter('state', state.id, isSelectMode)">
|
ng-click="filter.operateMultiselectFilter('state', state.id, isSelectMode)">
|
||||||
@ -179,6 +179,34 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</span>
|
</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 -->
|
<!-- Tag filter -->
|
||||||
<span uib-dropdown ng-if="tags.length > 0">
|
<span uib-dropdown ng-if="tags.length > 0">
|
||||||
<span class="pointer" id="dropdownTag" uib-dropdown-toggle
|
<span class="pointer" id="dropdownTag" uib-dropdown-toggle
|
||||||
@ -284,6 +312,16 @@
|
|||||||
{{ motionBlock.title }}
|
{{ motionBlock.title }}
|
||||||
</span>
|
</span>
|
||||||
</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"
|
<span ng-if="filter.multiselectFilters.motionBlock.indexOf(-1) > -1" class="pointer spacer-left-lg"
|
||||||
ng-click="filter.operateMultiselectFilter('motionBlock', -1, isSelectMode)"
|
ng-click="filter.operateMultiselectFilter('motionBlock', -1, isSelectMode)"
|
||||||
ng-class="{'disabled': isSelectMode}">
|
ng-class="{'disabled': isSelectMode}">
|
||||||
@ -319,6 +357,7 @@
|
|||||||
| MultiselectFilter: filter.multiselectFilters.state : getItemId.state
|
| MultiselectFilter: filter.multiselectFilters.state : getItemId.state
|
||||||
| MultiselectFilter: filter.multiselectFilters.category : getItemId.category
|
| MultiselectFilter: filter.multiselectFilters.category : getItemId.category
|
||||||
| MultiselectFilter: filter.multiselectFilters.motionBlock : getItemId.motionBlock
|
| MultiselectFilter: filter.multiselectFilters.motionBlock : getItemId.motionBlock
|
||||||
|
| MultiselectFilter: filter.multiselectFilters.recommendation : getItemId.recommendation
|
||||||
| MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag
|
| MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag
|
||||||
| toArray
|
| toArray
|
||||||
| orderBy: sort.column : sort.reverse)">
|
| orderBy: sort.column : sort.reverse)">
|
||||||
@ -340,14 +379,17 @@
|
|||||||
{{ motion.identifier }}
|
{{ motion.identifier }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="id-col-space">
|
||||||
<!-- ID and title -->
|
<!-- ID and title -->
|
||||||
<div>
|
<div>
|
||||||
<strong>
|
<strong>
|
||||||
<a class="title" ui-sref="motions.motion.detail({id: motion.id})">{{ motion.getTitle() }}</a>
|
<a class="title" ui-sref="motions.motion.detail({id: motion.id})">{{ motion.getTitle() }}</a>
|
||||||
</strong>
|
</strong>
|
||||||
<i class="fa fa-paperclip" ng-if="motion.attachments_id.length > 0"></i>
|
<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">
|
<span class="label" ng-class="'label-'+motion.state.css_class">
|
||||||
{{ motion.getStateName() }}
|
{{ motion.getStateName() }}
|
||||||
</span>
|
</span>
|
||||||
@ -359,7 +401,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="divider" ng-if="motion.state.getNextStates().length"></li>
|
<li class="divider" ng-if="motion.state.getNextStates().length"></li>
|
||||||
<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>
|
<i class="fa fa-exclamation-triangle"></i>
|
||||||
<translate>Reset state</translate>
|
<translate>Reset state</translate>
|
||||||
</a>
|
</a>
|
||||||
@ -368,6 +410,31 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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 -->
|
<!-- Submitters -->
|
||||||
<div ng-if="motion.submitters.length">
|
<div ng-if="motion.submitters.length">
|
||||||
<small>
|
<small>
|
||||||
|
Loading…
Reference in New Issue
Block a user