Files
mautic-marketing-program-bu…/Resources/views/Plan/_tabs.html.twig
T
2026-11-07 19:31:49 +01:00

32 lines
1.3 KiB
Twig

{#
# Tab bar shared by the plan form and the plan detail page.
#
# Parameters:
# planId: the plan's id (null for a new plan)
# counts (optional): tab id => number shown next to the tab name
#
# The tab panes use the ids plan-tab-<id>. Assets/js/plan.js reopens the tab last used for this plan
# (so Edit, Save and Cancel keep the same tab), and on the form marks the tabs whose pane contains a
# validation error and opens the first of them.
#}
{% set planTabs = {
'details': 'mautic.plan.tab.details',
'description': 'mautic.plan.tab.description',
'objectives': 'mautic.plan.tab.objectives',
'allocation': 'mautic.plan.tab.allocation',
'targets': 'mautic.plan.tab.targets',
'tasks': 'mautic.plan.tab.tasks',
} %}
<ul class="nav nav-tabs nav-tabs-contained tabs-horizontal plan-tabs" role="tablist" data-plan-id="{{ planId|default('') }}">
{% for id, label in planTabs %}
<li class="{{ loop.first ? 'active' : '' }}" data-tab-id="plan-tab-{{ id }}">
<a href="#plan-tab-{{ id }}" role="tab" data-toggle="tab">
<span>{{ label|trans }}</span>
{% if counts is defined and counts[id] is defined %}
<span class="badge">{{ counts[id] }}</span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>