<?php
/**
 * Copyright © 2016 maijindou.com All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php if ($block->canDisplayGiftmessage()): ?>
<?php $_required = $block->getMessage()->getMessage() != ''?>
<div id="<?php echo $block->getHtmlId() ?>" class="admin__page-section-content giftmessage-whole-order-container">
    <form class="entry-edit form-inline" id="<?php /* @escapeNotVerified */ echo $block->getFieldId('form') ?>" action="<?php /* @escapeNotVerified */ echo $block->getSaveUrl() ?>">
        <fieldset class="admin__fieldset">
            <legend class="admin__legend"><span><?php /* @escapeNotVerified */ echo __('Gift Message for the Entire Order'); ?></span></legend>
            <br/>

            <input type="hidden" id="<?php /* @escapeNotVerified */ echo $block->getFieldId('type'); ?>"
                   name="<?php /* @escapeNotVerified */ echo $block->getFieldName('type'); ?>"
                   value="order"/>

            <div class="admin__field field-from-name<?php echo $_required ? ' required' : ''; ?>">
                <label class="admin__field-label"
                       for="<?php /* @escapeNotVerified */ echo $block->getFieldId('sender'); ?>"><span><?php /* @escapeNotVerified */ echo __('From Name'); ?></span></label>

                <div class="admin__field-control">
                    <input class="admin__control-text <?php echo $_required ? 'required-entry' : ''; ?>" type="text"
                           id="<?php /* @escapeNotVerified */ echo $block->getFieldId('sender'); ?>"
                           name="<?php /* @escapeNotVerified */ echo $block->getFieldName('sender'); ?>"
                           value="<?php echo $block->escapeHtml($block->getMessage()->getSender()); ?>"/>
                </div>
            </div>

            <div class="admin__field field-to-name<?php echo $_required ? ' required' : ''; ?>">
                <label class="admin__field-label"
                       for="<?php /* @escapeNotVerified */ echo $block->getFieldId('recipient'); ?>"><span><?php /* @escapeNotVerified */ echo __('To Name'); ?></span></label>

                <div class="admin__field-control">
                    <input class="admin__control-text <?php echo $_required ? 'required-entry' : ''; ?>" type="text"
                           id="<?php /* @escapeNotVerified */ echo $block->getFieldId('recipient'); ?>"
                           name="<?php /* @escapeNotVerified */ echo $block->getFieldName('recipient'); ?>"
                           value="<?php echo $block->escapeHtml($block->getMessage()->getRecipient()); ?>"/>
                </div>
            </div>

            <div class="admin__field field-gift-message">
                <label class="admin__field-label"
                       for="<?php /* @escapeNotVerified */ echo $block->getFieldId('message'); ?>"><span><?php /* @escapeNotVerified */ echo __('Gift Message'); ?></span></label>
                <div class="admin__field-control">
                    <textarea id="<?php /* @escapeNotVerified */ echo $block->getFieldId('message'); ?>"
                              name="<?php /* @escapeNotVerified */ echo $block->getFieldName('message') ?>"
                              class="admin__control-textarea"
                              rows="2"
                              cols="15"><?php echo $block->escapeHtml($block->getMessage()->getMessage()); ?></textarea>
                </div>
            </div>

            <div class="actions">
                <?php echo $block->getSaveButtonHtml(); ?>
            </div>
        </fieldset>
    </form>
</div>
<?php endif ?>
