Merge pull request #3000 from emanuelschuetze/reject-change-recommendations

Added 'reject all change recommendations' button.
This commit is contained in:
Norman Jäckel 2017-02-24 09:58:03 +01:00 committed by GitHub
commit bebdcaf6b9
2 changed files with 19 additions and 0 deletions

View File

@ -467,6 +467,16 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions',
MotionChangeRecommendation.destroy(changeId); MotionChangeRecommendation.destroy(changeId);
}; };
obj.rejectAll = function (motion) {
var changeRecommendations = MotionChangeRecommendation.filter({
'where': {'motion_version_id': {'==': motion.active_version}}
});
_.forEach(changeRecommendations, function(change) {
change.rejected = true;
change.saveStatus();
});
};
obj.repositionOriginalAnnotations = function () { obj.repositionOriginalAnnotations = function () {
var $changeRecommendationList = $('.change-recommendation-list'), var $changeRecommendationList = $('.change-recommendation-list'),
$lineNumberReference = $('.motion-text-original'); $lineNumberReference = $('.motion-text-original');

View File

@ -3,6 +3,14 @@
<strong> <strong>
<translate>Summary of change recommendations</translate>: <translate>Summary of change recommendations</translate>:
</strong> </strong>
<button class="btn btn-sm btn-default pull-right"
uib-tooltip="{{ 'Note: You have to reject all change recommendations if the plenum does not follow the recommendation.' | translate }}"
ng-click="viewChangeRecommendations.rejectAll(motion)">
<i class="fa fa-thumbs-down"></i>
<translate>Reject all change recommendations</translate>
</button>
<ul ng-if="change_recommendations.length > 0"> <ul ng-if="change_recommendations.length > 0">
<li ng-repeat="change in (changes = (change_recommendations | filter:{motion_version_id:version}:true | orderBy: 'line_from')) "> <li ng-repeat="change in (changes = (change_recommendations | filter:{motion_version_id:version}:true | orderBy: 'line_from')) ">
<a href='' ng-click="viewChangeRecommendations.scrollToDiffBox(change.id)"> <a href='' ng-click="viewChangeRecommendations.scrollToDiffBox(change.id)">
@ -23,6 +31,7 @@
</a> </a>
</li> </li>
</ul> </ul>
<div ng-if="change_recommendations.length == 0" class="no-changes"> <div ng-if="change_recommendations.length == 0" class="no-changes">
<translate>No change recommendations yet</translate> <translate>No change recommendations yet</translate>
</div> </div>