Files
mautic-marketing-program-bu…/Resources/views/Audience/list.html.twig
T
Alexandre Gain ea88b7a772 refactor(plugin): rebrand as MT3SMarketingProgram, release 0.17.0
Rename the plugin's vendor/namespace from experiential/Program to mt3s/MT3SMarketingProgram (composer: mt3s/mautic-marketing-program-bundle):

- ProgramBundle -> MT3SMarketingProgramBundle; extension, integration,
  config support, permissions, events and twig extension renamed likewise
- Initiative* -> Program*: controller (InitiativeController ->
  ProgramController), model, entities, repositories, form types and views
  (new _tabs/_task_table/_tab_table_filter partials, details page)
- Settings config form theme -> _config_mt3smarketingprogramconfig_widget;
  routes and translations re-prefixed (mt3s_marketing_program_*)
- Assets: icon.svg -> mt3s-mp-icon.svg; program.js -> mt3s-mp-program.js
  (OnLoad hooks renamed mt3sMpProgram*)
- Add Command/RefreshStatsCommand; Migrations/Version_0_17_0.php renames
  the tables to mt3s_mp_program_*
2026-11-15 17:48:01 +01:00

165 lines
11 KiB
Twig

{% 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) %}
<div id="page-list-wrapper" class="{% if items|length > 0 or searchValue is not empty %}panel {% endif %}panel-default">
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
'searchValue': searchValue,
'action': currentRoute,
'page_actions': {
'templateButtons': {
'new': permissions['mt3smarketingprogram:audiences:create'],
},
'langVar': 'program.audience',
},
'bulk_actions': {
'langVar': 'program.audience',
'templateButtons': {
'delete': permissions['mt3smarketingprogram:audiences:deleteown'] or permissions['mt3smarketingprogram:audiences:deleteother'],
},
},
}) -}}
<div class="page-list">
{% if items is defined and items is not empty %}
<div class="table-responsive">
<table class="table table-hover" id="mt3sMpProgramAudienceTable">
<thead>
<tr>
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'checkall': 'true',
'target': '#mt3sMpProgramAudienceTable',
}) }}
{# Columns: ID, Pictogram, Type, Name (+ tagline), Segments (with contact
counts), Estimated size, Active, Assigned programs. #}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'orderBy': 't.id',
'text': 'mautic.core.id',
'class': 'col-program-audience-id',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'text': 'mt3s.marketing_program.audience.field.pictogram',
'class': 'col-program-audience-pictogram',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'orderBy': 't.audienceType',
'text': 'mt3s.marketing_program.audience.field.type',
'class': 'col-program-audience-type',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'orderBy': 't.name',
'text': 'mt3s.marketing_program.audience.field.name',
'class': 'col-program-audience-name',
'default': true,
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'text': 'mt3s.marketing_program.audience.field.segments',
'class': 'visible-md visible-lg col-program-audience-segments',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'text': 'mt3s.marketing_program.audience.field.estimated_size',
'class': 'visible-md visible-lg col-program-audience-size',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'orderBy': 't.isPublished',
'text': 'mt3s.marketing_program.audience.field.active',
'class': 'col-program-audience-active',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'program.audience',
'text': 'mt3s.marketing_program.audience.field.plans',
'class': 'visible-md visible-lg col-program-audience-programs',
}) }}
</tr>
</thead>
<tbody>
{% for item in items %}
{% set canEdit = securityHasEntityAccess(permissions['mt3smarketingprogram:audiences:editown'], permissions['mt3smarketingprogram:audiences:editother'], item.createdBy) %}
<tr>
<td>
{{- 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',
}) -}}
</td>
<td>{{ item.id }}</td>
<td class="text-center">
<i class="{{ item.audienceType.icon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>
</td>
<td>{{ item.audienceType.labelKey|trans }}</td>
<td>
{% if canEdit %}
<a href="{{ path('mt3s_marketing_program_audience_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{% if item.tagline %}{{ item.name }} <span class="text-muted small font-lato">— {{ item.tagline }}</span>{% else %}{{ item.name }}{% endif %}</a>
{% else %}
{{ item.name }}{% if item.tagline %} <span class="text-muted small font-lato">— {{ item.tagline }}</span>{% endif %}
{% endif %}
</td>
<td class="visible-md visible-lg">
{# 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 %}
<span class="label label-info">{{ segment.name }} ({{ counts[segment.id] ?? 0 }})</span>{% if not loop.last %} {% endif %}
{% else %}
<span class="text-muted">—</span>
{% endfor %}
</td>
<td class="visible-md visible-lg text-right text-nowrap">{{ item.estimatedSize }}</td>
<td>
<span class="label {{ item.isPublished ? 'label-success' : 'label-gray' }}">
{{ (item.isPublished ? 'mt3s.marketing_program.audience.active' : 'mt3s.marketing_program.audience.inactive')|trans }}
</span>
</td>
<td class="visible-md visible-lg">
{# The programs this audience is assigned to, through their Audiences tab. #}
{% set links = item.programLinks|default([]) %}
{% for link in links %}
<a href="{{ path('mt3s_marketing_program_action', {'objectAction': 'view', 'objectId': link.program.id}) }}" data-toggle="ajax">{{ link.program.name }}</a>{% if link.valueProposition %} <span class="text-muted small">({{ link.valueProposition }})</span>{% endif %}{% if not loop.last %}, {% endif %}
{% else %}
<span class="text-muted">{{ 'mt3s.marketing_program.audience.no_plans'|trans }}</span>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="panel-footer">
{{- include('@MauticCore/Helper/pagination.html.twig', {
'totalItems': totalItems,
'page': page,
'limit': limit,
'baseUrl': path('mt3s_marketing_program_audience_index'),
'sessionVar': 'program.audience',
}) -}}
</div>
</div>
{% elseif searchValue is not empty %}
{{ include('@MauticCore/Helper/noresults.html.twig') }}
{% else %}
<div class="mt-80 col-md-offset-2 col-lg-offset-3 col-md-8 col-lg-5 height-auto">
{{ include('@MauticCore/Components/content-block.html.twig', {
'heading': 'mt3s.marketing_program.audience.onboarding.heading',
'subheading': 'mt3s.marketing_program.audience.onboarding.subheading',
'copy': 'mt3s.marketing_program.audience.onboarding.copy',
}) }}
</div>
{% endif %}
</div>
</div>
{% endblock %}