diff --git a/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php b/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php index a3fd04ca3..036a50722 100644 --- a/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php +++ b/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php @@ -38,6 +38,7 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf $loader->load('services/menu.yaml'); $loader->load('services/fixtures.yaml'); $loader->load('services/form.yaml'); + $loader->load('services/templating.yaml'); } public function prepend(ContainerBuilder $container) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig index 6c664b314..e9147ed4a 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig @@ -1,4 +1,5 @@ {% import "@ChillDocStore/Macro/macro.html.twig" as m %} +{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
@@ -9,8 +10,10 @@

{{ document.title }}

+ {{ mm.mimeIcon(document.object.type) }} + {% if document.description is not empty %} -
+
{{ document.description }}
{% endif %} @@ -42,26 +45,14 @@ {{ m.download_button(document.object, document.title) }}
  • - {% if not freezed %} - {% set button = { - 'changeIcon': 'fa-unlock', - } %}{# - 'changeClass' string - 'noText' boolean - #} - {# vue component - #} - {{ 'Edit'|trans }} - {% else %} - - {{ 'Update document'|trans }} - + {% if chill_document_is_editable(document.object) %} + {% if not freezed %} + {{ document.object|chill_document_edit_button({'title': document.title|e('html') }) }} + {% else %} + + {{ 'Update document'|trans }} + + {% endif %} {% endif %} {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE', document) and document.course != null %}
  • diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/edit.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/edit.html.twig index e28611701..d7a5325cf 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/edit.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/edit.html.twig @@ -19,7 +19,7 @@ {{ form_row(form.description) }} {{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }} -