{%- if app.environment is same as('prod') and user.hasCredential('admin') %}
{# #}
{# getAttribute('certificate-widget-limited') && (get_slot('is-cert-editing') || $sf_request->getCookie($cookieKey) !== $cookieValue)): ?> #}
{%- if isCertEditing is not defined %}
{# #}
{# #}
{% endif -%}
{{ 'Your certificate widget has limited for this month because it reaches %views% views.'|trans({'%views%': 1000}) }}
{# CertificateValidator::$cert_view_limit ]); ?> #}
{# #}
{{ 'Try our paid packages!'|trans }}
{% endif -%}
{# #}
{# getSelectedCompany()->getId();
$certificateError = $sf_user->getAttribute('certificate-widget-error')[ $companyId ] ?? null;
// get user cookie for alert hide
// - value is the date error created
// alert is not hidden if:
// - we are in the edit page
// - user not hide yet or not hide this error
$cookieKey = 'hide-alert-cert-error-'. $companyId;
$cookieValue = $certificateError['error_at'] ?? null; #}
{% set companyId = user.getSelectedCompany().id %}
{% set certificateError = user.getLegacySessionAttributes()['certificate-widget-error'][companyId] ?? false %}
{% set cookieKey = 'hide-alert-cert-error-'. companyId %}
{% set cookieValue = certificateError.error_at ?? null %}
{%- if certificateError and cookieValue is not same as (app.request.cookie[cookieKey]) %}
{# if ($certificateError && (get_slot('is-cert-editing') || $sf_request->getCookie($cookieKey) !== $cookieValue)): ?> #}
{#
id="alert-certificate-widget-wrong-rating"> #}
{# id="alert-certificate-widget-wrong-rating"> #}
{%- if isCertEditing is not defined %}
{# #}
{# #}
{% endif -%}
{%- if 'wrong-rating' is same as(certificateError.error) %}
{# #}
{{ 'Your company does not meet the minimum conditions for the use of the Trustindex Review Certificate, therefore we do not allow the use of the review certificate.'|trans }}
{{ 'Your evaluations do not reach an average of at least 4.00 out of 5'|trans }}
{{ 'You do not yet have the 30 reviews required for the certificate.'|trans }}
{# #}
{{ 'Collect new reviews!'|trans }}
{% else %}
{# #}
{{ 'Your website has been checked by our colleagues. We have come to the conclusion that your site does not meet the Trustindex Review Certificate requirements.'|trans }}