{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2026 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/>.
 #
 # ---------------------------------------------------------------------
 #}

<div id="planning_filter">
    <div id="planning_filter_toggle">
        <a class="toggle cursor-pointer" title="{{ __('Toggle filters') }}"></a>
    </div>
    <div id="planning_filter_content">
        {% set headings = {
            'filters': __('Filters'),
            'plannings': __('Plannings')
        } %}
        {% for filter_heading, filters in session('glpi_plannings') %}
            {% if filter_heading in headings|keys %}
                <div>
                    <h3>
                        {{ headings[filter_heading] }}
                        {% if filter_heading == 'plannings' %}
                            <a class="planning_link planning_add_filter" href="{{ path('/ajax/planning.php?action=add_planning_form') }}" title="{{ __('Add a calendar') }}">
                                <i class="ti ti-circle-plus"></i>
                            </a>
                        {% endif %}
                    </h3>
                    <ul class="filters">
                        {% for filter_key, filter_data in filters %}
                            {% do call('Planning::showSingleLinePlanningFilter', [filter_key, filter_data, {filter_color_index: 0}]) %}
                        {% endfor %}
                    </ul>
                </div>
            {% endif %}
        {% endfor %}
    </div>
</div>
