{% set isIndex = 'index' == tmpl ? true : false %} {% set tmpl = 'list' %} {% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %} {% block mauticContent %}mt3sMpProgramAudience{% endblock %} {% block headerTitle %}{{ 'mt3s.marketing_program.audience.header.index'|trans }}{% endblock %} {% block content %} {% set segmentCounts = mt3s_marketing_program_audience_segment_counts(items) %}
| {{- include('@MauticCore/Helper/list_actions.html.twig', { 'item': item, 'templateButtons': { 'edit': canEdit, 'delete': securityHasEntityAccess(permissions['mt3smarketingprogram:audiences:deleteown'], permissions['mt3smarketingprogram:audiences:deleteother'], item.createdBy), }, 'langVar': 'program.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 ? 'mt3s.marketing_program.audience.active' : 'mt3s.marketing_program.audience.inactive')|trans }} | {# The programs this audience is assigned to, through their Audiences tab. #} {% set links = item.programLinks|default([]) %} {% for link in links %} {{ link.program.name }}{% if link.valueProposition %} ({{ link.valueProposition }}){% endif %}{% if not loop.last %}, {% endif %} {% else %} {{ 'mt3s.marketing_program.audience.no_plans'|trans }} {% endfor %} |