Exclude special comments in comment field settings; fixing the inline editiing
This commit is contained in:
parent
2aeaf251a2
commit
a12440ed2c
@ -741,6 +741,15 @@ angular.module('OpenSlidesApp.core.site', [
|
||||
}
|
||||
])
|
||||
|
||||
.filter('excludeSpecialComments', function () {
|
||||
return function (comments) {
|
||||
return _.filter(comments, function (comment) {
|
||||
var specialComment = comment.forState || comment.forRecommendation;
|
||||
return !specialComment;
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
// angular formly config options
|
||||
.run([
|
||||
'formlyConfig',
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
<!-- comments -->
|
||||
<div class="input-comments" ng-if="type === 'comments'">
|
||||
<div ng-repeat="entry in $parent.value" class="input-group">
|
||||
<div ng-repeat="entry in $parent.value | excludeSpecialComments" class="input-group">
|
||||
<input ng-model="entry.name"
|
||||
ng-model-options="{debounce: 1000}"
|
||||
ng-change="save(configOption, $parent.value)"
|
||||
|
@ -134,7 +134,7 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions',
|
||||
var commentsInlineEditing = {
|
||||
editors: []
|
||||
};
|
||||
_.forEach($scope.commentsFields, function (field) {
|
||||
_.forEach($scope.commentsFieldsNoSpecialComments, function (field) {
|
||||
var inlineEditing = MotionInlineEditing.createInstance($scope, motion,
|
||||
'view-original-comment-inline-editor-' + field.name, false,
|
||||
function (obj) {
|
||||
|
@ -1268,6 +1268,10 @@ angular.module('OpenSlidesApp.motions.site', [
|
||||
}
|
||||
};
|
||||
$scope.commentsFields = Config.get('motions_comments').value;
|
||||
$scope.commentsFieldsNoSpecialComments = _.filter($scope.commentsFields, function (field) {
|
||||
var specialComment = field.forState || field.forRecommendation;
|
||||
return !specialComment;
|
||||
});
|
||||
$scope.commentFieldForState = MotionComment.getFieldNameForFlag('forState');
|
||||
$scope.commentFieldForRecommendation = MotionComment.getFieldNameForFlag('forRecommendation');
|
||||
$scope.version = motion.active_version;
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="details" ng-if="isAllowedToSeeCommentField()">
|
||||
<div class="details" ng-if="isAllowedToSeeCommentField() && commentsFieldsNoSpecialComments.length">
|
||||
<div class="row">
|
||||
<!-- inline editing toolbar -->
|
||||
<div class="motion-toolbar">
|
||||
@ -25,9 +25,8 @@
|
||||
</div>
|
||||
<!-- comment fields -->
|
||||
<div class="col-sm-12">
|
||||
<div ng-repeat="field in commentsFields">
|
||||
<div ng-if="(field.public && !field.forState && !field.forRecommendation) ||
|
||||
(operator.hasPerms('motions.can_see_and_manage_comments') && !field.forState && !field.forRecommendation)">
|
||||
<div ng-repeat="field in commentsFieldsNoSpecialComments">
|
||||
<div ng-if="operator.hasPerms('motions.can_see_and_manage_comments') && !field.forState && !field.forRecommendation">
|
||||
<h4>
|
||||
{{ field.name }}
|
||||
<span ng-if="!field.public" class="label label-warning" translate>internal</span>
|
||||
|
Loading…
Reference in New Issue
Block a user