From be38251a13d0a336f2eedb04c88877141fa5b1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 8 Nov 2022 19:59:43 +0100 Subject: [PATCH] Feature: [saved export] Switch between list of export and saved export thanks to nav at the list's top --- .../Resources/views/Export/_navbar.html.twig | 12 ++++ .../Resources/views/Export/layout.html.twig | 42 ++++++++----- .../views/SavedExport/index.html.twig | 59 ++++++++++++------- .../translations/messages.fr.yml | 3 +- 4 files changed, 78 insertions(+), 38 deletions(-) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Export/_navbar.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/_navbar.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/_navbar.html.twig new file mode 100644 index 000000000..a7d7216b4 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/_navbar.html.twig @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/layout.html.twig index 9cf53993d..5ce433535 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/layout.html.twig @@ -22,9 +22,11 @@ {% block content %} + + {{ include('@ChillMain/Export/_navbar.html.twig', {'current' : 'common'}) }} +
-

{{ 'Exports list'|trans }}

- +
{% for group, exports in grouped_exports %}{% if group != '_' %} @@ -32,13 +34,17 @@
{% for export_alias, export in exports %}
-

{{ export.title|trans }}

-

{{ export.description|trans }}

-

- - {{ 'Create an export'|trans }} - -

+
+
+

{{ export.title|trans }}

+

{{ export.description|trans }}

+

+ + {{ 'Create an export'|trans }} + +

+
+
{% endfor %}
@@ -52,13 +58,17 @@ {% for export_alias,export in grouped_exports['_'] %}
-

{{ export.title|trans }}

-

{{ export.description|trans }}

-

- - {{ 'Create an export'|trans }} - -

+
+
+

{{ export.title|trans }}

+

{{ export.description|trans }}

+

+ + {{ 'Create an export'|trans }} + +

+
+
{% endfor %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig index bfe377f6c..17792ecd2 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig @@ -4,7 +4,8 @@ {% block content %}
-

{{ block('title') }}

+ + {{ include('@ChillMain/Export/_navbar.html.twig', {'current' : 'my'}) }}
@@ -18,17 +19,25 @@
{% for s in saveds %}
-

{{ s.saved.title }}

-

{{ s.export.title|trans }}

-
- {{ s.saved.description|chill_markdown_to_html }} -
+
+
+

{{ s.saved.title }}

+

{{ s.export.title|trans }}

-
    -
  • -
  • -
  • -
+
+ {{ s.saved.description|chill_markdown_to_html }} +
+ +
{{ 'saved_export.Created on %date%'|trans({'%date%': s.saved.createdAt|format_datetime('long', 'short')}) }}
+ +
    +
  • +
  • +
  • +
+ +
+
{% endfor %}
@@ -44,17 +53,25 @@ {% for s in saveds %}
-

{{ s.saved.title }}

-

{{ s.export.title|trans }}

-
- {{ s.saved.description|chill_markdown_to_html }} -
+
+
+

{{ s.saved.title }}

+

{{ s.export.title|trans }}

-
    -
  • -
  • -
  • -
+
+ {{ s.saved.description|chill_markdown_to_html }} +
+ +
{{ 'saved_export.Created on %date%'|trans({'%date%': s.saved.createdAt|format_datetime('long', 'short')}) }}
+ +
    +
  • +
  • +
  • +
+ +
+
{% endfor %} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 1100d8ee3..58b3e976e 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -565,4 +565,5 @@ saved_export: Are you sure you want to delete this saved ?: Êtes-vous sûr·e de vouloir supprimer ce rapport ? My saved exports: Mes rapports enregistrés Export is deleted: Le rapport est supprimé - Saved export is saved!: Le rapport est enregistré \ No newline at end of file + Saved export is saved!: Le rapport est enregistré + Created on %date%: Créé le %date% \ No newline at end of file