{% if app.environment|default() == 'dev' and app.request.get('debug') is not null %}
  {% set contentUrl = aa_content_path(entity)|default() %}
{% else %}
  {% set contentUrl = aa_content_path_safe(entity)|default() %}
{% endif %}

{% if contentUrl %}
  <a href="{{ contentUrl }}" target="_blank" class="btn btn-primary ml-2 mb-2">
    <span class="icon mr-2"><i class="fas fa-eye"></i></span>
    <span class="text">Voir en ligne</span>
  </a>
{% endif %}