2015-11-23 21:31:15 +01:00
|
|
|
(function () {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2016-10-01 20:42:44 +02:00
|
|
|
angular.module('OpenSlidesApp.motions.projector', [
|
|
|
|
'OpenSlidesApp.motions',
|
|
|
|
'OpenSlidesApp.motions.motionBlockProjector',
|
|
|
|
])
|
2015-11-23 21:31:15 +01:00
|
|
|
|
2016-01-17 21:16:04 +01:00
|
|
|
.config([
|
|
|
|
'slidesProvider',
|
|
|
|
function(slidesProvider) {
|
|
|
|
slidesProvider.registerSlide('motions/motion', {
|
|
|
|
template: 'static/templates/motions/slide_motion.html',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
])
|
2015-11-23 21:31:15 +01:00
|
|
|
|
2016-01-17 21:16:04 +01:00
|
|
|
.controller('SlideMotionCtrl', [
|
|
|
|
'$scope',
|
|
|
|
'Motion',
|
2016-12-19 10:40:55 +01:00
|
|
|
'MotionChangeRecommendation',
|
2016-01-17 21:16:04 +01:00
|
|
|
'User',
|
2017-02-24 10:31:48 +01:00
|
|
|
function($scope, Motion, MotionChangeRecommendation, User) {
|
2016-01-17 21:16:04 +01:00
|
|
|
// Attention! Each object that is used here has to be dealt on server side.
|
|
|
|
// Add it to the coresponding get_requirements method of the ProjectorElement
|
|
|
|
// class.
|
|
|
|
var id = $scope.element.id;
|
2016-12-19 10:40:55 +01:00
|
|
|
$scope.mode = $scope.element.mode || 'original';
|
|
|
|
|
2016-09-29 15:32:58 +02:00
|
|
|
Motion.bindOne(id, $scope, 'motion');
|
2016-01-25 21:22:22 +01:00
|
|
|
User.bindAll({}, $scope, 'users');
|
2018-03-09 14:34:09 +01:00
|
|
|
|
|
|
|
$scope.$watch(function () {
|
|
|
|
return MotionChangeRecommendation.lastModified();
|
|
|
|
}, function () {
|
|
|
|
$scope.change_recommendations = [];
|
|
|
|
$scope.title_change_recommendation = null;
|
2018-04-06 14:24:52 +02:00
|
|
|
if ($scope.motion) {
|
|
|
|
MotionChangeRecommendation.filter({
|
|
|
|
'where': {'motion_version_id': {'==': $scope.motion.active_version}}
|
|
|
|
}).forEach(function(change) {
|
|
|
|
if (change.isTextRecommendation()) {
|
|
|
|
$scope.change_recommendations.push(change);
|
|
|
|
}
|
|
|
|
if (change.isTitleRecommendation()) {
|
|
|
|
$scope.title_change_recommendation = change;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2018-03-09 14:34:09 +01:00
|
|
|
});
|
2016-01-17 21:16:04 +01:00
|
|
|
}
|
|
|
|
]);
|
2015-11-23 21:31:15 +01:00
|
|
|
|
|
|
|
}());
|