{% extends 'layouts/admin.twig' %}

{% block content %}

    <ul class="breadcrumbs el">
        <li><a href="/admin/">Admin</a> /</li>
        <li class="end">Asset Gallery</li>
    </ul>

    <h1>{{ title }}</h1>

    <ul class="tabnav el">
        <li class="{{ selected_tab == 'manage' ? 'selected' : '' }}">
            <a href="{{ route('admin-bundle-types') }}">All</a>
        </li>
        <li class="{{ selected_tab == 'edit' ? 'selected' : '' }}">
            <a href="{{ route('admin-assetgallery-icons-upsert') }}">Add new</a>
    </ul>


    {% include 'admin/messages.twig' %}

    <table id="js_manage_bundle_types">

        <thead>
            <tr>
                <th>#</th>
                <th>Label</th>
                <th>File</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
        </thead>

        <tbody>
            {% for icon in icons %}
            <tr>
                <td>{{ icon.id }}</td>
                <td>{{ icon.label }}</td>
                <td><img src="{{ icon.getFileUrl() }}" width="50" /></td>
                <td>
                    <a href="{{ route('admin-assetgallery-icons-edit', [ icon.id ], false) }}">
                        <i class="fa fa-pencil"></i>
                    </a>
                </td>
                <td>
                    <a
                        href="{{ route('admin-assetgallery-icons-delete', [ icon.id ], false) }}"
                        class="error"
                        onclick="return confirm('Delete item?')"
                    >
                        <i class="fa fa-times-circle"></i>
                    </a>
                </td>
            </tr>
            {% endfor %}
        </tbody>

    </table>

    <hr />

    <script>

    $(document).ready(function() {
        $('#js_manage_bundle_types').DataTable({
            "searching": false,
            "ordering": false,
            "lengthChange": false,
            "paging": false,
            "info": false,
        });
    } );

    </script>

{% endblock %}
