<?php
/**@var \Magetop\Advancepreview\Block\Adminhtml\Product\Edit\Form $block */
//echo get_class($block);
$productId = $block->getRequest()->getParam('id',0);
$urls = $block->getAjaxUrl();
$uploadUrl = $urls['upload_url'];
$itemsUrl = $urls['item_url'];
$editUrl = $urls['edit_url'];
?>
<?php if($productId > 0) : ?>
    <input type="hidden" id="txt-preview-upload-url" value="<?php echo $uploadUrl; ?>">
    <input type="hidden" id="txt-preview-items-url" value="<?php echo $itemsUrl; ?>">
    <input type="hidden" id="txt-preview-edit-url" value="<?php echo $editUrl; ?>">
    <input type="hidden" id="txt-product-id" value="<?php echo $productId; ?>">
    <div id="product-review-message"></div>
<button type="button" id="btn-add-product-preview"><?php echo __('Add new 3D model') ?></button>
<div style="text-align: center; margin-top: 10px; font-size: 1.8em;"><?php echo __('3D lists') ?></div>
<div id="preview-product-lists-content">

</div>
<div id="preview-product-form-content" style="display: none">

</div>

<script>
    require([
        'jquery',
        'preview_form'
    ],function ($, previewForm) {
        previewForm.init();
    })
</script>
<?php else: ?>
<p><?php echo __('Please create product before configuring 3d model') ?></p>
<?php endif; ?>
