<table class="table table--line wishlists-table">
    <thead class="table-thead">
        <tr>
            <th>{{lang 'account.wishlists.name'}}</th>
            <th>{{lang 'account.wishlists.num_items'}}</th>
            <th>{{lang 'account.wishlists.shared'}}</th>
            <th>{{lang 'account.wishlists.action'}}</th>
        </tr>
    </thead>
    <tbody class="table-tbody">
    {{#each customer.wishlists}}
        <tr>
            <td><a href="{{view_url}}">{{name}}</a></td>
            <td>{{num_items}}</td>
            <td>
                {{#if is_public }}
                    {{lang 'common.yes'}}
                {{else}}
                    {{lang 'common.no'}}
                {{/if}}
            </td>
            <td class="table-actions">
                <form method="post" action="{{delete_url}}" class="form">
                    <fieldset class="form-fieldset">
                        {{#if is_public}}
                            <a href="{{share_url}}" class="button button--primary button--small"
                           role="button">{{lang 'common.share'}}</a>
                        {{/if}}
                        <a href="{{edit_url}}" class="button button--small" data-wishlist>{{lang 'common.edit'}}</a>
                        <input type="submit" value="{{lang 'common.delete'}}" class="button button--small" data-wishlist-delete>
                    </fieldset>
                </form>
            </td>
        </tr>
    {{/each}}
    </tbody>
</table>
<form method="post" action="{{this.urls.account.wishlists.delete}}" class="form">
    {{#unless customer.wishlists}}
        <p class="form-actions">{{> components/common/alert/alert-info (lang 'account.wishlists.you_have_none')}}</p>

    {{/unless}}
    <div class="form-actions">
        <a href="{{this.urls.account.wishlists.add}}" class="button button--primary" role="button" data-wishlist>{{lang 'account.wishlists.new'}}</a>
        {{inject 'wishlistDelete' (lang 'account.wishlists.delete_alert')}}
        {{#if customer.wishlists}}
            {{#each customer.wishlists}}
                <input type="hidden" value="{{this.id}}" name="deletewishlist[]">
            {{/each}}
            <input type="submit" value="{{lang 'account.wishlists.delete_all'}}" class="button" data-wishlist-delete>
        {{/if}}
    </div>
</form>
