133 lines
7.2 KiB
Twig
133 lines
7.2 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 %}planTask{% endblock %}
|
|
|
|
{% block headerTitle %}{{ 'mautic.plan.task.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">
|
|
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
|
|
'searchValue': searchValue,
|
|
'action': currentRoute,
|
|
'page_actions': {
|
|
'templateButtons': {
|
|
'new': permissions['plan:tasks:create'],
|
|
},
|
|
'langVar': 'plan.task',
|
|
},
|
|
'bulk_actions': {
|
|
'langVar': 'plan.task',
|
|
'templateButtons': {
|
|
'delete': permissions['plan:tasks:deleteown'] or permissions['plan:tasks:deleteother'],
|
|
},
|
|
},
|
|
}) -}}
|
|
<div class="page-list">
|
|
{% if items is defined and items is not empty %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover" id="planTaskTable">
|
|
<thead>
|
|
<tr>
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'checkall': 'true',
|
|
'target': '#planTaskTable',
|
|
}) }}
|
|
{# Columns: ID, Name, Description, Start date, End date, Status. #}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan.task',
|
|
'orderBy': 't.id',
|
|
'text': 'mautic.core.id',
|
|
'class': 'col-plan-task-id',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan.task',
|
|
'orderBy': 't.name',
|
|
'text': 'mautic.plan.task.field.name',
|
|
'class': 'col-plan-task-name',
|
|
'default': true,
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan.task',
|
|
'text': 'mautic.plan.task.field.description',
|
|
'class': 'visible-md visible-lg col-plan-task-description',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan.task',
|
|
'orderBy': 't.startDate',
|
|
'text': 'mautic.plan.task.field.start_date',
|
|
'class': 'col-plan-task-start',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan.task',
|
|
'orderBy': 't.endDate',
|
|
'text': 'mautic.plan.task.field.end_date',
|
|
'class': 'col-plan-task-end',
|
|
}) }}
|
|
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
|
'sessionVar': 'plan.task',
|
|
'orderBy': 't.status',
|
|
'text': 'mautic.plan.task.field.status',
|
|
'class': 'col-plan-task-status',
|
|
}) }}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in items %}
|
|
{% set canEdit = securityHasEntityAccess(permissions['plan:tasks:editown'], permissions['plan:tasks:editother'], item.createdBy) %}
|
|
<tr>
|
|
<td>
|
|
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
|
'item': item,
|
|
'templateButtons': {
|
|
'edit': canEdit,
|
|
'delete': securityHasEntityAccess(permissions['plan:tasks:deleteown'], permissions['plan:tasks:deleteother'], item.createdBy),
|
|
},
|
|
'langVar': 'plan.task',
|
|
}) -}}
|
|
</td>
|
|
<td>{{ item.id }}</td>
|
|
<td>
|
|
{% if canEdit %}
|
|
<a href="{{ path('plan_task_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{{ item.name }}</a>
|
|
{% else %}
|
|
{{ item.name }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="visible-md visible-lg text-muted">
|
|
{% set description = item.description|default('')|striptags|trim %}
|
|
{{ description|length > 120 ? description|slice(0, 120) ~ '…' : description }}
|
|
</td>
|
|
<td>{{ item.startDate ? dateToFull(item.startDate) : '' }}</td>
|
|
<td>{{ item.endDate ? dateToFull(item.endDate) : '' }}</td>
|
|
<td><span class="label {{ item.status.labelClass }}">{{ item.status.labelKey|trans }}</span></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<div class="panel-footer">
|
|
{{- include('@MauticCore/Helper/pagination.html.twig', {
|
|
'totalItems': totalItems,
|
|
'page': page,
|
|
'limit': limit,
|
|
'baseUrl': path('plan_task_index'),
|
|
'sessionVar': 'plan.task',
|
|
}) -}}
|
|
</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.plan.task.onboarding.heading',
|
|
'subheading': 'mautic.plan.task.onboarding.subheading',
|
|
'copy': 'mautic.plan.task.onboarding.copy',
|
|
}) }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|