<?php
/**
 * @var $block \PortalPeople\OrderWebhook\Block\Adminhtml\Order\NgaugeFields
 */
?>
<div class="admin__page-section-item order-ngauge-fields">
    <div class="admin__page-section-item-title">
        <span class="title"><?= __('NGauge') ?></span>
    </div>
    <div class="admin__page-section-item-content">
        <div class="shipping-field-row">
            <strong><?= __('Order No:') ?></strong>
            <span>
                <?php if ($block->getNgaugeOrderNo()): ?>
                    <?php if ($block->getNgaugeOrderLink()): ?>
                        <a href="<?= $block->escapeHtml($block->getNgaugeOrderLink()) ?>" target="_blank">
                            <?= $block->escapeHtml($block->getNgaugeOrderNo()) ?>
                        </a>
                    <?php else: ?>
                        <?= $block->escapeHtml($block->getNgaugeOrderNo()) ?>
                    <?php endif; ?>
                <?php else: ?>
                    <em><?= __('Not yet synced') ?></em>
                <?php endif; ?>
            </span>
        </div>

        <div class="shipping-field-row">
            <strong><?= __('Order ID:') ?></strong>
            <span>
                <?php if ($block->getNgaugeOrderId()): ?>
                    <?= $block->escapeHtml($block->getNgaugeOrderId()) ?>
                <?php else: ?>
                    <em><?= __('Not yet synced') ?></em>
                <?php endif; ?>
            </span>
        </div>

        <div class="shipping-field-row">
            <strong><?= __('Link:') ?></strong>
            <span>
                <?php if ($block->getNgaugeOrderLink()): ?>
                    <a href="<?= $block->escapeHtml($block->getNgaugeOrderLink()) ?>" target="_blank">
                        <?= $block->escapeHtml($block->getNgaugeOrderLink()) ?>
                    </a>
                <?php else: ?>
                    <em><?= __('Not yet synced') ?></em>
                <?php endif; ?>
            </span>
        </div>
        <div class="shipping-field-row" style="margin-top:12px">
            <a href="<?= $block->escapeUrl($block->getResendUrl()) ?>"
               class="action-default scalable"
               onclick="return confirm('<?= $block->escapeJs(__('Send this order to NGauge now?')) ?>')">
                <span><?= __('Send to NGauge') ?></span>
            </a>
        </div>
    </div>
</div>

