{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}

{% if changeOrderAddressForm is not null %}
  <div class="modal fade" id="updateCustomerAddressModal">
      <div class="modal-dialog" role="document">
        {{ form_start(changeOrderAddressForm,
          {action: path('admin_orders_change_customer_address', {orderId: orderForViewing.id, customerId: orderForViewing.customer.id})}) }}
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title">
                {{ 'Select another address'|trans({}, 'Admin.Actions') }}
              </h5>

              <button type="button" class="close" data-dismiss="modal" aria-label="{{ 'Close'|trans({}, 'Admin.Actions') }}">
                <span aria-hidden="true">×</span>
              </button>
            </div>

            <div class="modal-body">
              <div class="form-group m-0">
                {{ form_widget(changeOrderAddressForm.new_address_id) }}
              </div>
            </div>

            {{ form_widget(changeOrderAddressForm.address_type) }}

            <div class="modal-footer">
              <button id="change-address-cancel-button" type="button" class="btn btn-outline-secondary" data-dismiss="modal">
                {{ 'Cancel'|trans({}, 'Admin.Actions') }}
              </button>

              <button id="change-address-submit-button" type="submit" class="btn btn-primary">
                {{ 'Select'|trans({}, 'Admin.Actions') }}
              </button>
            </div>
          </div>
        {{ form_end(changeOrderAddressForm) }}
      </div>
  </div>
{% endif %}
