Skip to content

Commit

Permalink
Change to use traslation system
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Mar 1, 2019
1 parent 2aaad75 commit 3f3c49c
Showing 1 changed file with 64 additions and 27 deletions.
91 changes: 64 additions & 27 deletions Resources/views/themes/admin/dashboard/block/ez.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,113 @@
{% set levels = {0: "info", 1: "warning", 2: "danger"} %}
{% set icons = {0: "", 1: "⚠", 2: "⚠"} %}
{% set status %}
{% set urls = {
'contact': "https://ez.no/About-eZ/Contact-Us",
'license': "https://ez.no/About-our-Software/Licenses-and-agreements",
'ttl': "https://ez.no/About-our-Software/Licenses-and-agreements/eZ-Trial-and-Test-License-Agreement-eZ-TTL-v2.1",
'service_life': "https://support.ez.no/Public/Service-Life",
'support_service': "https://ez.no/Services/Support-Maintenance",
'training_service': "https://ez.no/Services/Training",
'consulting_service': "https://ez.no/Services/Consulting",
'ee_product': "https://ez.no/Products/eZ-Platform-Enterprise-Edition",
} %}
{% spaceless %}
{% if not ez.release %}
{% set severity = 1 %}
<div class="alert alert-warning collapse" role="alert" id="systemInfoCollapse">
The system could not find your <code>composer.lock</code> file, it's needed in order to determine information about
your eZ install, and recommended to be kept on project development to make sure same package versions are used across all environments.
{% trans %}
The system could not find your <code>composer.lock</code> file, it's needed in order to determine information about
your eZ install, and recommended to be kept on project development to make sure same package versions are used across all environments.
{% endtrans %}
</div>
{% elseif ez.isTrial %}
{% set badge = 'Trial' %}
{% if ez.isEndOfLife %}
{% set severity = 2 %}
<div class="alert alert-danger collapse" role="alert" id="systemInfoCollapse">
Unfortunately your trial period has expired and your <a target="_blank" href="https://ez.no/About-our-Software/Licenses-and-agreements/eZ-Trial-and-Test-License-Agreement-eZ-TTL-v2.1">TTL license</a>
is no longer valid. <a target="_blank" href="https://ez.no/About-eZ/Contact-Us">Contact eZ or its partner(s)</a>
to purchase a subscription and follow the <a target="_blank" href="https://doc.ezplatform.com/en/{{ ez.release }}/getting_started/install_ez_enterprise/">online documentation</a>
to configure your project.
{% trans with {'%ttl_url%': urls['ttl']} %}
Unfortunately your trial period has expired and your <a target="_blank" href="%ttl_url%">TTL license</a> is no longer valid.
{% endtrans %}
{% trans with {'%contact_url%': urls['contact'], '%install_ee_url%': "https://doc.ezplatform.com/en/#{ez.release}/getting_started/install_ez_enterprise/"} %}
<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription.
And follow the <a target="_blank" href="%install_ee_url%">online documentation</a> to configure your project.
{% endtrans %}
</div>
{% elseif ez.isEndOfMaintenance %}
{% set severity = 1 %}
<div class="alert alert-warning collapse" role="alert" id="systemInfoCollapse">
Your trial period is coming to an end. <a target="_blank" href="https://ez.no/About-eZ/Contact-Us">Contact eZ or its partner(s)</a>
to purchase a subscription and follow the <a target="_blank" href="https://doc.ezplatform.com/en/{{ ez.release }}/getting_started/install_ez_enterprise/">online documentation</a> to configure your project.
{% trans with {'%contact_url%': urls['contact'], '%install_ee_url%': "https://doc.ezplatform.com/en/#{ez.release}/getting_started/install_ez_enterprise/"} %}
Your trial period is coming to an end.
{% endtrans %}
{% trans with {'%contact_url%': urls['contact'], '%install_ee_url%': "https://doc.ezplatform.com/en/#{ez.release}/getting_started/install_ez_enterprise/"} %}
<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription.
And follow the <a target="_blank" href="%install_ee_url%">online documentation</a> to configure your project.
{% endtrans %}
</div>
{% else %}
{% set severity = 0 %}
<div class="alert alert-info collapse" role="alert" id="systemInfoCollapse">
Welcome to {{ ez.name }}, check our <a target="_blank" href="https://doc.ezplatform.com">online documentation</a>,
and <a target="_blank" href="https://ez.no/About-eZ/Contact-Us">Contact eZ</a> for <a target="_blank" href="https://ez.no/Services/Consulting">consulting service</a>
or <a target="_blank" href="https://ez.no/Services/Training">trainings</a> in order to get the most out of your trial.
{% trans with {'%name%': ez.name, '%doc_url%': 'https://doc.ezplatform.com', '%consulting_url%': urls['consulting_service'], '%training_url%': urls['training_service']} %}
Welcome to %name%, check our <a target="_blank" href="%doc_url%">online documentation</a>, <a target="_blank" href="%consulting_url%">consulting</a>
or <a target="_blank" href="%training_url%">trainings</a> services in order to get the most out of your trial.
{% endtrans %}
{% trans with {'%contact_url%': urls['contact'], '%install_ee_url%': "https://doc.ezplatform.com/en/#{ez.release}/getting_started/install_ez_enterprise/"} %}
<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription.
And follow the <a target="_blank" href="%install_ee_url%">online documentation</a> to configure your project.
{% endtrans %}
</div>
{% endif %}
{% elseif not ez.isEnterpise %}
{% set badge = 'GPL' %}
{% if ez.isEndOfMaintenance %}
{# In the future with retrival of info from updates.ez.no we can detect missing security fixes and make error for that when public #}
{# In the future with retrival of info from updates.ez.no we can detect missing (public) security fixes and then let this become an error #}
{% set severity = 1 %}
<div class="alert alert-warning collapse" role="alert" id="systemInfoCollapse">
Unfortunately {{ ez.release }} open source version has reached end of life, <a target="_blank" href="https://doc.ezplatform.com/en/latest/releases/updating_ez_platform/">please upgrade</a>.&nbsp;
{% trans with {'%release%': ez.release, '%update_url%': 'https://doc.ezplatform.com/en/latest/releases/updating_ez_platform/'} %}
Unfortunately %release% open source version has reached end of life, <a target="_blank" href="%update_url%">please upgrade</a>.
{% endtrans %}
&nbsp;
<em>
Tip: If you upgrade to eZ Platform Enterprise you'll get access to:
<a target="_blank" href="https://ez.no/About-our-Software/Licenses-and-agreements">A business friendly license</a>,
<a target="_blank" href="https://ez.no/Products/eZ-Platform-Enterprise-Edition">several productivity features</a>,
<a target="_blank" href="https://ez.no/Services/Support-Maintenance">professional Support</a> and
<a target="_blank" href="https://support.ez.no/Public/Service-Life">longer maintenance periode of your release</a>.
{% trans with {'%license_url%': urls['license'], '%ee_product_url%': urls['ee_product'], '%support_service_url%': urls['support_service'], '%service_life_url%': urls['service_life']} %}
Tip: If you upgrade to eZ Platform Enterprise you'll get access to:
<a target="_blank" href="%license_url%">A business friendly license</a>,
<a target="_blank" href="%ee_product_url%">several productivity features</a>,
<a target="_blank" href="%support_service_url%">professional Support</a> and
<a target="_blank" href="%service_life_url%">longer maintenance periode of your release</a>.
{% endtrans %}
</em>
</div>
{% else %}
{% set severity = 0 %}
<div class="alert alert-info collapse" role="alert" id="systemInfoCollapse">
Welcome to the open source {{ ez.release }} release. Using the community friendly
<a target="_blank" href="https://ez.no/About-our-Software/Licenses-and-agreements">GPL license</a>,
<a target="_blank" href="https://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.en.html#GPLModuleLicense">sharing your code</a>
is what it's all about.
{% trans with {'%release%': ez.release, '%license_url%': urls['license'], '%gpl_faq_url%': 'https://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.en.html#GPLModuleLicense'} %}
Welcome to the open source %release% release. Using the community friendly <a target="_blank" href="%license_url%">GPL license</a>,
<a target="_blank" href="%gpl_faq_url%">sharing your code</a> is what it's all about.
{% endtrans %}
</div>
{% endif %}
{% elseif ez.isEndOfLife %}
{# As we don't yet here know if subscription has expired (todo with info from updates.ez.no), this is a warning and not a error #}
{% set severity = 1 %}
{% set badge = 'End of Life' %}
<div class="alert alert-warning collapse" role="alert" id="systemInfoCollapse">
Unfortunately {{ ez.release }} has reached <a target="_blank" href="https://support.ez.no/Public/Service-Life">end of life</a>,
please plan to upgrade. If you need assistance, don't hesitate to <a target="_blank" href="https://ez.no/About-eZ/Contact-Us">contact eZ</a>.
{% trans with {'%release%': ez.release,'%service_life_url%': urls['service_life'], '%contact_url%': urls['contact']} %}
Unfortunately %release% has reached <a target="_blank" href="%service_life_url%">end of life</a>,
please plan to upgrade. If you need assistance, don't hesitate to <a target="_blank" href="%contact_url%">contact eZ</a>.
{% endtrans %}
</div>
{% elseif not ez.debug and ez.stability != 'stable' %}
{% set severity = 1 %}
{% set badge = 'Development' %}
<div class="alert alert-warning collapse" role="alert" id="systemInfoCollapse">
Your setup is running with unstable packages, this is not recommended besides when testing updates.
{% trans %}
Your setup is running with unstable packages, this is not recommended besides when testing updates.
{% endtrans %}

{% if ez.isEnterpise %}
If you need assistance <a target="_blank" href="https://support.ez.no">get in touch with us</a>.
{% trans with {'%support_url%': 'https://support.ez.no'} %}
If you need assistance, don't hesitate to <a target="_blank" href="%support_url%">get in touch with eZ support</a>.
{% endtrans %}
{% endif %}
</div>
{% endif %}
Expand All @@ -95,7 +132,7 @@
{{ ez.name }}&nbsp;
{{ ez.release }}{% if ez.stability != 'stable' %}{{ ez.release ? '-' : '' }}{{ ez.stability }}{% endif %}
{% if status %}
<a class="badge badge-{{ levels[severity] }}" data-toggle="collapse" href="#systemInfoCollapse">{{ icons[severity]|raw }} {{ badge }}</a>
<a class="badge badge-{{ levels[severity] }}" data-toggle="collapse" href="#systemInfoCollapse">{{ icons[severity]|raw }} {{ badge }}</a>
{% endif %}
</h2>

Expand Down

0 comments on commit 3f3c49c

Please sign in to comment.