diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig index 73749dc29..543d0bf34 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig @@ -50,15 +50,21 @@
  • {{ m.download_button(document.object, document.title) }}
  • + {% if chill_document_is_editable(document.object) %} +
  • + {{ document.object|chill_document_edit_button({ + 'changeIcon': 'fa-paragraph', + 'changeClass': 'btn-update', + 'noText': false + }) }} +
  • + {% endif %} {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
  • {% endif %} - {% if chill_document_is_editable(document.object) %} -
  • {{ document.object|chill_document_edit_button }}
  • - {% endif %} {% set workflows_frame = chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) %} {% if workflows_frame is not empty %}
  • diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/Button/wopi_edit_document.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/Button/wopi_edit_document.html.twig index 1bd895a0f..1562effc7 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/Button/wopi_edit_document.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/Button/wopi_edit_document.html.twig @@ -1,11 +1,6 @@ -{% set button = { - 'changeIcon': 'fa-magic', - 'changeClass': 'btn-primary' -} %}{# - 'noText': false -#} + diff --git a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php index 35efb31ac..81327f521 100644 --- a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php @@ -20,10 +20,11 @@ class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface public const TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig'; - public function renderEditButton(Environment $environment, StoredObject $document): string + public function renderEditButton(Environment $environment, StoredObject $document, ?Array $options = null): string { return $environment->render(self::TEMPLATE, [ - 'document' => $document + 'document' => $document, + 'options' => $options ]); } } \ No newline at end of file