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

{% block content %}

    <ul class="breadcrumbs el">
        <li><a href="/admin/">Home</a> /</li>
        <li class="end">Unilexicon</li>
    </ul>

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

    <ul class="tabnav el">
        <li class="{{ selected_tab == 'manage' ? 'selected' : '' }}">
            <a href="{{ route('nhs-unilexicon-manage') }}">Manage</a>
        </li>
    </ul>


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


    <form action="" method="GET" class="style">
        <fieldset class="show">
            <h1><a class="show el">Search <i class="fa fa-caret-right"></i></a></h1>
            <div class="row">
                <label for="search_query">Product name</label>
                <input type="text" name="search_query" id="search_query" value="{{ search_query }}" />
            </div>
            <div class="search-button">
                <input type="submit" value="Search" class="BUTTON"/>
            </div>
        </fieldset>
    </form>


    <table>
        <thead>
            <tr>
                <th>Unilexicon ID</th>
                <th>Original name</th>
                <th>Display name</th>
                <th>Charges</th>
            </tr>
        </thead>

        <tbody class="tabular">

        {% for product in products %}

            <tr>
                <td style="padding-right: 1em">{{ product.id }}</td>
                <td>{{ product.name }}</td>
                <td>{{ product.mtc__display_name }}</td>
                <td align="center">
                    <a href="{{ route('nhs-unilexicon-decrease-charges', [ product.id ]) }}"><small class="fa fa-minus-circle"></small></a>
                    {{ product.number_of_charges }}
                    <a href="{{ route('nhs-unilexicon-increase-charges', [ product.id ]) }}"><small class="fa fa-plus-circle"></small></a>
                </td>
            </tr>

        {% endfor %}

        </tbody>
    </table>

    <hr />

    {{ products.links() | raw }}

{% endblock %}
