{#
  Variables
    - searchValue
    - items
    - totalItems
    - page
    - limit
    - tmpl
    - permissions
    - model
    - security
#}
{% set isIndex = 'index' == tmpl ? true : false %}
{% set tmpl = 'list' %}
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}

{% block mauticContent %}mobile_notification{% endblock %}

{% block headerTitle %}{{ 'mautic.notification.mobile_notifications'|trans }}{% endblock %}

{% block content %}
  {% if isIndex %}
    <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,
        'searchId': 'mobile-notification-search',
        'action': currentRoute,
        'page_actions': {
            'templateButtons': {
                'new': permissions['notification:mobile_notifications:create'],
            },
            'routeBase': 'mobile_notification',
        },
        'bulk_actions': {
          'routeBase': 'mobile_notification',
          'templateButtons': {
              'delete': permissions['notification:mobile_notifications:deleteown'] or permissions['notification:mobile_notifications:deleteother'],
          },
        },
        'quickFilters': [
            {
                'search': 'mautic.core.searchcommand.ispublished',
                'label': 'mautic.core.form.available',
                'tooltip': 'mautic.core.searchcommand.ispublished.description',
                'icon': 'ri-check-line'
            },
            {
                'search': 'mautic.core.searchcommand.isunpublished',
                'label': 'mautic.core.form.unavailable',
                'tooltip': 'mautic.core.searchcommand.isunpublished.description',
                'icon': 'ri-close-line'
            },
            {
                'search': 'mautic.core.searchcommand.isuncategorized',
                'label': 'mautic.core.form.uncategorized',
                'tooltip': 'mautic.core.searchcommand.isuncategorized.description',
                'icon': 'ri-folder-unknow-line'
            },
            {
                'search': 'mautic.core.searchcommand.ismine',
                'label': 'mautic.core.searchcommand.ismine.label',
                'tooltip': 'mautic.core.searchcommand.ismine.description',
                'icon': 'ri-user-line'
            }
        ]
    }) }}
    <div class="page-list">
  {% endif %}

  {% if items|length > 0 %}
    {{ include('@MauticNotification/MobileNotification/_list.html.twig') }}
  {% else %}
    {% if searchValue is not empty %}
      {{- include('@MauticCore/Helper/noresults.html.twig', {'tip' : 'mautic.category.noresults.tip'}) -}}
    {% else %}
      <div class="mt-80 col-md-offset-2 col-lg-offset-3 col-md-8 col-lg-5 height-auto">
        {% set childContainer %}
          <div class="mt-32 mb-md">
            {% include '@MauticCore/Components/pictogram.html.twig' with {
              'pictogram': 'mobile',
              'size': '80'
            } %}
          </div>
        {% endset %}
        {{ include('@MauticCore/Components/content-block.html.twig', {
          heading: 'mautic.notification.mobile.contentblock.heading',
          subheading: 'mautic.notification.mobile.contentblock.subheading',
          copy: 'mautic.notification.mobile.contentblock.copy',
          childContainer: childContainer
        }) }}
      </div>
    {% endif %}
  {% endif %}

  {% if isIndex %}
        </div>
    </div>
  {% endif %}
{% endblock %}
