{*
* _             _       _
* | |____      _| | __ _| |__
* | '_ \ \ /\ / / |/ _` | '_ \
* | |_) \ V  V /| | (_| | |_) |
* |_.__/ \_/\_/ |_|\__,_|_.__/.
*
* @author    Bwlab di Luigi Massa <info@bwlab.it>
* @copyright since 2014 Bwlab
* @license   proprietary
*}
{**
 * Withdrawal button + inline form (hook displayOrderDetail / displayMyAccountOrder)
 *}
{if $withdrawal_enabled && $withdrawal_eligible}
<div class="bwwithdrawal-wrapper" data-order-id="{$id_order|intval}" data-token="{$token|escape:'html':'UTF-8'}">

    {if $withdrawal_request_id}
        <p class="bwwithdrawal-submitted alert alert-info">
            {l s='Withdrawal request #%id% submitted on %date%.' sprintf=['%id%' => $withdrawal_request_id, '%date%' => $withdrawal_request_date] mod='bwwithdrawal'}
        </p>
    {else}
        <button type="button"
                class="btn btn-default bwwithdrawal-toggle"
                aria-expanded="false"
                aria-controls="bwwithdrawal-form-{$id_order|intval}">
            {l s='Recedere dal contratto qui' mod='bwwithdrawal'}
        </button>

        <div id="bwwithdrawal-form-{$id_order|intval}" class="bwwithdrawal-form" hidden>
            {include file='module:bwwithdrawal/views/templates/hook/withdrawal-form.tpl'}
        </div>
    {/if}

</div>
{/if}
