{% if entity|default() is not empty %}
  {% 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">
      <span class="icon mr-2"><i class="fas fa-eye"></i></span>
      <span class="text">Voir en ligne</span>
    </a>
  {% endif %}
{% endif %}