diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig index 893f504bc..a0c60d9b3 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig @@ -2,8 +2,6 @@ {% set activeRouteKey = '' %} -{% import "@ChillDocStore/Macro/macro.html.twig" as m %} - {% block title %} {{ 'Documents' }} {% endblock %} @@ -21,51 +19,20 @@ {% endblock %} {% block content %} +

{{ 'Documents' }}

- - - - - - - - - - + {% if documents|length == 0 %} +

{{ 'No documents'|trans }}

+ {% else %} +
{% for document in documents %} -
- - - - - {% else %} - - - + {% include 'ChillDocStoreBundle:List:list_item.html.twig' %} {% endfor %} - -
{{ 'Title' | trans }}{{ 'Category'|trans }}{{ 'Actions' | trans }}
{{ document.title }}{% if document.category %}{{ document.category.name|localize_translatable_string }}{% endif %} -
    - {% 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 %} -
-
- {{ 'Any document found'|trans }} -
+
+ {% endif %} -
+
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', accompanyingCourse) %} {% endif %} + + {% endblock %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig new file mode 100644 index 000000000..b8a9ee3d3 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig @@ -0,0 +1,80 @@ +{% import "@ChillDocStore/Macro/macro.html.twig" as m %} + +
+
+
+
+ {{ document.title }} +
+
+

{{ document.category.name|localize_translatable_string }}

+
+ {% if document.template is not null %} +
+

{{ document.template.name.fr }}

+
+ {% endif %} +
+ +
+
+ {% if document.date is not null %} +
+ {{ document.createdAt|format_date('short') }} +
+ {% endif %} +
+
+
+ {% if document.description is not null %} +
+
+ {{ document.description|chill_markdown_to_html }} +
+
+ {% endif %} +
+
+
+ {{ 'Created by'|trans }}: + {{ document.createdBy|chill_entity_render_string }} + le {{ document.createdAt|format_date('long') }} +
+
+
+
+ {% if document.course is defined %} + + {% else %} + + {% endif %} +
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/index.html.twig index 40c85002e..95950fc89 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/index.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/index.html.twig @@ -30,51 +30,19 @@ {% endblock %} {% block personcontent %} + +

{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}

- - - - - - - - - - - + {% if documents|length == 0 %} +

{{ 'No documents'|trans }}

+ {% else %} +
{% for document in documents %} -
- - - - - - {% else %} - - - + {% include 'ChillDocStoreBundle:List:list_item.html.twig' %} {% endfor %} - -
{{ 'Title' | trans }}{{ 'Category'|trans }}{{ 'Circle' | trans }}{{ 'Actions' | trans }}
{{ document.title }}{{ document.category.name|localize_translatable_string }}{{ document.scope.name|localize_translatable_string }} -
    - {% 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 %} -
-
- {{ 'Any document found'|trans }} -
+
+ {% endif %} {% if is_granted('CHILL_PERSON_DOCUMENT_CREATE', person) %} {% endif %} + + {% endblock %}