diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig index 0d4a7d637..f341f2946 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig @@ -19,7 +19,7 @@ {% endblock %} {% block content %} -
+

{{ 'Documents' }}

{% if documents|length == 0 %} @@ -27,7 +27,7 @@ {% else %}
{% for document in documents %} - {% include 'ChillDocStoreBundle:List:list_item.html.twig' %} + {% include '@ChillDocStore/List/list_item.html.twig' %} {% endfor %}
{% endif %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig index 358127bfb..59dabdc4a 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig @@ -1,8 +1,10 @@ {% import "@ChillDocStore/Macro/macro.html.twig" as m %} {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} +{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %} +
-
+
{{ document.title }}
@@ -30,54 +32,50 @@
{% if document.description is not empty %} -
-
+
+
{{ document.description|chill_markdown_to_html }}
{% endif %}
-
- {{ 'Created by'|trans }}: - {{ document.createdBy|chill_entity_render_string }} - le {{ document.createdAt|format_date('long') }} -
+ {{ mmm.createdBy(document) }} +
+
+ {% if document.course is defined %} +
    + {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %} +
  • + {{ m.download_button(document.object, document.title) }} +
  • +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %} +
  • + +
  • + {% endif %} +
+ {% else %} +
    + {% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %} +
  • + {{ m.download_button(document.object, document.title) }} +
  • +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document) %} +
  • + +
  • + {% endif %} +
+ {% endif %}
-
- {% if document.course is defined %} -
    - {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %} -
  • - {{ m.download_button(document.object, document.title) }} -
  • -
  • - -
  • - {% endif %} - {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %} -
  • - -
  • - {% endif %} -
- {% else %} -
    - {% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %} -
  • - {{ m.download_button(document.object, document.title) }} -
  • -
  • - -
  • - {% endif %} - {% if is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document) %} -
  • - -
  • - {% endif %} -
- {% endif %} -
diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index d3173bd7c..78659c819 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -356,6 +356,7 @@ By: Par For: Pour Created for: Créé pour Created by: Créé par +Created on: Créé le # Workflows 💊 diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Macro/updatedBy.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Macro/updatedBy.html.twig index a0be22ffc..e40cbd3f7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Macro/updatedBy.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Macro/updatedBy.html.twig @@ -3,10 +3,27 @@ {{ 'Last updated on'|trans }} {{ entity.updatedAt|format_datetime('medium', 'short') }} - , - {{ 'by_user'|trans }} - - {{ entity.updatedBy|chill_entity_render_box }} + {% if entity.updatedBy %} + {{ ', ' ~ 'by_user'|trans }} + + {{ entity.updatedBy|chill_entity_render_box }} + + {% endif %} +
+{% endmacro %} + +{% macro createdBy(entity) %} +
+ {{ 'Created on'|trans }} + + {{ entity.createdAt|format_datetime('medium', 'short') }} + + {% if entity.createdBy %} + {{ ', ' ~ 'by_user'|trans }} + + {{ entity.createdBy|chill_entity_render_string }} + + {% endif %}
{% endmacro %} \ No newline at end of file