{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2025 Teclib' and contributors.
 # @licence   https://www.gnu.org/licenses/gpl-3.0.html
 #
 # ---------------------------------------------------------------------
 #
 # LICENSE
 #
 # This file is part of GLPI.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # ---------------------------------------------------------------------
 #}

<table class="table table-borderless">
   {% if notifications|length > 0 %}
      <thead>
         <tr>
            <th>{{ __('Name') }}</th>
            <th>{{ 'Entity'|itemtype_name(1) }}</th>
            <th>{{ __('Active') }}</th>
            <th>{{ _n('Type', 'Types', 1) }}</th>
            <th>{{ __('Notification method') }}</th>
            <th>{{ 'NotificationEvent'|itemtype_name(1) }}</th>
            <th>{{ 'NotificationTemplate'|itemtype_name(1) }}</th>
         </tr>
      </thead>
      <tbody>
         {% for notification in notifications %}
            {% set itemtype = notification.fields['itemtype']|default('') %}
            <tr>
               <td>{{ get_item_link(notification) }}</td>
               <td>{{ get_item_name('Entity', notification.getEntityID()) }}</td>
               <td>{{ notification.fields['is_active'] ? __('Yes') : __('No') }}</td>
               <td>
                  {{ itemtype|itemtype_name }}
               </td>
               <td>
                  {{ call('Notification_NotificationTemplate::getMode', [notification.fields['mode']]) }}
               </td>
               <td>
                  {{ call('NotificationEvent::getEventName', [itemtype, notification.fields['event']]) }}
               </td>
               <td>
                  {{ get_item_name('NotificationTemplate', notification.fields['notificationtemplates_id']) }}
               </td>
            </tr>
         {% endfor %}
      </tbody>
   {% else %}
      <tbody>
         <tr><td class="b center">{{ __('No results found') }}</td></tr>
      </tbody>
   {% endif %}
</table>
