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

// @codingStandardsIgnoreFile

?>
<?php /** @var  $block \Magento\Sales\Block\Order\View*/?>
<div class="order-details-items ordered">
    <?php $_order = $block->getOrder() ?>

    <div class="order-title">
        <strong><?php /* @escapeNotVerified */ echo __('Items Ordered') ?></strong>
        <?php if ($_order->getTracksCollection()->count()) : ?>
            <?php echo $block->getChildHtml('tracking-info-link') ?>
        <?php endif; ?>
    </div>

    <?php echo $block->getChildHtml('order_items') ?>

    <?php if ($this->helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order', $_order) && $_order->getGiftMessageId()): ?>
    <div class="block block-order-details-gift-message">
        <div class="block-title"><strong><?php /* @escapeNotVerified */ echo __('Gift Message for This Order') ?></strong></div>
        <?php $_giftMessage = $this->helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($_order); ?>
        <div class="block-content">
            <dl class="item-options">
                <dt class="item-sender"><strong class="label"><?php /* @escapeNotVerified */ echo __('From') ?></strong><?php echo $block->escapeHtml($_giftMessage->getSender()) ?></dt>
                <dt class="item-recipient"><strong class="label"><?php /* @escapeNotVerified */ echo __('To') ?></strong><?php echo $block->escapeHtml($_giftMessage->getRecipient()) ?></dt>
                <dd class="item-message"><?php /* @escapeNotVerified */ echo $this->helper('Magento\GiftMessage\Helper\Message')->getEscapedGiftMessage($_order) ?></dd>
            </dl>
        </div>
    </div>
    <?php endif; ?>

    <div class="actions-toolbar">
        <div class="secondary">
            <a class="action back" href="<?php /* @escapeNotVerified */ echo $block->getBackUrl() ?>">
                <span><?php /* @escapeNotVerified */ echo $block->getBackTitle() ?></span>
            </a>
        </div>
    </div>
</div>
