{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <div id="flash-messages-container">
    </div>
    <div class="row max-width-initial">
        <div class="small-12 columns">
            <nav aria-label="You are here:" role="navigation">
                <ul class="breadcrumbs">
                    <li><a href="{{ path('item') }}">Item List</a></li>
                    <li>
                        <span class="show-for-sr">Current: </span> Item Details
                    </li>
                </ul>
            </nav>
            {% include '@RxConnexion/Item/overview.html.twig' with {item: item} %}
            <br/>
            <div class="content-container has-loading">
                <div class="content-container-content hide">
                    <ul class="tabs custom-tabs" data-tabs id="item-tabs">
                        {% if userData.type == 'Super Admin' or 'Admin Item Price' in userData.accesses %}
                            <li class="tabs-title {{ tab is null or tab is empty or tab == 'ip' ? 'is-active' : '' }}"><a href="#panel-item-price" aria-selected="true">Price</a></li>
                        {% endif %}
                    </ul>
                    <div class="tabs-content custom-tabs-content" data-tabs-content="item-tabs">
                        <div class="tabs-panel {{ tab is null or tab is empty or tab == 'm' ? 'is-active' : '' }}" id="panel-item-price">
                            <div class="text-right">
                                {% if userData.type == 'Super Admin' or 'Admin Item Price New' in userData.accesses %}
                                    <a href="javascript:void(0)" class="href-item-price-form href-new-action" data-action="n" data-id="0">Add Price</a>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="itemPrice-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>Price</th>
                                    <th>Start Date</th>
                                    <th>End Date</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="reveal small" id="modal" data-reveal>
        <div id="modal-content"></div>
        <button class="close-button" data-close aria-label="Close modal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <div class="reveal large" id="large-modal" data-reveal>
        <div id="large-modal-content"></div>
        <button class="close-button" data-close aria-label="Close modal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script language="javascript">
        //<![CDATA[
        item_detail.settings.item_id = '{{ item_id }}';
        item_detail.settings.itemPrice_ajaxUrl = '{{ path('item_price_ajax_list') }}';
        item_detail.settings.itemPrice_formUrl = '{{ path('item_price_form', {item_id:item_id}) }}';
        item_detail.settings.itemPrice_formActionUrl = '{{ path('item_price_save') }}';
        jQ(document).ready(item_detail.init);
        //]]>
    </script>
{% endblock %}