<form data-request="{{ __SELF__ }}::onUpdateAddress"
      data-request-validate
      data-request-success="$.publish('mall.address.update')">
    <div class="mall-form-control">
        <label for="mall_address_id">{{ 'offline.mall::frontend.address_selector.select' | trans }}</label>
        <select class="form-select" id="mall_address_id" name="id">
            {% for address in addresses %}
                <option value="{{ address.id }}" {{ address.id == activeAddress ? 'selected' : '' }}>
                    {{ address.oneLiner }}
                </option>
            {% endfor %}
            <option value="new">
                {{ 'offline.mall::frontend.address_selector.create' | trans }}
            </option>
        </select>
        <div data-validate-for="id"></div>
    </div>

    <div class="mall-form-actions">
        <button class="mall-btn mall-btn--primary mall-btn--sm js-change-address-apply btn btn-success btn-sm" type="submit">
            {{ 'offline.mall::frontend.apply' | trans }}
        </button>
        <a href="{{ __SELF__.addressPage | page({address: address.hashId, redirect: __SELF__.redirect}) }}"
           class="mall-btn mall-btn--link mall-btn--sm btn btn-primary btn-sm">
            {{ 'offline.mall::frontend.address_selector.edit' | trans }}
        </a>
    </div>

</form>