{% set userData = app.session.get('userData') %}
<form method="POST" id="item_form" action="{{ path('item_item_form', {item_id: item_id, action: action, id: id}) }}">
    <div class="row max-width-initial">
        <div class="large-12 columns">
            <h5>{{ action == 'n' ? 'New' : 'Update' }} Package Item</h5>
            <p class="form-hint-text">Choose item included in this package</p>
            <div class="row">
                <div class="large-4 large-text-right columns">
                    <label for="itemItem_item_description" class="required middle">Item</label>
                </div>
                <div class="large-8 columns">
                    <input type="hidden" id="itemItem_item" name="itemItem[item]" value="{{ item.id|default('') }}">
                    <input type="text" id="itemItem_item_description" name="itemItem[item_description]" required="required" autocomplete="off" value="{{ item.description|default('') }}">
                </div>
            </div>
            <div class="row">
                <div class="large-4 large-text-right columns">
                    <label for="itemItem_quantity" class="required middle">Quantity</label>
                </div>
                <div class="large-8 columns">
                    <input type="text" id="itemItem_quantity" class="quantity" required name="itemItem[quantity]" value="{{ item.packageItemQuantity|default('') }}">
                </div>
            </div>
        </div>
        <div class="large-6 columns">
        </div>
        <div class="small-12 columns">
            <hr class="max-width-initial">
            <div class="button-container">
                <button type="submit" class="button just-continue" name="action" value="{{ action }}"
                        data-message="Are you sure you want to save this information?"
                >Save</button>
                {% if action == 'u' and (userData.type == 'Super Admin' or 'Admin Items Item Delete' in userData.accesses) %}
                    <button type="submit" class="ask-continue button alert" name="action" value="d"
                            data-message="Are you sure you want to delete this record?"
                    >Delete</button>
                {% endif %}
            </div>
        </div>
    </div>
    <input type="hidden" id="itemItem_mainItem" name="itemItem[id]" value="{{ id }}">
    <input type="hidden" id="itemItem_action" name="itemItem[action]" class="form-action">
</form>

<script>
    global.maskInput();
</script>