Use tinymce editor for motion comment fields.

This commit is contained in:
Emanuel Schütze 2016-11-01 17:35:09 +01:00
parent 4d48f2d8a5
commit 41a4e35592
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>