Bugfix: Title change recommendations on the projector

This commit is contained in:
Tobias Hößl 2018-03-09 14:34:09 +01:00
parent 3e3b62bc38
commit 611be75d95
No known key found for this signature in database
GPG Key ID: 1D780C7599C2D2A2
3 changed files with 34 additions and 8 deletions

View File

@ -27,6 +27,13 @@ p.os-split-after {
.diff-box {
padding-top: 0;
}
.diff-box-title {
margin-bottom: 10px;
.description {
font-weight: bold;
}
}
.motion-text.line-numbers-outside {
padding-left: 0;
margin-left: 35px;

View File

@ -30,13 +30,23 @@ angular.module('OpenSlidesApp.motions.projector', [
Motion.bindOne(id, $scope, 'motion');
User.bindAll({}, $scope, 'users');
MotionChangeRecommendation.bindAll({
where: {
motion_version_id: {
'==': id,
},
},
}, $scope, 'change_recommendations');
$scope.$watch(function () {
return MotionChangeRecommendation.lastModified();
}, function () {
$scope.change_recommendations = [];
$scope.title_change_recommendation = null;
MotionChangeRecommendation.filter({
'where': {'motion_version_id': {'==': id}}
}).forEach(function(change) {
if (change.isTextRecommendation()) {
$scope.change_recommendations.push(change);
}
if (change.isTitleRecommendation()) {
$scope.title_change_recommendation = change;
}
});
});
}
]);

View File

@ -68,7 +68,7 @@
<div id="motioncontent" class="scrollcontent">
<!-- Title -->
<div id="title">
<h1>{{ motion.getTitle() }}</h1>
<h1>{{ motion.getTitleWithChanges(mode) }}</h1>
<h2>
<translate>Motion</translate> {{ motion.identifier }}
<span ng-if="motion.versions.length > 1" >| Version {{ motion.getVersion().version_number }}</span>
@ -89,6 +89,15 @@
<!-- Diff View -->
<div ng-if="mode == 'diff'">
<div ng-if="title_change_recommendation" class="diff-box-{{ title_change_recommendation.id }} diff-box-title">
<div class="motion-text motion-text-diff line-numbers-{{ lineNumberMode }}">
<div class="description">
<translate>New title</translate>:
</div>
<div>{{ title_change_recommendation.text }}</div>
</div>
</div>
<!-- The actual diff view -->
<div class="motion-text-with-diffs line-numbers-{{ config('motions_default_line_numbering') }}">
<div ng-repeat="change in (changes = (change_recommendations | orderBy: 'line_from')) ">