diff --git a/CHANGELOG.md b/CHANGELOG.md index 54447b427..ec08870d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,21 @@ and this project adheres to * [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377) +* [notification: formulaire création] descend la box avec la description dans le bas du formulaire +* [notification for activity]: fix link to activity +* [notification] add "URGENT" before accompanying course with emergency = true +* [notification] add a "read more" button on system notification +* [notification] add `[Chill]` in the subject of each notification, automatically +* [notification] add a counter for notification in activity list and accompanying period list, and search results +* [parcours] bugfix if deathdate is not defined (eg. for a thirdparty) parcours is still displayed. Gave error before. +* [workflow] add breadcrumb to show steps +* [popover] add popover html popup mechanism (used by workflow breadcrumb) +* [templates] improve updatedBy macro in item metadatas +* [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385) +* [workflow] + * add My workflow section with my opened subscriptions + * apply workflow on documents, accompanyingCourseWork and Evaluations +* [wopi-link] a new vue component allow to open wopi link in a fullscreen chill-themed modal ## Test releases @@ -21,7 +36,6 @@ and this project adheres to * [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246) * [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176) * [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380) -* [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385) ### test release 2022-01-17 diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 6db1f6945..2947fda38 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -31,6 +31,7 @@ use DateTime; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Psr\Log\LoggerInterface; +use RuntimeException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; @@ -38,8 +39,8 @@ use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Role\Role; -use Symfony\Component\Serializer\SerializerInterface; +use Symfony\Component\Serializer\SerializerInterface; use function array_key_exists; final class ActivityController extends AbstractController @@ -471,20 +472,21 @@ final class ActivityController extends AbstractController public function showAction(Request $request, int $id): Response { - $view = null; + $entity = $this->activityRepository->find($id); - [$person, $accompanyingPeriod] = $this->getEntity($request); + if (null === $entity) { + throw $this->createNotFoundException('Unable to find Activity entity.'); + } + + $accompanyingPeriod = $entity->getAccompanyingPeriod(); + $person = $entity->getPerson(); if ($accompanyingPeriod instanceof AccompanyingPeriod) { $view = 'ChillActivityBundle:Activity:showAccompanyingCourse.html.twig'; } elseif ($person instanceof Person) { $view = 'ChillActivityBundle:Activity:showPerson.html.twig'; - } - - $entity = $this->activityRepository->find($id); - - if (null === $entity) { - throw $this->createNotFoundException('Unable to find Activity entity.'); + } else { + throw new RuntimeException('the activity should be linked with a period or person'); } if (null !== $accompanyingPeriod) { @@ -493,8 +495,7 @@ final class ActivityController extends AbstractController $entity->personsNotAssociated = $entity->getPersonsNotAssociated(); } - // TODO revoir le Voter de Activity pour tenir compte qu'une activité peut appartenir a une période - // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity); + $this->denyAccessUnlessGranted(ActivityVoter::SEE, $entity); $deleteForm = $this->createDeleteForm($entity->getId(), $person, $accompanyingPeriod); diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 77f650ce4..b8534de52 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Entity; use Chill\ActivityBundle\Validator\Constraints as ActivityValidator; use Chill\DocStoreBundle\Entity\Document; +use Chill\DocStoreBundle\Entity\StoredObject; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\HasCenterInterface; @@ -61,13 +62,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?AccompanyingPeriod $accompanyingPeriod = null; /** * @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) * @SerializedName("activityType") * @ORM\JoinColumn(name="type_id") */ @@ -107,13 +108,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * @ORM\Id * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?int $id = null; /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location") - * @groups({"read"}) + * @groups({"read", "docgen:read"}) */ private ?Location $location = null; @@ -124,7 +125,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?Collection $persons = null; @@ -146,20 +147,20 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private Collection $socialActions; /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private Collection $socialIssues; /** * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?Collection $thirdParties = null; @@ -191,7 +192,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac $this->socialActions = new ArrayCollection(); } - public function addDocument(Document $document): self + public function addDocument(StoredObject $document): self { $this->documents[] = $document; @@ -425,7 +426,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this->getEmergency(); } - public function removeDocument(Document $document): void + public function removeDocument(StoredObject $document): void { $this->documents->removeElement($document); } diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig index 09a7ab2a3..6b2e33dfb 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig @@ -143,9 +143,17 @@
- +
+ {% set notif_counter = chill_count_notifications('Chill\\ActivityBundle\\Entity\\Activity', activity.id) %} + {% if notif_counter.total > 0 %} + {{ chill_counter_notifications('Chill\\ActivityBundle\\Entity\\Activity', activity.id) }} + {% endif %} +
+
+ +
diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig index 33575cea6..d9d72845a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig @@ -8,7 +8,7 @@ action: 'show', displayBadge: true, targetEntity: { name: type, id: entity.id }, buttonText: entity|chill_entity_render_string, - isDead: entity.deathdate is not null, + isDead: entity.deathdate is defined and entity.deathdate is not null, parent: parent } %} {% endmacro %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig index 235a5b7f2..a59c596c3 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig @@ -83,15 +83,15 @@ {{ form_row(edit_form.comment) }} {% endif %} -{%- if edit_form.documents is defined -%} - {{ form_row(edit_form.documents) }} -{% endif %} - {%- if edit_form.attendee is defined -%} {{ form_row(edit_form.attendee) }} {% endif %} -{# TODO .. status #} +{%- if edit_form.documents is defined -%} + {{ form_row(edit_form.documents) }} +{% endif %} + +
{% set person_id = null %} {% if entity.person %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig index b278c0300..09ff16fec 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig @@ -24,10 +24,12 @@ window.activity = {{ activity_json|json_encode|raw }}; {{ encore_entry_script_tags('vue_activity') }} + {{ encore_entry_script_tags('mod_docgen_picktemplate') }} {% endblock %} {% block css %} {{ parent() }} {{ encore_entry_link_tags('mod_async_upload') }} {{ encore_entry_link_tags('vue_activity') }} + {{ encore_entry_link_tags('mod_docgen_picktemplate') }} {% endblock %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig index 82c7403c6..72c74c68e 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig @@ -39,9 +39,11 @@ window.activity = {{ activity_json|json_encode|raw }}; {{ encore_entry_script_tags('vue_activity') }} + {{ encore_entry_script_tags('mod_docgen_picktemplate') }} {% endblock %} {% block css %} {{ encore_entry_link_tags('mod_async_upload') }} {{ encore_entry_link_tags('vue_activity') }} + {{ encore_entry_link_tags('mod_docgen_picktemplate') }} {% endblock %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig index a64142863..7ae24fa4b 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig @@ -1,58 +1,60 @@ {% macro recordAction(activity, context = null, person_id = null, accompanying_course_id = null) %} - {% if no_action is not defined or no_action == false %} -
  • - {{ 'notification.Notify'|trans }} -
  • - {% endif %} - {% if context == 'person' and activity.accompanyingPeriod is not empty %} - {# - Disable person_id in following links, for redirect to accompanyingCourse context - #} - {% set person_id = null %} - {% set accompanying_course_id = activity.accompanyingPeriod.id %} -
  • - - - {{ 'Period number %number%'|trans({'%number%': accompanying_course_id}) }} - -
  • - {% endif %} -
  • - -
  • - {% if no_action is not defined or no_action == false %} - {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %} + {% if is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %} + {% if no_action is not defined or no_action == false %}
  • - + {{ 'notification.Notify'|trans }}
  • {% endif %} - {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %} + {% if context == 'person' and activity.accompanyingPeriod is not empty %} + {# + Disable person_id in following links, for redirect to accompanyingCourse context + #} + {% set person_id = null %} + {% set accompanying_course_id = activity.accompanyingPeriod.id %}
  • - + class="btn btn-primary" + title="{{ 'See activity in accompanying course context'|trans }}"> + + {{ 'Period number %number%'|trans({'%number%': accompanying_course_id}) }} +
  • {% endif %} +
  • + +
  • + {% if no_action is not defined or no_action == false %} + {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %} +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %} +
  • + +
  • + {% endif %} + {% endif %} {% endif %} {% endmacro %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index b67ff08ef..546ba99ce 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -86,7 +86,7 @@ {% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with { 'context': context, 'render': 'bloc', - 'badge_person': 'true' + 'badge_person': true } %}

    {{ 'Activity data'|trans }}

    diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php new file mode 100644 index 000000000..c23607337 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -0,0 +1,223 @@ +documentCategoryRepository = $documentCategoryRepository; + $this->normalizer = $normalizer; + $this->translatableStringHelper = $translatableStringHelper; + $this->em = $em; + $this->personRender = $personRender; + $this->translator = $translator; + $this->baseContextData = $baseContextData; + } + + public function adminFormReverseTransform(array $data): array + { + return $data; + } + + public function adminFormTransform(array $data): array + { + return [ + 'mainPerson' => $data['mainPerson'] ?? false, + 'mainPersonLabel' => $data['mainPersonLabel'] ?? $this->translator->trans('docgen.Main person'), + 'person1' => $data['person1'] ?? false, + 'person1Label' => $data['person1Label'] ?? $this->translator->trans('docgen.person 1'), + 'person2' => $data['person2'] ?? false, + 'person2Label' => $data['person2Label'] ?? $this->translator->trans('docgen.person 2'), + ]; + } + + public function buildAdminForm(FormBuilderInterface $builder): void + { + $builder + ->add('mainPerson', CheckboxType::class, [ + 'required' => false, + 'label' => 'docgen.Ask for main person', + ]) + ->add('mainPersonLabel', TextType::class, [ + 'label' => 'main person label', + 'required' => true, + ]) + ->add('person1', CheckboxType::class, [ + 'required' => false, + 'label' => 'docgen.Ask for person 1', + ]) + ->add('person1Label', TextType::class, [ + 'label' => 'person 1 label', + 'required' => true, + ]) + ->add('person2', CheckboxType::class, [ + 'required' => false, + 'label' => 'docgen.Ask for person 2', + ]) + ->add('person2Label', TextType::class, [ + 'label' => 'person 2 label', + 'required' => true, + ]); + } + + /** + * @param Activity $entity + */ + public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void + { + $options = $template->getOptions(); + $persons = $entity->getPersons(); + + foreach (['mainPerson', 'person1', 'person2'] as $key) { + if ($options[$key] ?? false) { + $builder->add($key, EntityType::class, [ + 'class' => Person::class, + 'choices' => $persons, + 'choice_label' => function (Person $p) { + return $this->personRender->renderString($p, []); + }, + 'multiple' => false, + 'expanded' => true, + 'label' => $options[$key . 'Label'], + ]); + } + } + } + + public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array + { + if (!$entity instanceof Activity) { + throw new UnexpectedTypeException($entity, Activity::class); + } + $options = $template->getOptions(); + + $data = []; + $data = array_merge($data, $this->baseContextData->getData()); + $data['activity'] = $this->normalizer->normalize($entity, 'docgen', ['docgen:expects' => Activity::class, 'groups' => 'docgen:read']); + + $data['course'] = $this->normalizer->normalize($entity->getAccompanyingPeriod(), 'docgen', ['docgen:expects' => AccompanyingPeriod::class, 'groups' => 'docgen:read']); + $data['person'] = $this->normalizer->normalize($entity->getPerson(), 'docgen', ['docgen:expects' => Person::class, 'groups' => 'docgen:read']); + + foreach (['mainPerson', 'person1', 'person2'] as $k) { + if ($options[$k]) { + $data[$k] = $this->normalizer->normalize($contextGenerationData[$k], 'docgen', [ + 'docgen:expects' => Person::class, + 'groups' => 'docgen:read', + 'docgen:person:with-household' => true, + 'docgen:person:with-relations' => true, + ]); + } + } + + return $data; + } + + public function getDescription(): string + { + return 'docgen.A basic context for activity'; + } + + public function getEntityClass(): string + { + return Activity::class; + } + + public function getFormData(DocGeneratorTemplate $template, $entity): array + { + return [ + 'activity' => $entity, + ]; + } + + public static function getKey(): string + { + return self::class; + } + + public function getName(): string + { + return 'docgen.Activity basic'; + } + + public function hasAdminForm(): bool + { + return true; + } + + public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool + { + $options = $template->getOptions(); + + return $options['mainPerson'] || $options['person1'] || $options['person2']; + } + + /** + * @param Activity $entity + */ + public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void + { + $doc = new StoredObject(); + // TODO push document to remote + + $this->em->persist($doc); + + $entity->addDocument($doc); + } +} diff --git a/src/Bundle/ChillActivityBundle/config/services.yaml b/src/Bundle/ChillActivityBundle/config/services.yaml index 1ca413f0e..23f00ed4e 100644 --- a/src/Bundle/ChillActivityBundle/config/services.yaml +++ b/src/Bundle/ChillActivityBundle/config/services.yaml @@ -32,3 +32,8 @@ services: autowire: true autoconfigure: true resource: '../Validator/Constraints/' + + Chill\ActivityBundle\Service\DocGenerator\: + autowire: true + autoconfigure: true + resource: '../Service/DocGenerator/' diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index ed7de9c66..81a34d47d 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -228,3 +228,7 @@ See activity in accompanying course context: Voir l'activité dans le contexte d You get notified of an activity which does not exists any more: Cette notification ne correspond pas à une activité valide. you are not allowed to see it details: La notification fait référence à une activité à laquelle vous n'avez pas accès. This is the minimal activity data: Activité n° + +docgen: + Activity basic: Echange + A basic context for activity: Contexte pour les échanges diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig new file mode 100644 index 000000000..4ec11a8e8 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig @@ -0,0 +1,52 @@ +{% import "@ChillDocStore/Macro/macro.html.twig" as m %} + +
    +
    +
    +
    + +
    +
    +

    {{ document.title }}

    + {{ document.object.type }} + + {% if document.description is not empty %} +
    + {{ document.description }} +
    + {% endif %} + +
    +
    +
    +
    + +{% if display_action is defined and display_action == true %} + +{% endif %} \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.title.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.title.html.twig new file mode 100644 index 000000000..e3c1dc50a --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.title.html.twig @@ -0,0 +1,19 @@ +{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %} + +
    +
    + {% if concerne is defined and concerne == true %} + {{ 'Concerne'|trans }}: + {% endif %} + + {{ 'workflow.Document (n°%doc%)'|trans({'%doc%': document.id}) }} + + {% if description is defined and description == true %} + {{ ' — ' ~ document.title }} + {% endif %} +
    + + {% if breadcrumb is defined and breadcrumb == true %} + {{ m.breadcrumb(_context) }} + {% endif %} +
    \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig index 97299675a..9d6175e12 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig @@ -6,61 +6,71 @@ {% block title %} {# {{ 'Detail of document of %name%'|trans({ '%name%': accompanyingCourse|chill_entity_render_string } ) }} #} -{% endblock %} - - -{% block js %} - {{ parent() }} - {{ encore_entry_script_tags('mod_async_upload') }} + {{ 'Document %title%' | trans({ '%title%': document.title }) }} {% endblock %} {% block css %} {{ parent() }} {{ encore_entry_link_tags('mod_async_upload') }} + {{ encore_entry_link_tags('mod_entity_workflow_pick') }} {% endblock %} {% block content %} - -

    {{ 'Document %title%' | trans({ '%title%': document.title }) }}

    - -
    -
    {{ 'Title'|trans }}
    -
    {{ document.title }}
    - +
    +

    {{ block('title') }}

    + +
    +
    {{ 'Title'|trans }}
    +
    {{ document.title }}
    + {% if document.category is not null %}
    {{ 'Category'|trans }}
    {{ document.category.name|localize_translatable_string }}
    {% endif %} + +
    {{ 'Description' | trans }}
    +
    + {% if document.description is empty %} + {{ 'Any description'|trans }} + {% else %} +
    + {{ document.description|chill_markdown_to_html }} +
    + {% endif %} +
    +
    + + +
    +{% endblock %} + +{% block block_post_menu %} +
    + {% set workflows_frame = chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) %} + {% if workflows_frame is not empty %} + {{ workflows_frame|raw }} + {% endif %} +
    +{% endblock %} -
    {{ 'Description' | trans }}
    -
    - {% if document.description is empty %} - {{ 'Any description'|trans }} - {% else %} -
    - {{ document.description|chill_markdown_to_html }} -
    - {% endif %} -
    - -
    - -