{% import 'common/macros.html.twig' as macro %}

{% set business =  app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord')|default(false) %}

{% if view == 'answer' %}
    {{ macro.format_caption(record, highlight|default(''), searchEngine|default(null), business, false, true) }}
{% elseif view == 'lazaret' %}
    {{ macro.format_caption(record, highlight|default(''), searchEngine|default(null), business, true, true) }}
{% elseif view == 'preview' %}
    {{ macro.format_caption(record, highlight|default(''), searchEngine|default(null), business, true, false) }}
{% elseif view == 'basket' %}
    {{ macro.format_caption(record, highlight|default(''), searchEngine|default(null), business, true, false) }}
{% elseif view == 'overview' %}
    {{ macro.format_caption(record, highlight|default(''), searchEngine|default(null), business, false, false) }}
{% elseif view == 'publi' %}
    {{ macro.format_caption(record, '', null, business, true, true) }}
{% endif %}
