From e66bd67d5cc931575e6213fe7bbfa2199dfd0212 Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Wed, 22 May 2019 14:06:53 +0200 Subject: [PATCH] [AllBundles] Improve the kunstmaan toolbar items --- .../Resources/translations/messages.en.yml | 9 ++-- .../views/Toolbar/Icon/exception.svg | 1 + .../views/Toolbar/bundles_version.html.twig | 45 +++++++++++++------ .../views/Toolbar/exception.html.twig | 21 ++++++--- .../views/Toolbar/toolbar_item.html.twig | 2 +- .../Resources/translations/messages.en.yml | 5 +++ .../views/Toolbar/translations.html.twig | 11 ++--- 7 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 src/Kunstmaan/AdminBundle/Resources/views/Toolbar/Icon/exception.svg diff --git a/src/Kunstmaan/AdminBundle/Resources/translations/messages.en.yml b/src/Kunstmaan/AdminBundle/Resources/translations/messages.en.yml index b09688ec54..44684f6044 100644 --- a/src/Kunstmaan/AdminBundle/Resources/translations/messages.en.yml +++ b/src/Kunstmaan/AdminBundle/Resources/translations/messages.en.yml @@ -143,8 +143,11 @@ toolbar: unknown: Unknown uptodate: Up-to-date toupdate: Outdated - version: Bundle version - status: Bundle status + version: Cms version + status: Status + error: Error while fetching version information. exception: + info: + exceptions: Exceptions + events: Events title: Exceptions - message: "%X% exception triggered by %Y% events" diff --git a/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/Icon/exception.svg b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/Icon/exception.svg new file mode 100644 index 0000000000..0e4df2b23a --- /dev/null +++ b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/Icon/exception.svg @@ -0,0 +1 @@ + diff --git a/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/bundles_version.html.twig b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/bundles_version.html.twig index 1d86ef4d67..5af28a5a2a 100644 --- a/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/bundles_version.html.twig +++ b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/bundles_version.html.twig @@ -4,42 +4,59 @@ {% endif %} {% if data is defined %} - {% set status_color = '#00529B' %} + {% set status_color = 'yellow' %} + {% set version = 'Unknown' %} {% set txt = 'toolbar.bundle_version.unknown'|trans %} - {% set version = null %} {% if data is iterable %} {% for bundle in data %} {% if bundle.name == "kunstmaan/bundles-cms" %} {% set version = bundle.version %} {% if bundle.status == 'UP_TO_DATE' %} - {% set status_color = '#4F8A10' %} + {% set status_color = '' %} + {% set label_color = 'green' %} {% set txt = 'toolbar.bundle_version.uptodate'|trans %} {% elseif bundle.status == 'TO_UPDATE' %} - {% set status_color = '#9F6000' %} + {% set status_color = 'red' %} + {% set txt = 'toolbar.bundle_version.toupdate'|trans %} + {% endif %} + {% elseif bundle.name == 'kunstmaan/admin-bundle' %} + {% set version = bundle.version %} + {% if bundle.status == 'UP_TO_DATE' %} + {% set status_color = '' %} + {% set label_color = 'green' %} + {% set txt = 'toolbar.bundle_version.uptodate'|trans %} + {% elseif bundle.status == 'TO_UPDATE' %} + {% set status_color = 'red' %} {% set txt = 'toolbar.bundle_version.toupdate'|trans %} {% endif %} {% endif %} {% endfor %} {% else %} -
{{ 'settings.version.error'|trans }}
+ {% set status_color = 'red' %} + {% set version = 'Unknown' %} + {% set txt = 'toolbar.bundle_version.error'|trans %} {% endif %} {% set icon %} {{ include('@KunstmaanAdmin/Toolbar/Icon/time.svg') }} - {{ txt }} - {{ version }} + {{ version }} {% endset %} {% set text %} -
- {{ 'toolbar.bundle_version.version'|trans }} - {{ version }} -
-
- {{ 'toolbar.bundle_version.status'|trans }} - {{ txt }} +
+
+
+ {{ 'toolbar.bundle_version.version'|trans }} + {{ version }} +
+
+ {{ 'toolbar.bundle_version.status'|trans }} + {{ txt }} +
+
+ {% endset %} {{ include('@KunstmaanAdmin/Toolbar/toolbar_item.html.twig', { status: status_color }) }} diff --git a/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/exception.html.twig b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/exception.html.twig index 0158830e07..8f78dbb70c 100644 --- a/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/exception.html.twig +++ b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/exception.html.twig @@ -5,14 +5,25 @@ {% if data is defined %} {% set icon %} - {{ 'toolbar.exception.title' | trans }} + {{ include('@KunstmaanAdmin/Toolbar/Icon/exception.svg') }} + {{ data['cp_all'] }} + + {{ 'toolbar.exception.title' | trans }} + {% endset %} {% set text %} -
- - {{ 'toolbar.exception.message' | trans({'%X%': data['cp_all'], '%Y%': data['cp_sum']}) | raw }} - +
+
+
+ {{ 'toolbar.exception.info.exceptions'|trans }} + {{ data['cp_all'] }} +
+
+ {{ 'toolbar.exception.info.events'|trans }} + {{ data['cp_sum'] }} +
+
{% endset %} diff --git a/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/toolbar_item.html.twig b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/toolbar_item.html.twig index bd03dada0a..6ef594e1a4 100644 --- a/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/toolbar_item.html.twig +++ b/src/Kunstmaan/AdminBundle/Resources/views/Toolbar/toolbar_item.html.twig @@ -1,4 +1,4 @@ -