Merge the Smartlinks plugin (SmartlinksBundle 0.6.0) into the bundle as the Smart Links domain (0.18.0)
Two domains, one MT3S bundle: Marketing Programs (unchanged) and the
imported Smart Links (smart links + UTM taxonomies), each keeping its
own menu, tables, routes and translations.
- Code moved from MauticPlugin\SmartlinksBundle\ to
MauticPlugin\MT3SMarketingProgramBundle\; template namespace
@Smartlinks/ -> @MT3SMarketingProgram/; smartlinks.js ->
Assets/js/mt3s-mp-smartlinks.js; icon -> Assets/img/smartlinks-icon.svg.
- Incoming migrations renamed Version_0_X_0_SmartLinks.php to avoid
the class-name collision; schema untouched, data intact.
- Permissions folded into MT3SMarketingProgramPermissions:
smart_links + taxonomies under the mt3smarketingprogram: base
(roles that had the old smartlinks: grants must be re-granted).
- config.php: Smart Links routes + menu group, public /l/{slug},
SmartlinksIntegration services, smartlinks_* parameters (legacy
utm_manager_* keys still readable), version 0.18.0. The 0.17.0
placeholder /s/marketing-program-utm-taxonomies is replaced by the
real /s/utm-taxonomies.
- Translations merged (en_US) and added (fr_FR); Tests/ + phpunit moved
in; readme documents both domains and the 0.18.0 merge history.
Verified live: menus, both config tabs, both lists + forms, program
pages, public redirect with taxonomy UTM values, host + unknown-slug
404s, 90/90 unit tests, full php -l, all ini catalogs parse.
This commit is contained in:
1 parent
debce4ba4a
commit
dce849610c
69 files changed
+8225
-43
No files matched your search
@@ -0,0 +1,169 @@
|
||||
{# Settings > Configuration > Smart Links Settings: the single tab of the plugin. Section "UTM
|
||||
Settings": the general rules and the short link domain. Section "Parameters": the catalog and
|
||||
custom parameters. Behaviour (rows, import, suggestions) lives in Assets/js/smartlinks.js. #}
|
||||
|
||||
{% block _config_smartlinksconfig_widget %}
|
||||
{% set utm = form.children.smartlinks_utm_config %}
|
||||
{% set links = form.children.smartlinks_config %}
|
||||
<div class="text-muted small pb-md">{{ 'mautic.smartlinks.settings.description'|trans }}</div>
|
||||
{{ form_errors(utm) }}
|
||||
{{ form_errors(links) }}
|
||||
|
||||
<div class="smartlinks-utm-config">
|
||||
<h4 class="fw-sb mb-xs">{{ 'mautic.smartlinks.config.section.utm_settings'|trans }}</h4>
|
||||
<div class="panel panel-default mb-md">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">{{ form_row(utm.children.enforce_lowercase) }}</div>
|
||||
<div class="col-md-4">{{ form_row(utm.children.separator_replacement) }}</div>
|
||||
<div class="col-md-4">{{ form_row(links.children.short_link_domain) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="fw-sb mt-lg mb-xs">{{ 'mautic.smartlinks.config.section.parameters'|trans }}</h4>
|
||||
<p class="text-muted small">{{ 'mautic.smartlinks.config.description'|trans }}</p>
|
||||
|
||||
{% for group in ['standard', 'platform'] %}
|
||||
<h5 class="fw-sb mt-md mb-sm">{{ ('mautic.smartlinks.config.group.' ~ group)|trans }}</h5>
|
||||
<div class="panel-group mb-md">
|
||||
{% for parameter in utm.children.parameters|filter(p => p.vars.utm_group == group) %}
|
||||
{{ form_widget(parameter) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% set custom = utm.children.custom_parameters %}
|
||||
<h5 class="fw-sb mt-md mb-sm">{{ 'mautic.smartlinks.config.group.custom'|trans }}</h5>
|
||||
{{ form_errors(custom) }}
|
||||
<div class="panel-group mb-sm utm-custom-parameters"
|
||||
data-prototype="{{ form_widget(custom.vars.prototype)|e('html_attr') }}"
|
||||
data-index="{{ custom|length > 0 ? max(custom|keys) + 1 : 0 }}">
|
||||
{% for parameter in custom %}
|
||||
{{ form_widget(parameter) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<p class="text-muted small utm-custom-empty{{ custom|length > 0 ? ' hide' : '' }}">{{ 'mautic.smartlinks.config.custom.empty'|trans }}</p>
|
||||
<button type="button" class="btn btn-default" data-utm-add-parameter>
|
||||
<i class="ri-add-line"></i> {{ 'mautic.smartlinks.config.custom.add'|trans }}
|
||||
</button>
|
||||
{% do custom.setRendered() %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{# One parameter: accordion panel. #}
|
||||
{% block utm_parameter_widget %}
|
||||
{% set fields = form.children %}
|
||||
{% set isCustom = form.vars.utm_custom %}
|
||||
{% set bodyId = form.vars.id ~ '_body' %}
|
||||
{% set hasErrors = formContainsErrors(form) %}
|
||||
{% set keyText = isCustom ? fields.key.vars.value : form.vars.utm_key %}
|
||||
<div class="panel panel-default mb-xs utm-parameter" data-utm-parameter>
|
||||
<div class="panel-heading">
|
||||
<a class="panel-title d-flex" role="button" data-toggle="collapse" href="#{{ bodyId }}" aria-controls="{{ bodyId }}">
|
||||
<code class="utm-parameter-key mr-sm">{{ keyText is not empty ? keyText : 'mautic.smartlinks.config.custom.new'|trans }}</code>
|
||||
<span class="text-muted">{{ fields.label.vars.value }}</span>
|
||||
{% if form.vars.utm_auto_generated %}
|
||||
<span class="label label-default ml-sm" data-toggle="tooltip" title="{{ 'mautic.smartlinks.config.auto_generated.tooltip'|trans }}">{{ 'mautic.smartlinks.config.auto_generated.badge'|trans }}</span>
|
||||
{% endif %}
|
||||
{% if hasErrors %}<i class="ri-alert-line text-danger ml-sm"></i>{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="{{ bodyId }}" class="panel-collapse collapse{{ hasErrors or (isCustom and keyText is empty) ? ' in' : '' }}">
|
||||
<div class="panel-body">
|
||||
{% if form.vars.utm_description_key %}
|
||||
<p class="text-muted small">{{ form.vars.utm_description_key|trans }}</p>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
{% if isCustom %}
|
||||
<div class="col-md-3">{{ form_row(fields.key) }}</div>
|
||||
{% endif %}
|
||||
<div class="col-md-{{ isCustom ? 3 : 4 }}">{{ form_row(fields.label) }}</div>
|
||||
<div class="col-md-{{ isCustom ? 3 : 4 }}">{{ form_row(fields.mode) }}</div>
|
||||
<div class="col-md-{{ isCustom ? 3 : 4 }}">{{ form_row(fields.enabled) }}</div>
|
||||
</div>
|
||||
|
||||
{% if fields.values is defined %}
|
||||
{% set values = fields.values %}
|
||||
<div class="row">
|
||||
{# Hidden unless mode = dropdown, by Mautic's form field state switcher (data-show-on). #}
|
||||
<div class="col-xs-12 utm-values-editor" id="{{ form.vars.id }}_values_editor"
|
||||
data-show-on="{{ {(fields.mode.vars.id): 'dropdown'}|json_encode|e('html_attr') }}">
|
||||
<label class="control-label">{{ 'mautic.smartlinks.config.values'|trans }}</label>
|
||||
{{ form_errors(values) }}
|
||||
<div class="row small text-muted mb-xs">
|
||||
<div class="col-xs-1"></div>
|
||||
<div class="col-xs-4">{{ 'mautic.smartlinks.config.values.value'|trans }}</div>
|
||||
<div class="col-xs-4">{{ 'mautic.smartlinks.config.values.label'|trans }}</div>
|
||||
<div class="col-xs-2">{{ 'mautic.smartlinks.config.values.default'|trans }}</div>
|
||||
</div>
|
||||
<div class="utm-values-list" data-prototype="{{ form_widget(values.vars.prototype)|e('html_attr') }}">
|
||||
{% for row in values %}
|
||||
{{ form_widget(row) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<p class="text-muted small utm-values-empty{{ values|length > 0 ? ' hide' : '' }}">{{ 'mautic.smartlinks.config.values.empty'|trans }}</p>
|
||||
|
||||
<div class="mb-sm">
|
||||
<button type="button" class="btn btn-default btn-sm" data-utm-add-value>
|
||||
<i class="ri-add-line"></i> {{ 'mautic.smartlinks.config.values.add'|trans }}
|
||||
</button>
|
||||
{% if form.vars.utm_suggestions is not empty %}
|
||||
<button type="button" class="btn btn-default btn-sm{{ values|length > 0 ? ' hide' : '' }}" data-utm-load-suggestions
|
||||
data-utm-suggestions="{{ form.vars.utm_suggestions|json_encode|e('html_attr') }}">
|
||||
<i class="ri-magic-line"></i> {{ 'mautic.smartlinks.config.values.suggestions'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<label class="control-label small" for="{{ form.vars.id }}_import">{{ 'mautic.smartlinks.config.values.import'|trans }}</label>
|
||||
<div class="input-group mb-sm">
|
||||
{# Not a form field: the text is never submitted, the script turns it into value rows. #}
|
||||
<textarea id="{{ form.vars.id }}_import" class="form-control utm-import-text" rows="3"
|
||||
placeholder="{{ 'mautic.smartlinks.config.values.import.placeholder'|trans }}"></textarea>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" data-utm-import>{{ 'mautic.smartlinks.config.values.import.button'|trans }}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% do values.setRendered() %}
|
||||
{% endif %}
|
||||
|
||||
{% if isCustom %}
|
||||
<button type="button" class="btn btn-danger btn-sm" data-utm-remove-parameter>
|
||||
<i class="ri-delete-bin-line"></i> {{ 'mautic.smartlinks.config.custom.remove'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{# One allowed value of a dropdown parameter. #}
|
||||
{% block utm_value_widget %}
|
||||
{% set fields = form.children %}
|
||||
<div class="row mb-xs utm-value-row">
|
||||
<div class="col-xs-1">
|
||||
<span class="btn btn-default btn-sm utm-value-handle" title="{{ 'mautic.smartlinks.config.values.drag'|trans }}"><i class="ri-draggable"></i></span>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
{{ form_widget(fields.value) }}
|
||||
{{ form_errors(fields.value) }}
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
{{ form_widget(fields.label) }}
|
||||
{{ form_errors(fields.label) }}
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
<label class="checkbox-inline" title="{{ 'mautic.smartlinks.config.values.default'|trans }}">
|
||||
{{ form_widget(fields.is_default) }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-xs-1">
|
||||
<button type="button" class="btn btn-default btn-sm" data-utm-remove-value title="{{ 'mautic.smartlinks.config.values.remove'|trans }}">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,71 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}smartlinksSmartLink{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if form.vars.data.id %}
|
||||
{{ 'mautic.smartlinks.smart_links.header.edit'|trans({'%slug%': form.vars.data.slug}) }}
|
||||
{% else %}
|
||||
{{ 'mautic.smartlinks.smart_links.header.new'|trans }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ form_start(form) }}
|
||||
<div class="box-layout">
|
||||
<div class="col-md-9 height-auto bdr-r">
|
||||
<div class="pa-md">
|
||||
{# Short link preview: the slug the user types, on the domain set in Smart Links Settings. #}
|
||||
<div class="well well-sm" id="smartLinkDomainReminder"
|
||||
data-domain="{{ form.vars.smart_link_domain }}"
|
||||
data-separator="{{ form.vars.smart_link_separator }}"
|
||||
data-lowercase="{{ form.vars.smart_link_lowercase ? '1' : '0' }}">
|
||||
<span class="text-muted">{{ 'mautic.smartlinks.smart_links.domain.reminder'|trans }}</span>
|
||||
<code id="smartLinkPreview">{{ form.vars.smart_link_domain ? form.vars.smart_link_domain ~ '/l/' : '' }}{{ form.vars.smart_link_slug }}</code>
|
||||
</div>
|
||||
|
||||
<div class="input-group smart-link-slug-group">
|
||||
{{ form_row(form.slug) }}
|
||||
{% if not form.vars.smart_link_is_saved %}
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" id="smartLinkGenerateSlug"
|
||||
data-generated="{{ form.vars.smart_link_generated }}"
|
||||
title="{{ 'mautic.smartlinks.smart_links.slug.generate.tooltip'|trans }}">
|
||||
<i class="ri-refresh-line"></i>
|
||||
{{ 'mautic.smartlinks.smart_links.slug.generate'|trans }}
|
||||
</button>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# The UTM taxonomy of the link: its allowed values drive the fields on the right. #}
|
||||
{{ form_row(form.taxonomy) }}
|
||||
|
||||
{{ form_row(form.redirectType) }}
|
||||
<div id="smartLinkDestinationUrlWrapper"{% if form.vars.data.redirectType.value == 'mautic' %} class="hide"{% endif %}>
|
||||
{{ form_row(form.destinationUrl) }}
|
||||
</div>
|
||||
<div id="smartLinkMauticDestinationWrapper"{% if form.vars.data.redirectType.value != 'mautic' %} class="hide"{% endif %}>
|
||||
{{ form_row(form.destination) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 height-auto">
|
||||
<div class="pr-lg pl-lg pt-md pb-md">
|
||||
<h4>{{ 'mautic.smartlinks.smart_links.utm_parameters'|trans }}</h4>
|
||||
<p class="text-muted small">{{ 'mautic.smartlinks.smart_links.utm_parameters.help'|trans }}</p>
|
||||
{# One fieldset per taxonomy: Mautic's data-show-on switcher shows the one of the
|
||||
chosen taxonomy (the container carries the col- class the switcher toggles). #}
|
||||
{% for taxonomyId, fieldset in form.vars.smart_link_utm_fieldsets %}
|
||||
<div class="col-xs-12 smart-link-utm-fields" data-show-on="{{ {(form.taxonomy.vars.id): taxonomyId}|json_encode|e('html_attr') }}">
|
||||
{% for key in fieldset.keys %}
|
||||
{{ form_row(form.utmParameters[fieldset.prefix ~ key]) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% do form.utmParameters.setRendered() %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,149 @@
|
||||
{% set isIndex = 'index' == tmpl|default('index') ? true : false %}
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}smartlinksSmartLink{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mautic.smartlinks.smart_links.header.index'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="page-list-wrapper" class="{% if items|length > 0 or searchValue is not empty %}panel {% endif %}panel-default">
|
||||
{# The toolbar belongs to the full page only: ajax reloads (sort, filter, pagination)
|
||||
replace the contents of .page-list, so including it here again would duplicate it. #}
|
||||
{% if isIndex %}
|
||||
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
|
||||
'searchValue': searchValue,
|
||||
'action': currentRoute,
|
||||
'page_actions': {
|
||||
'templateButtons': {
|
||||
'new': permissions[permissionBase ~ ':create'],
|
||||
},
|
||||
'langVar': 'smartlinks.smart_links',
|
||||
'routeBase': 'smart_links',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'smartlinks.smart_links',
|
||||
'templateButtons': {
|
||||
'delete': permissions[permissionBase ~ ':deleteown'] or permissions[permissionBase ~ ':deleteother'],
|
||||
},
|
||||
},
|
||||
}) -}}
|
||||
{% endif %}
|
||||
<div class="page-list">
|
||||
{% if items is defined and items is not empty %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="smartLinkTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#smartLinkTable',
|
||||
}) }}
|
||||
{# Columns: Short link, Slug, Redirect, Destination, Date added. #}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.slug',
|
||||
'text': 'mautic.smartlinks.smart_links.short_link',
|
||||
'class': 'col-smart-link-slug',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'text': 'mautic.smartlinks.smart_links.taxonomy',
|
||||
'class': 'visible-md visible-lg col-smart-link-taxonomy',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.redirectType',
|
||||
'text': 'mautic.smartlinks.smart_links.redirect_type',
|
||||
'class': 'visible-md visible-lg col-smart-link-type',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.destinationUrl',
|
||||
'text': 'mautic.smartlinks.smart_links.destination_url',
|
||||
'class': 'visible-md visible-lg col-smart-link-destination',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.hitCount',
|
||||
'text': 'mautic.smartlinks.smart_links.hits',
|
||||
'class': 'col-smart-link-hits',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.dateAdded',
|
||||
'text': 'mautic.core.date.added',
|
||||
'class': 'visible-md visible-lg col-smart-link-date',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions[permissionBase ~ ':editown'], permissions[permissionBase ~ ':editother'], item.createdBy) %}
|
||||
<tr>
|
||||
<td>
|
||||
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': canEdit,
|
||||
'delete': securityHasEntityAccess(permissions[permissionBase ~ ':deleteown'], permissions[permissionBase ~ ':deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'smartlinks.smart_links',
|
||||
'routeBase': 'smart_links',
|
||||
}) -}}
|
||||
</td>
|
||||
<td>
|
||||
{# Shortened link https://{domain}/l/{slug}; a tooltip shows the UTM parameters it carries. #}
|
||||
{% set shortLink = shortLinkDomain ? 'https://' ~ shortLinkDomain ~ '/l/' ~ item.slug : item.slug %}
|
||||
{% if canEdit %}
|
||||
<a href="{{ path(actionRoute, {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax" title="{{ shortLink }}">{{ shortLink }}</a>
|
||||
{% else %}
|
||||
<span title="{{ shortLink }}">{{ shortLink }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">
|
||||
{{ item.taxonomy.name|default('—') }}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">
|
||||
<span class="label label-{{ item.redirectType.value == 'mautic' ? 'info' : 'warning' }}">
|
||||
{{ ('mautic.smartlinks.smart_links.redirect_type.' ~ item.redirectType.value)|trans ~ ' · ' ~ item.redirectCode.value }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="visible-md visible-lg text-muted">
|
||||
{{ item.destinationLabel|default('—') }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info" title="{{ 'mautic.smartlinks.smart_links.hits.tooltip'|trans }}">
|
||||
{{ hitCounts[item.id]|default(0) }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="visible-md visible-lg">{{ dateToFull(item.dateAdded) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="panel-footer">
|
||||
{{- include('@MauticCore/Helper/pagination.html.twig', {
|
||||
'totalItems': totalItems,
|
||||
'page': page,
|
||||
'limit': limit,
|
||||
'baseUrl': path(indexRoute),
|
||||
'sessionVar': sessionVar,
|
||||
}) -}}
|
||||
</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': 'mautic.smartlinks.smart_links.onboarding.heading',
|
||||
'subheading': 'mautic.smartlinks.smart_links.onboarding.subheading',
|
||||
'copy': 'mautic.smartlinks.smart_links.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,43 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}smartlinksUtmTaxonomy{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if form.vars.data.id %}
|
||||
{{ 'mautic.smartlinks.taxonomies.header.edit'|trans({'%name%': form.vars.data.name}) }}
|
||||
{% else %}
|
||||
{{ 'mautic.smartlinks.taxonomies.header.new'|trans }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ form_start(form) }}
|
||||
<div class="box-layout">
|
||||
<div class="col-md-9 height-auto bdr-r">
|
||||
<div class="pa-md">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.description) }}
|
||||
|
||||
<h4 class="fw-sb mt-lg mb-xs">{{ 'mautic.smartlinks.taxonomies.parameters'|trans }}</h4>
|
||||
<p class="text-muted small">{{ 'mautic.smartlinks.taxonomies.parameters.help'|trans }}</p>
|
||||
{{ form_errors(form.parameters) }}
|
||||
<div class="panel panel-default mb-md">
|
||||
<div class="panel-body">
|
||||
{# One checkbox list per dropdown parameter: the choices are exactly the
|
||||
values configured in Smart Links Settings, nothing can be typed. #}
|
||||
{% for key, child in form.parameters %}
|
||||
<div class="col-xs-6">{{ form_row(child) }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% do form.parameters.setRendered() %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 height-auto">
|
||||
<div class="pr-lg pl-lg pt-md pb-md">
|
||||
{{ form_row(form.buttons) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -1,19 +1,127 @@
|
||||
{% set isIndex = 'index' == tmpl ? true : false %}
|
||||
{% set isIndex = 'index' == tmpl|default('index') ? true : false %}
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}mt3sMpProgramUtmTaxonomy{% endblock %}
|
||||
{% block mauticContent %}smartlinksUtmTaxonomy{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mt3s.marketing_program.utm_taxonomy.header.index'|trans }}{% endblock %}
|
||||
{% block headerTitle %}{{ 'mautic.smartlinks.taxonomies.header.index'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-list">
|
||||
<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.utm_taxonomy.onboarding.heading',
|
||||
'subheading': 'mt3s.marketing_program.utm_taxonomy.onboarding.subheading',
|
||||
'copy': 'mt3s.marketing_program.utm_taxonomy.onboarding.copy',
|
||||
}) }}
|
||||
<div id="page-list-wrapper" class="{% if items|length > 0 or searchValue is not empty %}panel {% endif %}panel-default">
|
||||
{# The toolbar belongs to the full page only: ajax reloads (sort, filter, pagination)
|
||||
replace the contents of .page-list, so including it here again would duplicate it. #}
|
||||
{% if isIndex %}
|
||||
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
|
||||
'searchValue': searchValue,
|
||||
'action': currentRoute,
|
||||
'page_actions': {
|
||||
'templateButtons': {
|
||||
'new': permissions[permissionBase ~ ':create'],
|
||||
},
|
||||
'langVar': 'smartlinks.taxonomies',
|
||||
'routeBase': 'utm_taxonomies',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'smartlinks.taxonomies',
|
||||
'templateButtons': {
|
||||
'delete': permissions[permissionBase ~ ':deleteown'] or permissions[permissionBase ~ ':deleteother'],
|
||||
},
|
||||
},
|
||||
}) -}}
|
||||
{% endif %}
|
||||
<div class="page-list">
|
||||
{% if items is defined and items is not empty %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="utmTaxonomyTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#utmTaxonomyTable',
|
||||
}) }}
|
||||
{# Columns: Name, Description, Parameters, Date added. #}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.name',
|
||||
'text': 'mautic.smartlinks.taxonomies.name',
|
||||
'class': 'col-utm-taxonomy-name',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.description',
|
||||
'text': 'mautic.smartlinks.taxonomies.description',
|
||||
'class': 'visible-md visible-lg col-utm-taxonomy-description',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'text': 'mautic.smartlinks.taxonomies.parameter_count',
|
||||
'class': 'visible-md visible-lg col-utm-taxonomy-parameters',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': sessionVar,
|
||||
'orderBy': tablePrefix ~ '.dateAdded',
|
||||
'text': 'mautic.core.date.added',
|
||||
'class': 'visible-md visible-lg col-utm-taxonomy-date',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions[permissionBase ~ ':editown'], permissions[permissionBase ~ ':editother'], item.createdBy) %}
|
||||
<tr>
|
||||
<td>
|
||||
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': canEdit,
|
||||
'delete': securityHasEntityAccess(permissions[permissionBase ~ ':deleteown'], permissions[permissionBase ~ ':deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'smartlinks.taxonomies',
|
||||
'routeBase': 'utm_taxonomies',
|
||||
}) -}}
|
||||
</td>
|
||||
<td>
|
||||
{% if canEdit %}
|
||||
<a href="{{ path(actionRoute, {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{{ item.name }}</a>
|
||||
{% else %}
|
||||
<span>{{ item.name }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg text-muted">
|
||||
{{ item.description|default('—')|slice(0, 120) }}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">
|
||||
<span class="label label-info" title="{{ 'mautic.smartlinks.taxonomies.parameter_count.tooltip'|trans }}">
|
||||
{{ item.parameters|length }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="visible-md visible-lg">{{ dateToFull(item.dateAdded) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="panel-footer">
|
||||
{{- include('@MauticCore/Helper/pagination.html.twig', {
|
||||
'totalItems': totalItems,
|
||||
'page': page,
|
||||
'limit': limit,
|
||||
'baseUrl': path(indexRoute),
|
||||
'sessionVar': sessionVar,
|
||||
}) -}}
|
||||
</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': 'mautic.smartlinks.taxonomies.onboarding.heading',
|
||||
'subheading': 'mautic.smartlinks.taxonomies.onboarding.subheading',
|
||||
'copy': 'mautic.smartlinks.taxonomies.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user