{% set isIndex = 'index' == tmpl ? true : false %} {% set tmpl = 'list' %} {% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %} {% block mauticContent %}programAudience{% endblock %} {% block headerTitle %}{{ 'mautic.program.audience.header.index'|trans }}{% endblock %} {% block content %} {% set segmentCounts = program_audience_segment_counts(items) %}
| {{- include('@MauticCore/Helper/list_actions.html.twig', { 'item': item, 'templateButtons': { 'edit': canEdit, 'delete': securityHasEntityAccess(permissions['program:audiences:deleteown'], permissions['program:audiences:deleteother'], item.createdBy), }, 'langVar': 'initiative.audience', }) -}} | {{ item.id }} | {{ item.audienceType.labelKey|trans }} | {% if canEdit %} {% if item.tagline %}{{ item.name }} — {{ item.tagline }}{% else %}{{ item.name }}{% endif %} {% else %} {{ item.name }}{% if item.tagline %} — {{ item.tagline }}{% endif %} {% endif %} | {# The segments this audience maps to, purely informational: names with their contact counts next to them. May be none. #} {% set counts = segmentCounts[item.id] ?? [] %} {% for segment in item.segments %} {{ segment.name }} ({{ counts[segment.id] ?? 0 }}){% if not loop.last %} {% endif %} {% else %} — {% endfor %} | {{ item.estimatedSize }} | {{ (item.isPublished ? 'mautic.program.audience.active' : 'mautic.program.audience.inactive')|trans }} | {# The initiatives this audience is assigned to, through their Audiences tab. #} {% set links = item.initiativeLinks|default([]) %} {% for link in links %} {{ link.initiative.name }}{% if link.valueProposition %} ({{ link.valueProposition }}){% endif %}{% if not loop.last %}, {% endif %} {% else %} {{ 'mautic.program.audience.no_plans'|trans }} {% endfor %} |