refactor(plugin): rename Plan to Program and add audience/UTM routes
Rename the Plan bundle to Program across config, routes, menus, and controllers (Plan -> Initiative), bump version to 0.16.0, and introduce new audience and UTM taxonomy routes and permissions to support the expanded Programs feature set.
This commit is contained in:
1 parent
8268fad886
commit
71ff11390b
121 files changed
+5011
-2874
No files matched your search
@@ -0,0 +1,449 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}program{% endblock %}
|
||||
|
||||
{#
|
||||
# No routeBase on the page_actions includes: core would turn it into mautic_program_* route names.
|
||||
# The buttons use actionRoute (initiative_action) from the controller, and the close button gets its URL here.
|
||||
#}
|
||||
{% block preHeader %}
|
||||
{{- include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'close': true,
|
||||
},
|
||||
'closeUrl': path('initiative_index'),
|
||||
'targetLabel': 'mautic.program.header.index'|trans,
|
||||
}) -}}
|
||||
{# Core's helper renders an empty pill when there is no category. #}
|
||||
{% if item.category %}
|
||||
{{ include('@MauticCore/Modules/category--inline.html.twig', {'category': item.category}) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ item.name }}{% endblock %}
|
||||
|
||||
{#
|
||||
# Under the title, as on an email's page: the plan status, then the total planned and real costs of the
|
||||
# allocation items, in the general currency. A real total above the planned total is red, otherwise green.
|
||||
#}
|
||||
{% block publishStatus %}
|
||||
{% set statusColors = {
|
||||
'draft': 'warm-gray', 'planned': 'blue', 'active': 'green',
|
||||
'paused': 'warning', 'completed': 'teal', 'archived': 'cool-gray',
|
||||
} %}
|
||||
{% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{
|
||||
color: statusColors[item.status.value]|default('gray'),
|
||||
label: item.status.labelKey,
|
||||
icon: 'ri-flag-line',
|
||||
attributes: {'class': 'initiative-status-tag'},
|
||||
}] } %}
|
||||
|
||||
{% set totals = item.allocationTotals %}
|
||||
{% if totals.planned is not null or totals.real is not null %}
|
||||
<div class="label__divider"></div>
|
||||
{% set totalTags = [] %}
|
||||
{% if totals.planned is not null %}
|
||||
{% set totalTags = totalTags|merge([{
|
||||
color: 'high-contrast',
|
||||
icon: 'ri-wallet-3-line',
|
||||
label: 'mautic.program.header.total_planned'|trans({'%amount%': program_money(totals.planned), '%currency%': program_currency()}),
|
||||
attributes: {'class': 'initiative-total-planned', 'title': 'mautic.program.header.total_planned.tooltip'|trans, 'data-toggle': 'tooltip'},
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% if totals.real is not null %}
|
||||
{% set overPlan = totals.planned is not null and (totals.real + 0) > (totals.planned + 0) %}
|
||||
{% set totalTags = totalTags|merge([{
|
||||
color: overPlan ? 'red' : 'green',
|
||||
icon: overPlan ? 'ri-error-warning-line' : 'ri-checkbox-circle-line',
|
||||
label: 'mautic.program.header.total_real'|trans({'%amount%': program_money(totals.real), '%currency%': program_currency()}),
|
||||
attributes: {'class': 'initiative-total-real', 'title': (overPlan ? 'mautic.program.header.total_real.over' : 'mautic.program.header.total_real.tooltip')|trans, 'data-toggle': 'tooltip'},
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% include '@MauticCore/Helper/_tag.html.twig' with { tags: totalTags } %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions %}
|
||||
{{- include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': securityHasEntityAccess(permissions['program:initiatives:editown'], permissions['program:initiatives:editother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['program:initiatives:deleteown'], permissions['program:initiatives:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'initiative',
|
||||
}) -}}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set objectives = item.objectives %}
|
||||
{% set achievedCount = objectives|filter(o => o.achieved)|length %}
|
||||
{% set descriptionItems = item.descriptionItems %}
|
||||
{% set allocationItems = item.allocationItems %}
|
||||
{% set allocationTotals = item.allocationTotals %}
|
||||
|
||||
{{ include('@Program/Initiative/_tabs.html.twig', {'initiativeId': item.id, 'counts': {
|
||||
'description': descriptionItems|length,
|
||||
'objectives': objectives|length,
|
||||
'allocation': allocationItems|length,
|
||||
'audiences': item.audiences|length,
|
||||
'stakeholders': item.stakeholders|length,
|
||||
'tasks': taskTree|length,
|
||||
}}) }}
|
||||
|
||||
<div class="tab-content pa-md">
|
||||
{# Details #}
|
||||
<div class="tab-pane active bdr-w-0" id="initiative-tab-details" role="tabpanel">
|
||||
<table class="table table-hover mb-0 initiative-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.program.field.status'|trans }}</td>
|
||||
<td>{{ item.status.labelKey|trans }}</td>
|
||||
</tr>
|
||||
{% if item.completedAt %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.completed_at'|trans }}</td>
|
||||
<td>{{ dateToFull(item.completedAt) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.version'|trans }}</td>
|
||||
<td>{{ item.version }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.owner'|trans }}</td>
|
||||
<td>{{ item.owner ? item.owner.name : 'mautic.program.owner.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.start_date'|trans }}</td>
|
||||
<td>{{ item.startDate ? dateToFull(item.startDate) : 'mautic.program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.end_date'|trans }}</td>
|
||||
<td>{{ item.endDate ? dateToFull(item.endDate) : 'mautic.program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.category'|trans }}</td>
|
||||
<td>{{ item.category ? item.category.title : 'mautic.program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.form.available'|trans }}</td>
|
||||
<td>{{ (item.isPublished ? 'mautic.core.form.yes' : 'mautic.core.form.no')|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.created'|trans }}</td>
|
||||
<td>{{ item.dateAdded ? dateToFull(item.dateAdded) : '' }}{% if item.createdByUser %} ({{ item.createdByUser }}){% endif %}</td>
|
||||
</tr>
|
||||
{% if item.dateModified %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.modified'|trans }}</td>
|
||||
<td>{{ dateToFull(item.dateModified) }}{% if item.modifiedByUser %} ({{ item.modifiedByUser }}){% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.id'|trans }}</td>
|
||||
<td>{{ item.id }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{# Description #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-description" role="tabpanel">
|
||||
{% if descriptionItems is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.description_item.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Description. Description items have no
|
||||
name of their own, so the Name column is left out here. Filter + click-to-sort (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-description-items-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.description_item.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.description_item.field.type'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.description_item.field.description'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for descriptionItem in descriptionItems %}
|
||||
{% set typeName = program_item_type_name('description', descriptionItem.type) %}
|
||||
{% set typeDescription = program_item_type_description('description', descriptionItem.type) %}
|
||||
{% set typeIcon = program_item_type_icon('description', descriptionItem.type) %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': descriptionItem.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-description">
|
||||
{{ include('@Program/Initiative/_description_read_more.html.twig', {
|
||||
'text': descriptionItem.description,
|
||||
'id': 'initiative-desc-item-' ~ descriptionItem.id,
|
||||
}) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Objectives #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-objectives" role="tabpanel">
|
||||
{% if objectives is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.objective.empty'|trans }}</p>
|
||||
{% else %}
|
||||
<p class="text-muted initiative-objectives-progress">
|
||||
{{ 'mautic.program.objective.progress'|trans({'%achieved%': achievedCount, '%total%': objectives|length}) }}
|
||||
</p>
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name (title), Description, Priority,
|
||||
Status (achieved). Filter + click-to-sort (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-objectives-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.objective.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.objective.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.objective.field.name'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.objective.field.description'|trans }}</th>
|
||||
<th class="initiative-col-priority">{{ 'mautic.program.objective.field.priority'|trans }}</th>
|
||||
<th class="initiative-col-status">{{ 'mautic.program.objective.field.is_achieved'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for objective in objectives %}
|
||||
{% set typeName = program_item_type_name('objective', objective.type) %}
|
||||
{% set typeDescription = program_item_type_description('objective', objective.type) %}
|
||||
{% set typeIcon = program_item_type_icon('objective', objective.type) %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': objective.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-name">{{ objective.title }}</td>
|
||||
<td class="initiative-col-description text-muted" style="white-space: pre-wrap;">{{ objective.description|program_linkify }}</td>
|
||||
<td class="initiative-col-priority">{{ objective.priority ?? '—' }}</td>
|
||||
<td class="initiative-col-status">
|
||||
{% if objective.achieved %}
|
||||
<span class="label label-success"><i class="ri-checkbox-circle-fill" title="{{ 'mautic.program.objective.achieved'|trans }}"></i> {{ 'mautic.program.objective.achieved'|trans }}</span>
|
||||
{% else %}
|
||||
<span class="label label-default"><i class="ri-checkbox-blank-circle-line" title="{{ 'mautic.program.objective.not_achieved'|trans }}"></i> {{ 'mautic.program.objective.not_achieved'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Allocation: the initiative's budget, then the allocation items (cost lines) with their totals. #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-allocation" role="tabpanel">
|
||||
<table class="table table-hover mb-md initiative-allocation">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.program.field.budget_planned'|trans }}</td>
|
||||
<td>
|
||||
{% if item.budgetPlanned is not null %}
|
||||
{{ program_money(item.budgetPlanned) }} {{ program_currency() }}
|
||||
{% else %}
|
||||
{{ 'mautic.program.value.none'|trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 class="mb-sm">{{ 'mautic.program.field.allocation_items'|trans }}</h4>
|
||||
{% if allocationItems is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.allocation_item.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name, Description, then the costs.
|
||||
Filter + click-to-sort (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-allocation-items-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.allocation_item.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.allocation_item.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.allocation_item.field.name'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.allocation_item.field.description'|trans }}</th>
|
||||
<th class="initiative-col-cost text-right">{{ 'mautic.program.allocation_item.field.planned_cost'|trans }}</th>
|
||||
<th class="initiative-col-cost text-right">{{ 'mautic.program.allocation_item.field.real_cost'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for allocationItem in allocationItems %}
|
||||
{% set typeName = program_item_type_name('allocation', allocationItem.type) %}
|
||||
{% set typeDescription = program_item_type_description('allocation', allocationItem.type) %}
|
||||
{% set typeIcon = program_item_type_icon('allocation', allocationItem.type) %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': allocationItem.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-name">{{ allocationItem.name }}</td>
|
||||
<td class="initiative-col-description text-muted" style="white-space: pre-wrap;">{{ allocationItem.description|program_linkify }}</td>
|
||||
<td class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationItem.plannedCost is not null %}{{ program_money(allocationItem.plannedCost) }} {{ program_currency() }}{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationItem.realCost is not null %}{{ program_money(allocationItem.realCost) }} {{ program_currency() }}{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="initiative-allocation-total">
|
||||
<th colspan="4">{{ 'mautic.program.allocation.total'|trans }}</th>
|
||||
<th class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationTotals.planned is not null %}{{ program_money(allocationTotals.planned) }} {{ program_currency() }}{% endif %}
|
||||
</th>
|
||||
<th class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationTotals.real is not null %}{{ program_money(allocationTotals.real) }} {{ program_currency() }}{% endif %}
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Stakeholders: the initiative's links to the global directory, harmonized like the other tabs. #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-stakeholders" role="tabpanel">
|
||||
{% set stakeholders = item.stakeholders %}
|
||||
{% if stakeholders is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.stakeholder.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name, then the link's own fields.
|
||||
Filter + click-to-sort (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-stakeholders-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.stakeholder.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.stakeholder.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.stakeholder.field.name'|trans }}</th>
|
||||
<th class="initiative-col-role">{{ 'mautic.program.stakeholder.field.role_in_initiative'|trans }}</th>
|
||||
<th class="initiative-col-role">{{ 'mautic.program.stakeholder.field.role'|trans }}</th>
|
||||
<th class="initiative-col-email">{{ 'mautic.program.stakeholder.field.email'|trans }}</th>
|
||||
<th class="initiative-col-phone">{{ 'mautic.program.stakeholder.field.phone'|trans }}</th>
|
||||
<th class="initiative-col-active">{{ 'mautic.program.stakeholder.field.active'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in stakeholders %}
|
||||
{% set stakeholder = link.stakeholder %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% set typeIcon = program_item_type_icon('stakeholder', stakeholder.type) %}
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if program_item_type_description('stakeholder', stakeholder.type) %} title="{{ program_item_type_description('stakeholder', stakeholder.type) }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ program_item_type_name('stakeholder', stakeholder.type) ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': stakeholder.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-name">
|
||||
<a href="{{ path('initiative_stakeholder_action', {'objectAction': 'view', 'objectId': stakeholder.id}) }}" data-toggle="ajax">{{ stakeholder.name }}</a>
|
||||
</td>
|
||||
<td class="initiative-col-role">{{ link.roleInInitiative }}</td>
|
||||
<td class="initiative-col-role text-muted">{{ stakeholder.role }}</td>
|
||||
<td class="initiative-col-email">
|
||||
{% if stakeholder.email %}<a href="mailto:{{ stakeholder.email }}">{{ stakeholder.email }}</a>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-phone text-nowrap">
|
||||
{% if stakeholder.phone %}<a href="tel:{{ stakeholder.phone|replace({' ': ''}) }}">{{ stakeholder.phone }}</a>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-active">
|
||||
<span class="label {{ stakeholder.isPublished ? 'label-success' : 'label-gray' }}">
|
||||
{{ (stakeholder.isPublished ? 'mautic.program.stakeholder.active' : 'mautic.program.stakeholder.inactive')|trans }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Audiences: the initiative's links to the global directory (Programs > Audiences), harmonized like
|
||||
the other tabs: pictogram, Type, Name (link to the audience's page), priority in this plan,
|
||||
then the audience's own attributes. Filter + click-to-sort (program.js). #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-audiences" role="tabpanel">
|
||||
{% set audiences = item.audiences %}
|
||||
{% if audiences is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.audience.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-audiences-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.audience.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.audience.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.audience.field.name'|trans }}</th>
|
||||
<th class="initiative-col-priority">{{ 'mautic.program.audience.field.priority'|trans }}</th>
|
||||
<th class="initiative-col-stages">{{ 'mautic.program.audience.field.stages'|trans }}</th>
|
||||
<th class="initiative-col-size text-right">{{ 'mautic.program.audience.field.estimated_size'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.audience.field.value_proposition'|trans }}</th>
|
||||
<th class="initiative-col-channels">{{ 'mautic.program.audience.field.preferred_channels'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in audiences %}
|
||||
{% set audience = link.audience %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
<i class="{{ audience.audienceType.icon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>
|
||||
</td>
|
||||
<td class="initiative-col-type">{{ audience.audienceType.labelKey|trans }}</td>
|
||||
<td class="initiative-col-name">
|
||||
<a href="{{ path('initiative_audience_action', {'objectAction': 'view', 'objectId': audience.id}) }}" data-toggle="ajax">{{ audience.name }}</a>
|
||||
</td>
|
||||
<td class="initiative-col-priority">
|
||||
<span class="label {{ link.priority.labelClass }}">{{ link.priority.labelKey|trans }}</span>
|
||||
</td>
|
||||
<td class="initiative-col-stages text-muted">
|
||||
{{ audience.stages|map(stage => stage.name)|join(', ') }}
|
||||
</td>
|
||||
<td class="initiative-col-size text-right text-nowrap">{{ audience.estimatedSize }}</td>
|
||||
<td class="initiative-col-description text-muted" style="white-space: pre-wrap;">{{ link.valueProposition }}</td>
|
||||
<td class="initiative-col-channels">
|
||||
{% for channel in audience.preferredChannels ?? [] %}
|
||||
<span class="label label-default">{{ program_audience_channel_label(channel)|trans }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Tasks: same columns as Programs > Tasks, in tree order. #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-tasks" role="tabpanel">
|
||||
{{ include('@Program/Initiative/_task_table.html.twig', {
|
||||
'initiative': item,
|
||||
'taskTree': taskTree,
|
||||
'taskPermissions': taskPermissions,
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user