Skip to content

Commit

Permalink
Merge e66bd67 into c8fb7a6
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed May 22, 2019
2 parents c8fb7a6 + e66bd67 commit de1bc09
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 28 deletions.
Expand Up @@ -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: "<strong>%X%</strong> exception triggered by <strong>%Y%</strong> events"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -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 %}
<div class="alert-error">{{ 'settings.version.error'|trans }}</div>
{% set status_color = 'red' %}
{% set version = 'Unknown' %}
{% set txt = 'toolbar.bundle_version.error'|trans %}
{% endif %}

{% set icon %}
{{ include('@KunstmaanAdmin/Toolbar/Icon/time.svg') }}
<span class="sf-toolbar-value">{{ txt }}</span>
<span class="sf-toolbar-label">{{ version }}</span>
<span class="sf-toolbar-value">{{ version }}</span>
{% endset %}

{% set text %}
<div class="sf-toolbar-info-piece">
<b> {{ 'toolbar.bundle_version.version'|trans }}</b>
<span>{{ version }}</span>
</div>
<div class="sf-toolbar-info-piece">
<b> {{ 'toolbar.bundle_version.status'|trans }}</b>
<span>{{ txt }} </span>
<div class="sf-toolbar-info-group">
<div class="sf-toolbar-info-piece">
<div class="sf-toolbar-info-piece">
<b> {{ 'toolbar.bundle_version.version'|trans }}</b>
<span>{{ version }}</span>
</div>
<div class="sf-toolbar-info-piece">
<b> {{ 'toolbar.bundle_version.status'|trans }}</b>
<span class="sf-toolbar-status sf-toolbar-status-{% if label_color is defined %}{{ label_color }}{% else %}{{ status_color }}{% endif %}">{{ txt }} </span>
</div>
</div>
</div>

{% endset %}

{{ include('@KunstmaanAdmin/Toolbar/toolbar_item.html.twig', { status: status_color }) }}
Expand Down
Expand Up @@ -5,14 +5,25 @@

{% if data is defined %}
{% set icon %}
<span class="sf-toolbar-value">{{ 'toolbar.exception.title' | trans }}</span>
{{ include('@KunstmaanAdmin/Toolbar/Icon/exception.svg') }}
<span class="sf-toolbar-value">{{ data['cp_all'] }}</span>
<span class="sf-toolbar-info-piece-additional-detail">
<span class="sf-toolbar-label">{{ 'toolbar.exception.title' | trans }}</span>
</span>
{% endset %}

{% set text %}
<div class="sf-toolbar-info-piece">
<span>
{{ 'toolbar.exception.message' | trans({'%X%': data['cp_all'], '%Y%': data['cp_sum']}) | raw }}
</span>
<div class="sf-toolbar-info-group">
<div class="sf-toolbar-info-piece">
<div class="sf-toolbar-info-piece">
<b> {{ 'toolbar.exception.info.exceptions'|trans }}</b>
<span class="sf-toolbar-status">{{ data['cp_all'] }}</span>
</div>
<div class="sf-toolbar-info-piece">
<b> {{ 'toolbar.exception.info.events'|trans }}</b>
<span class="sf-toolbar-status">{{ data['cp_sum'] }} </span>
</div>
</div>
</div>
{% endset %}

Expand Down
@@ -1,4 +1,4 @@
<div class="sf-toolbar-block kuma-toolbar-block" {% if status_color is defined %} style="background-color: {{ status_color }}" {% endif %}>
<div class="sf-toolbar-block kuma-toolbar-block sf-toolbar-status-{{ status|default('normal') }}">
{% if link is defined and link %}
<a href="{{ link }}">
{% endif %}
Expand Down
Expand Up @@ -177,3 +177,8 @@ kuma_node:
export_pagetemplate:
button:
title: Export pagetemplate

toolbar:
node:
title: 'Page title'
edit: 'Edit page'
Expand Up @@ -6,18 +6,19 @@
{% if data is defined %}
{% set icon %}
{{ include('@KunstmaanTranslator/Toolbar/Icon/translation.svg') }}
<span class="sf-toolbar-value">{{ 'toolbar.translations.title' | trans }}</span>
<span class="sf-toolbar-label">{{ data.translations | length }}</span>
<span class="sf-toolbar-value">{{ data.translations | length }}</span>
<span class="sf-toolbar-label">{{ 'toolbar.translations.title' | trans }}</span>
{% endset %}

{% set text %}
{% for translation in data.translations %}
<div class="sf-toolbar-info-piece">
<b>
<b>{{ translation.id }}</b>
<span>
<a href="{{ translation.route }}" style="text-decoration: none !important;">
{{ translation.message }}
{{ translation.message|length > 40 ? translation.message|slice(0, 40) ~ '...' : translation.message }}
</a>
</b>
</span>
</div>
{% endfor %}
{% endset %}
Expand Down

0 comments on commit de1bc09

Please sign in to comment.