{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2025 Teclib' and contributors.
 # @copyright 2003-2014 by the INDEPNET Development Team.
 # @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 class="container-fluid">
    <div class="search_page">
        <div class="search-container">
            <div class="card card-sm search-card">
                <div class="card-header search-header pe-0">
                    <div class='btn-group flex-wrap mb-3'>
                        <span class="btn bg-blue-lt pe-none" aria-disabled="true">
                            <i class='fas fa-check fa-lg me-2'></i>
                            {{ __('Import process is complete.') }}
                        </span>
                    </div>
                    <div class='btn-group flex-wrap mb-3 ms-2'>
                        <a href="javascript:history.back();" class="btn btn-primary">
                        <i class='fas fa-backward fa-lg me-2'></i>
                            {{ __('Back') }}
                        </a>
                    </div>
                </div>
                <div class="table-responsive-md">
                    <table class="search-results table table-hover table-card">
                        <thead>
                            <th>{{ __('Filename') }}</th>
                            <th>{{ __('Result') }}</th>
                            <th>{{ _n('Item', 'Items', get_plural_number()) }}</th>
                        </thead>
                        <tbody>
                            {% for filename, result in imported_files %}
                            <tr>
                                <td>{{ filename }}</td>
                                <td>
                                    <span class="{{ result['success'] ? 'text-success' : 'text-danger' }}">
                                        <i class="fas {{ result['success'] ? 'fa-check' : 'fa-exclamation-triangle' }}"></i>
                                        {{ result['message'] }}
                                    </span>
                                </td>
                                <td>
                                    {% if result['items'] is empty %}
                                        {{ __('Import denied (no log)') }}
                                    {% else %}
                                        {% for item in result['items'] %}
                                            <div>
                                                <span>
                                                <i class="{{ item.getIcon() }}"></i>
                                                {{ get_item_link(item) }}
                                                </span>
                                            </div>
                                        {% endfor %}
                                    {% endif %}

                                </td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
