<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/* @var $block \Magento\Wishlist\Block\Customer\Wishlist */
?>

<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?>
    <?php echo($block->getChildHtml('wishlist.rss.link'));?>
    <form class="form-wishlist-items row" id="wishlist-view-form"
          data-mage-init='{"wishlist":{
          "addToCartUrl":<?php /* @escapeNotVerified */ echo $block->getItemAddToCartParams("%item%");?>,
          "addAllToCartUrl":<?php /* @escapeNotVerified */ echo $block->getAddAllToCartParams(); ?>,
          "commentString":""},
          "validation": {}}' action="<?php /* @escapeNotVerified */ echo $block->getUrl('wishlist/index/update', ['wishlist_id' => $block->getWishlistInstance()->getId()]) ?>" method="post">
        <?php echo $block->getChildHtml('top'); ?>
        <?php if ($block->hasWishlistItems()): ?>
            <?php echo $block->getBlockHtml('formkey');?>
            <?php $block->getChildBlock('items')->setItems($block->getWishlistItems()); ?>
            <?php echo $block->getChildHtml('items');?>
        <?php else: ?>
            <div class="message info empty"><span><?php /* @escapeNotVerified */ echo __('You have no items in your wish list.') ?></span></div>
        <?php endif ?>
        <?php echo $block->getChildHtml('bottom'); ?>
        <div class="actions-toolbar col-12">
            <div class="primary form-group">
                <?php echo $block->getChildHtml('control_buttons');?>
            </div>
            <div class="secondary form-group">
                <a href="<?php echo $block->escapeUrl($block->getBackUrl()) ?>" class="action back">
                    <span><?php /* @escapeNotVerified */ echo __('Back') ?></span>
                </a>
            </div>
        </div>
    </form>
    <script id="form-tmpl" type="text/x-magento-template">
      <form id="wishlist-hidden-form" method="post" action="<%- data.url %>" class="no-display">
          <% if (data.qty) { %>
          <input name="qty" value="<%- data.qty %>">
          <% } %>
          
          <% if (data.item) { %>
          <input name="item" value="<%- data.item %>">
          <% } %>
          
          <% if (data.entity) { %>
          <input name="entity" value="<%- data.entity %>">
          <% } %>
      </form>
  </script>
<?php endif ?>