<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    
    <t t-name="owl_demo.BinaryField3d" owl="1">
        <t t-if="!props.readonly">
            <t t-if="props.value">
                <div class="w-100 d-inline-flex">
                    <FileUploader
                        acceptedFileExtensions="props.acceptedFileExtensions"
                        file="{ data: props.value, name: fileName }"
                        onUploaded.bind="update"
                    >
                        <t if="props.record.resId">
                            <button
                                class="btn btn-secondary fa fa-download"
                                data-tooltip="Download"
                                aria-label="Download"
                                t-on-click="onFileDownload"
                            />
                        </t>
                        <t t-set-slot="toggler">
                            <input type="text" class="o_input" t-att-value="fileName" readonly="readonly" />
                            <button
                                class="btn btn-secondary fa fa-pencil o_select_file_button"
                                data-tooltip="Edit"
                                aria-label="Edit"
                            />
                        </t>
                        <button
                            class="btn btn-secondary fa fa-trash o_clear_file_button"
                            data-tooltip="Clear"
                            aria-label="Clear"
                            t-on-click="() => this.update({})"
                        />
                    </FileUploader>
                </div>
            </t>
            <t t-else="">
                <label class="o_select_file_button btn btn-primary">
                    <FileUploader
                        acceptedFileExtensions="props.acceptedFileExtensions"
                        onUploaded.bind="update"
                    >
                        <t t-set-slot="toggler">
                            Upload your file
                        </t>
                    </FileUploader>
                </label>
            </t>
        </t>
        <t t-elif="props.record.resId and props.value">
<!--            <div t-ref="showStepViewer"/>-->
            <model-viewer urc="/owl_demo/static/src/js/3d_viewer/test.glb" ar-modes="scene-viewer webxr quick-look" poster="poster.webp" shadow-intensity="1" camera-orbit="180deg 72.29deg 12640m" field-of-view="30deg">
                <div class="progress-bar hide" slot="progress-bar">
                    <div class="update-bar"></div>
                </div>
            </model-viewer>
        </t>
    </t>

    <t t-name="owl_demo.StepViewer">
        <model-viewer
            t-att-src='url'
            name="3D model"
            alt="3D model"
            auto-rotate="1"
            camera-controls="1"
        >
                <div class="text-center mt-4 mb-4 mr-4">
                    <span
                    id="model-viewer-fullscreen"
                    title="View fullscreen"
                    role="img"
                    aria-label="Fullscreen"
                >
                        <i class="fa fa-arrows-alt fa-2x" />
                    </span>
                </div>
<!--            <span style="position: absolute;top: 85%;left: 0%;font-size: 9px;" t-if="widget.model == 'jikimo.process.order.line'">-->
<!--                L：<t t-esc="widget.recordData.model_length"/>，-->
<!--                W:<t t-esc="widget.recordData.model_width"/>，-->
<!--                H:<t t-esc="widget.recordData.model_height"/>，-->
<!--                V:<t t-esc="widget.recordData.model_volume"/>-->
<!--            </span>-->
        </model-viewer>
    </t>

</templates>
