mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
apply ckeditor on multiple entities
Apply ckeditor into: * activity; * task; * document; * accompanying periods
This commit is contained in:
parent
66e590972a
commit
b79ec18a38
@ -15,7 +15,6 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTra
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Chill\ActivityBundle\Form\Type\TranslatableActivityType;
|
||||
use Chill\ActivityBundle\Form\Type\TranslatableActivityReason;
|
||||
use Chill\MainBundle\Form\Type\UserPickerType;
|
||||
|
@ -46,12 +46,7 @@
|
||||
<td>{{ activity.durationTime|date('H:i') }}</td>
|
||||
<td>
|
||||
{% if activity.comment.comment is not empty %}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ activity.comment.comment|slice(0, 250) }} {#
|
||||
sf4 check: if 'slice' could replace 'truncate' filter ?
|
||||
truncate come with twig-extensions, in conflict with twig 3
|
||||
#}
|
||||
</blockquote>
|
||||
{{ activity.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
|
||||
{% endif %}
|
||||
{%- if activity.reasons is empty -%}
|
||||
{{ 'No reason associated'|trans }}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
{% if is_granted(constant('Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter::SEE_DETAILS'), activity) %}
|
||||
<dl class="chill_view_data">
|
||||
<dd>{% if activity.comment.comment is empty %}{{ 'No comments'|trans }}{% else %}<blockquote class="chill-user-quote">{{ activity.comment.comment|nl2br }}</blockquote>{% endif %}</dd>
|
||||
<dd>{% if activity.comment.comment is empty %}{{ 'No comments'|trans }}{% else %}{{ activity.comment|chill_entity_render_box({'metadata': false}) }}{% endif %}</dd>
|
||||
|
||||
<dt class="inline">{{ 'Reasons'|trans }}</dt>
|
||||
{%- if activity.reasons is empty -%}
|
||||
|
@ -4,7 +4,6 @@ namespace Chill\DocStoreBundle\Form;
|
||||
|
||||
|
||||
use Chill\DocStoreBundle\Entity\Document;
|
||||
use Chill\DocStoreBundle\Entity\DocumentCategory;
|
||||
use Chill\DocStoreBundle\Entity\PersonDocument;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -12,15 +11,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Chill\MainBundle\Form\Type\AppendScopeChoiceTypeTrait;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\ScopePickerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||
|
||||
|
||||
class PersonDocumentType extends AbstractType
|
||||
@ -62,7 +59,7 @@ class PersonDocumentType extends AbstractType
|
||||
{
|
||||
$builder
|
||||
->add('title', TextType::class)
|
||||
->add('description', TextareaType::class, [
|
||||
->add('description', ChillTextareaType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('object', StoredObjectType::class, [
|
||||
|
@ -45,7 +45,7 @@
|
||||
<span class="chill-no-data-statement">{{ 'Any description'|trans }}</span>
|
||||
{% else %}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ document.description }}
|
||||
{{ document.description|chill_markdown_to_html }}
|
||||
</blockquote>
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
@ -20,7 +20,7 @@ namespace Chill\MainBundle\Form\Type;
|
||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
@ -44,8 +44,8 @@ class CommentType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('comment', TextareaType::class, [
|
||||
|
||||
->add('comment', ChillTextareaType::class, [
|
||||
'disable_editor' => $options['disable_editor']
|
||||
])
|
||||
;
|
||||
|
||||
@ -72,8 +72,12 @@ class CommentType extends AbstractType
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
$resolver
|
||||
->setDefined('disable_editor')
|
||||
->setAllowedTypes('disable_editor', 'bool')
|
||||
->setDefaults([
|
||||
'data_class' => CommentEmbeddable::class,
|
||||
'disable_editor' => false
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -2,3 +2,7 @@
|
||||
.ck-editor__editable {
|
||||
min-height: 150px;
|
||||
}
|
||||
|
||||
.ck-editor.ck-reset {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
@ -6,17 +6,16 @@ use Chill\MainBundle\Entity\Center;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Chill\MainBundle\Form\Type\UserPickerType;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Chill\PersonBundle\Form\Type\ClosingMotivePickerType;
|
||||
|
||||
|
||||
/**
|
||||
* Class AccompanyingPeriodType
|
||||
*
|
||||
@ -89,7 +88,7 @@ class AccompanyingPeriodType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
$builder->add('remark', TextareaType::class, [
|
||||
$builder->add('remark', ChillTextareaType::class, [
|
||||
'required' => false
|
||||
]);
|
||||
}
|
||||
|
@ -48,8 +48,13 @@
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
|
||||
{{ accompanying_period.remark|chill_print_or_message('No remark', 'blockquote') }}
|
||||
{% if accompanying_period is not empty %}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ accompanying_period.remark|chill_markdown_to_html }}
|
||||
</blockquote>
|
||||
{% else %}
|
||||
{{ null|chill_print_or_message('No remark', 'blockquote') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
|
@ -22,15 +22,12 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Chill\MainBundle\Form\Type\UserPickerType;
|
||||
use Chill\MainBundle\Form\Type\ScopePickerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Chill\TaskBundle\Security\Authorization\TaskVoter;
|
||||
use Chill\MainBundle\Form\Type\DateIntervalType;
|
||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -43,7 +40,7 @@ class SingleTaskType extends AbstractType
|
||||
{
|
||||
$builder
|
||||
->add('title', TextType::class)
|
||||
->add('description', TextareaType::class, [
|
||||
->add('description', ChillTextareaType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('assignee', UserPickerType::class, [
|
||||
|
@ -37,7 +37,7 @@
|
||||
<span class="chill-no-data-statement">{{"No description"|trans}}</span>
|
||||
{% else %}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ task.description }}
|
||||
{{ task.description|chill_markdown_to_html }}
|
||||
</blockquote>
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<dt class="inline">{{ 'Description'|trans }}</dt>
|
||||
<dd>
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ event.task.description }}
|
||||
{{ event.task.description|chill_markdown_to_html }}
|
||||
</blockquote>
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user