Merge pull request #3642 from CatoTH/Bugfix-Title-Recommendations-On-Screen

Bugfix: Title change recommendations on the projector
This commit is contained in:
Emanuel Schütze 2018-03-09 16:26:23 +01:00 committed by GitHub
commit a9e0f36ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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')) ">