Merge pull request #2562 from emanuelschuetze/comments-editor

Use tinymce editor for motion comment fields.
This commit is contained in:
Norman Jäckel 2016-11-01 22:54:58 +01:00 committed by GitHub
commit 378fb46fb2
2 changed files with 13 additions and 8 deletions

View File

@ -444,7 +444,8 @@ angular.module('OpenSlidesApp.motions', [
.factory('MotionComment', [ .factory('MotionComment', [
'Config', 'Config',
'operator', 'operator',
function (Config, operator) { 'Editor',
function (Config, operator, Editor) {
return { return {
getFormFields: function () { getFormFields: function () {
var fields = Config.get('motions_comments').value; var fields = Config.get('motions_comments').value;
@ -453,10 +454,13 @@ angular.module('OpenSlidesApp.motions', [
function (field) { function (field) {
return { return {
key: 'comment ' + field.name, key: 'comment ' + field.name,
type: 'input', type: 'editor',
templateOptions: { templateOptions: {
label: field.name, label: field.name,
}, },
data: {
tinymceOption: Editor.getOptions()
},
hide: !operator.hasPerms("motions.can_see_and_manage_comments") hide: !operator.hasPerms("motions.can_see_and_manage_comments")
}; };
} }

View File

@ -407,11 +407,12 @@
<div class="details" ng-if="isAllowedToSeeCommentField()"> <div class="details" ng-if="isAllowedToSeeCommentField()">
<h3>Motion Comments</h3> <h3>Motion Comments</h3>
<div ng-repeat="field in commentsFields"> <div ng-repeat="field in commentsFields">
<p ng-if="field.public || operator.hasPerms('motions.can_see_and_manage_comments')"> <div ng-if="field.public || operator.hasPerms('motions.can_see_and_manage_comments')">
<b>{{ field.name }}:</b> <h4>
<span ng-if="!field.public" class="label label-warning" translate>internal</span> {{ field.name }}
<br> <span ng-if="!field.public" class="label label-warning" translate>internal</span>
{{ motion.comments[$index] }} </h4>
</p> <div ng-bind-html="motion.comments[$index]"></div>
</div>
</div> </div>
</div> </div>