{% 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-assetgallery-icons-manage') }}">All</a>
        </li>
        <li class="{{ selected_tab == 'edit' ? 'selected' : '' }}">
            <a href="{{ route('admin-assetgallery-icons-edit', icon.id) }}">Edit</a>
        </li>
    </ul>


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

    <form action="{{ route('admin-assetgallery-icons-upsert', icon.id) }}" method="POST" class="style" enctype="multipart/form-data">

        <fieldset class="show">
            <h1>
                <a class="show el">
                    Edit
                    <i class="fa fa-caret-right"></i>
                </a>
            </h1>

            {{ form_field({
                'type': 'text',
                'name': 'label',
                'label': 'Label',
                'value': icon.label,
            }) }}

            {{ form_field({
                'type': 'file',
                'name': 'filename',
                'label': 'File',
                'value': icon.filename,
            }) }}

            {% if (icon.filepath) %}
                <div class="row">
                    <img src="{{ icon.getFileUrl() }}" width="300" />
                </div>
            {% endif %}

            <button type="submit" name="button_pressed" value="save"  class="btn">
                Save
            </button>

        </fieldset>

    </form>

{% endblock %}

