<div class="modal fade" id="inpostShippingMethodModal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="inpostShippingMethodTitle">{{ title_shipping_method }}</h4>
            </div>
            <div class="modal-body">
                <form action="#" method="post" enctype="multipart/form-data" id="form-shipping-method" class="form-horizontal">
                    <div class="panel-group" id="inpostShippingConfiguration" role="tablist" aria-multiselectable="false">
                        <div class="panel panel-default">
                            <div class="panel-heading" role="tab" id="inpostShippingGeneralHeading">
                                <h4 class="panel-title">
                                    <a role="button" data-toggle="collapse" data-parent="#inpostShippingConfiguration" href="#inpostShippingGeneral" aria-expanded="true" aria-controls="inpostShippingGeneral">
                                        {{ text_general_settings }}
                                    </a>
                                </h4>
                            </div>
                            <div id="inpostShippingGeneral" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="inpostShippingGeneralHeading">
                                <div class="panel-body">
                                    <div class="form-group required">
                                        <label for="input-name" class="col-sm-2 control-label">{{ text_name_of_delivery }}</label>
                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" name="name" id="input-name" value="{{ name ? name }}" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input-status" class="col-sm-2 control-label">{{ entry_status }}</label>
                                        <div class="col-sm-10">
                                            <select name="status" id="input-status" class="form-control">
                                                <option value="0">Disabled</option>
                                                <option value="1" {{ status ? 'selected="selected"' }}>Enabled</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input-fk_delivery_service" class="col-sm-2 control-label">{{ text_delivery_services }}</label>
                                        <div class="col-sm-10">
                                            <select name="fk_delivery_service" id="input-fk_delivery_service" class="form-control">
                                                <option value="0">{{ text_option_no_service }}</option>
                                                {% for service in deliveryServices %}
                                                <option value="{{ service.id_delivery_service }}" {{ fk_delivery_service == service.id_delivery_service  ? 'selected="selected"' }}>{{ service.deliveryServiceName }}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group required">
                                        <label for="input-processing-time" class="col-sm-2 control-label">{{ text_delivery_time }}</label>
                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" name="delivery_time" id="input-processing-time" value="{{ delivery_time ? delivery_time }}" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input-speed-class" class="col-sm-2 control-label">{{ text_speed_class }}</label>
                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" name="speed_class" id="input-speed-class" value="{{ speed_class ? speed_class }}" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input-logo" class="col-sm-2 control-label">{{ text_logo }}</label>
                                        <div class="col-sm-10">
                                            <a href="" id="thumb-logo" data-toggle="image" class="img-thumbnail"><img src="{{ logo_thumb }}" alt="" title="" data-placeholder="{{ placeholder }}"/></a> <input type="hidden" name="logo" value="{{ logo }}" id="input-logo"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input-tracking-url" class="col-sm-2 control-label">{{ text_tracking_url }}</label>
                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" name="tracking_url" id="input-tracking-url" value="{{ tracking_url ? tracking_url : 'https://inpost.pl/sledzenie-przesylek?number=@' }}" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input-sort-order" class="col-sm-2 control-label">{{ text_sort_order }}</label>
                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" name="sort_order" id="input-sort-order" value="{{ sort_order ? sort_order }}" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-heading" role="tab" id="inpostShippingLocationCostsHeading">
                                <h4 class="panel-title">
                                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#inpostShippingConfiguration" href="#inpostShippingLocationCosts" aria-expanded="false" aria-controls="inpostShippingLocationCosts">
                                        {{ text_shipping_location_and_costs }}
                                    </a>
                                </h4>
                            </div>
                            <div id="inpostShippingLocationCosts" class="panel-collapse collapse" role="tabpanel" aria-labelledby="inpostShippingLocationCostsHeading">
                                <div class="panel-body">
                                    <div class="form-group" style="display: none;">
                                        <label for="input-handling-costs" class="col-sm-2 control-label">Add handling costs</label>
                                        <div class="col-sm-10">
{#                                            <input type="hidden" name="handling_costs" value="0" />#}
                                            <input type="checkbox" class="js-switch" name="handling_costs" value="1" id="input-handling-costs" {{ handling_costs ? 'checked="checked"' }} />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input-free-shipping" class="col-sm-2 control-label">{{ text_free_shipping }}</label>
                                        <div class="col-sm-10">
{#                                            <input type="hidden" name="free_shipping" value="0" />#}
                                            <input type="checkbox" class="js-switch" name="free_shipping" value="1" id="input-free-shipping" {{ free_shipping ? 'checked="checked"' }} />
                                        </div>
                                    </div>
                                    <div class="form-group required">
                                        <label for="input-reckoning" class="col-sm-2 control-label">{{ text_reckoning }}</label>
                                        <div class="col-sm-10">
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="reckoning" value="1" {{ reckoning == '1' ? 'checked="checked"' }} />
                                                    {{ text_reckoning_by_weight }}
                                                </label>
                                            </div>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="reckoning" value="2" {{ reckoning == '2' ? 'checked="checked"' }} />
                                                    {{ text_reckoning_by_price }}
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label" for="input-out-ranges">{{ text_out_of_range }}</label>
                                        <div class="col-sm-10">
                                            <select name="out_ranges" id="input-out-ranges" class="form-control">
                                                <option value="0">{{ text_option_disable_carrier }}</option>
                                                <option value="1">{{ text_option_apply_on_highest }}</option>
                                            </select>
                                        </div>
                                    </div>
{#                                    <div class="form-group">#}
{#                                        <label for="input-taxes" class="col-sm-2 control-label">Tax</label>#}
{#                                        <div class="col-sm-10">#}
{#                                            <select name="tax" id="shipping_taxes" class="form-control">#}
{#                                                <option value="0">No tax</option>#}
{#                                                {% for tax_rate in tax_rates %}#}
{#                                                    <option value="{{ tax_rate.tax_rate_id }}" {{ tax == tax_rate.tax_rate_id ? 'selected="selected"' }}>{{ tax_rate.name }}</option>#}
{#                                                {% endfor %}#}
{#                                            </select>#}
{#                                        </div>#}
{#                                    </div>#}
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label" for="input-tax-class">{{ entry_tax_class }}</label>
                                        <div class="col-sm-10">
                                            <select name="tax_class" id="input-tax-class" class="form-control">
                                                <option value="0">{{ text_none }}</option>
                                                {% for taxClass in tax_classes %}
                                                    <option value="{{ taxClass.tax_class_id }}" {{ tax_class == taxClass.tax_class_id ? 'selected="selected"' }}>{{ taxClass.title }}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-12 text-center" for="input-ranges">{{ text_ranges }}</label>
                                        <table class="table table-bordered">
                                            <thead>
                                                <td>{{ text_zone_name }}</td>
                                                <td>{{ entry_status }}</td>
                                                <td><i class="fa fa-info-circle" data-toggle="tooltip" data-placement="top" title="{{ text_ranges_tooltip }}"></i> {{ text_zone_ranges }}</td>
                                            </thead>
                                            {% for geoZone in geo_zones %}
                                                <tr>
                                                    <td>{{ geoZone.name }}</td>
                                                    <td>
                                                        <input type="hidden" name="ranges[{{ geoZone.geo_zone_id }}][geo_zone_id]" value="{{ geoZone.geo_zone_id }}" />
                                                        <input type="checkbox" class="js-switch" name="ranges[{{ geoZone.geo_zone_id }}][status]" value="1" {{ ranges[geoZone.geo_zone_id].status ? 'checked="checked"' }}>
                                                    </td>
                                                    <td><input type="text" class="form-control" name="ranges[{{ geoZone.geo_zone_id }}][range]" placeholder="5:10.0000,10:25.0000" value="{{ ranges[geoZone.geo_zone_id]['range'] ? ranges[geoZone.geo_zone_id]['range'] }}" /></td>
                                                </tr>
                                            {% endfor %}
                                            </tbody>
                                        </table>
                                    </div>
{#                                    <div class="form-group">#}
{#                                        <label class="col-sm-2 control-label" for="input-geo-zone">Geo Zone</label>#}
{#                                        <div class="col-sm-10">#}
{#                                            <select name="geo_zone" id="input-geo-zone" class="form-control">#}
{#                                                <option value="0">{{ text_all_zones }}</option>#}
{#                                                {% for geoZone in geo_zones %}#}
{#                                                    <option value="{{ geoZone.geo_zone_id }}" {{ geo_zone == geoZone.geo_zone_id ? 'selected="selected"' }}>{{ geoZone.name }}</option>#}
{#                                                {% endfor %}#}
{#                                            </select>#}
{#                                        </div>#}
{#                                    </div>#}
                                </div>
                            </div>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-heading" role="tab" id="inpostShippingSizeWeightHeading">
                                <h4 class="panel-title">
                                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#inpostShippingConfiguration" href="#inpostShippingSizeWeight" aria-expanded="false" aria-controls="inpostShippingSizeWeight">
                                        {{ text_size_weight_cg }}
                                    </a>
                                </h4>
                            </div>
                            <div id="inpostShippingSizeWeight" class="panel-collapse collapse" role="tabpanel" aria-labelledby="inpostShippingSizeWeightHeading">
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label" for="input-length">{{ text_max_length }}</label>
                                        <div class="col-sm-10">
                                            <div class="input-group">
                                                <input type="text" name="length" id="input-length" class="form-control" placeholder="{{ text_max_length }}" value="{{ length ? length }}">
                                                <span class="input-group-addon">{{ text_mm }}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label" for="input-width">{{ text_max_width }}</label>
                                        <div class="col-sm-10">
                                            <div class="input-group">
                                                <input type="text" name="width" id="input-width" class="form-control" placeholder="{{ text_max_width }}" value="{{ width ? width }}">
                                                <span class="input-group-addon">{{ text_mm }}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label" for="input-height">{{ text_max_height }}</label>
                                        <div class="col-sm-10">
                                            <div class="input-group">
                                                <input type="text" name="height" id="input-height" class="form-control" placeholder="{{ text_max_height }}" value="{{ height ? height }}">
                                                <span class="input-group-addon">{{ text_mm }}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label" for="input-weight">{{ text_max_weight }}</label>
                                        <div class="col-sm-10">
                                            <div class="input-group">
                                                <input type="text" name="weight" id="input-weight" class="form-control" placeholder="{{ text_max_weight }}" value="{{ weight ? weight }}">
                                                <span class="input-group-addon">{{ text_kg }}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label" for="input-customer-group">{{ text_customer_groups }}</label>
                                        <div class="col-sm-10">
                                            <input type="hidden" name="customer_group[]" value="[]">
                                            {% for group in customer_groups %}
                                                <div class="checkbox">
                                                    <label>
                                                        <input type="checkbox"
                                                               class="js-switch"
                                                               name="customer_group[]"
                                                               id="input-customer-group"
                                                               value="{{ group.customer_group_id }}"
                                                                {% if group.customer_group_id in customer_group %} checked="checked" {% endif %}
                                                                {% if not customer_group %} checked="checked" {% endif %}
                                                        >
                                                        {{ group.name }}
                                                    </label>
                                                </div>
                                            {% endfor %}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
{#                        <div class="panel panel-default">#}
{#                            <div class="panel-heading" role="tab" id="inpostShippingSummaryHeading">#}
{#                                <h4 class="panel-title">#}
{#                                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#inpostShippingConfiguration" href="#inpostShippingSummary" aria-expanded="false" aria-controls="inpostShippingSummary">#}
{#                                        Summary#}
{#                                    </a>#}
{#                                </h4>#}
{#                            </div>#}
{#                            <div id="inpostShippingSummary" class="panel-collapse collapse" role="tabpanel" aria-labelledby="inpostShippingSummaryHeading">#}
{#                                <div class="panel-body">#}
{#                                    789#}
{#                                </div>#}
{#                            </div>#}
{#                        </div>#}
                    </div>
{#                    <input type="hidden" name="fk_delivery_service" id="fk_delivery_service" value="{{ fk_delivery_service ? fk_delivery_service : 0 }}" />#}
                    <input type="hidden" name="shippingMethodId" id="shippingMethodId" value="{{ id_shipping_method ? id_shipping_method : 0 }}" />
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" id="button-close-shipping-method-modal">{{ text_button_modal_close }}</button>
                <button type="button" class="btn btn-primary" id="button-submit-shipping-method-form">{{ text_button_modal_save }}</button>
            </div>
        </div>
    </div>
</div>