{% extends 'AppBundle:Admin/Application:layout.html.twig' %}
{% form_theme form 'bootstrap_3_layout.html.twig' %}

{% block content %}
    <style>
        .tpolska {
            display: none;
        }
        .polska .tpolska {
            display: block;
        }
        .polska .npolska {
            display: none;
        }
    </style>
    <div id="create-application" class="col-md-10" data-connections-url="{{ path('app.order.connections') }}">
        <h3>Zamówienie: dodaj</h3>

        <div class="row">
            <div class="col-md-4"></div>
            <div class="col-md-4">
                {{ form_start(form) }}
                {{ form_row(form.loading) }}
                {{ form_row(form.unloading) }}
                {{ form_row(form.volume) }}
                {{ form_row(form.weight) }}
                <div class="form-group">
                  <div class="checkbox">
                    <label><input type="checkbox" name="o_data" data-dusd='{"documentary":"{{settings.documentary}}", "warehouse":"{{settings.warehouse}}", "thc": "{{settings.thc}}", "isps": "{{settings.isps}}", "customs": "{{settings.customs}}"}' data-deur='{"documentary":"{{setting_euro.documentary}}", "warehouse":"{{setting_euro.warehouse}}", "thc": "{{setting_euro.thc}}", "isps": "{{setting_euro.isps}}", "customs": "{{setting_euro.customs}}"}'>Opłaty w euro?</label>
                  </div>
                </div>
                {{ form_row(form.documentary, {attr: {'data-cost': settings.documentary }}) }}
                <div class="tpolska">
                    {{ form_row(form.warehouse, {attr: {'data-cost': settings.warehouse }}) }}
                </div>
                <div class="npolska">
                    {{ form_row(form.thc, {attr: {'data-cost': settings.thc }}) }}
                    {{ form_row(form.isps, {attr: {'data-cost': settings.isps }}) }}
                </div>
                {{ form_row(form.customs, {attr: {'data-cost': settings.customs }}) }}

                <div class="npolska">
                    {{ form_row(form.transport) }}
                    <div class="transport" style="display: none; background-color: #eee; padding: 15px;">
                        {{ form_row(form.city) }}
                        {{ form_row(form.postalCode) }}

                        <div class="form-group">
                            <label class="control-label">Wymiary</label>

                            {{ form_row(form.firstDimension) }}
                            {{ form_row(form.secondDimension) }}
                            {{ form_row(form.thirdDimension) }}
                        </div>

                        {{ form_row(form.quantity) }}
                        {{ form_row(form.quantityType) }}
                    </div>
                </div>

                {{ form_row(form.voucher) }}
                {{ form_row(form.fullName) }}
                {{ form_row(form.company) }}
                {{ form_row(form.phone) }}
                {{ form_row(form.email) }}
                {{ form_row(form.comment, { attr: { rows: 4 } }) }}

                <div class="form-group">
                    <label class="control-label">Cena</label>
                    <span id="cost-value">0</span> USD
                </div>

                <div class="form-group text-right">
                    <button type="submit" class="btn btn-success">Zapisz</button>
                </div>
                {{ form_end(form) }}
            </div>
            <div class="col-md-4"></div>
        </div>
    </div>
{% endblock %}
