<?php
/*
* Plugin-Name: Product Designer App
* Plugin-URI: https://productdesignerapp.com
* Author: productdesignerapp
* Page: Printings
*/

if (!defined('ABSPATH'))
{
    exit;
}
?>
<template v-if="modal.type == 'attr'">
    <div class="modal-body">
        <div class="row" v-for="(attrs, aid) in modal.data.attrs" :key="aid">
            <div class="col-12">
                <h4 class="header-title">{{ attrs.title }}</h4>
            </div>
            <div class="col-12 col-lg-6 col-xl-4" v-for="(attr, key) in attrs.value" :key="key">
                <template v-if="attr.type == 'fixed' || attr.type == 'per_size'">
                    <div class="card border pdapp-print-box" :class="modal.data.addeds.includes(attr.type) ? 'border-primary bg-light' : ''" @click="addAttrModal(attr.type)">
                        <div class="card-body p-1 d-flex gap-1">
                            <i class="material-icons material-symbols-outlined text-primary" v-if="modal.data.addeds.includes(attr.type)">radio_button_checked</i>
                            <i class="material-icons material-symbols-outlined" v-else>radio_button_unchecked</i>
                            <div class="d-block">
                                <h5 class="card-title mb-1">{{ attr.title }}</h5>
                                <p class="card-text">{{ attr.desc }}</p>
                            </div>
                        </div>
                    </div>
                </template>
                <template v-else>
                    <div class="card border pdapp-print-box">
                        <div class="card-body p-1 d-flex gap-1">
                            <i class="material-icons material-symbols-outlined">radio_button_unchecked</i>
                            <div class="d-block">
                                <h5 class="card-title mb-1">{{ attr.title }}</h5>
                                <p class="card-text">{{ attr.desc }}</p>
                            </div>
                            <div class="position-absolute" id="pdapp-mask-upgrade">
                                <h5 class="d-flex justify-content-center align-items-center position-absolute fw-bold w-100 h-100 m-0">
                                    <a href="<?php echo esc_url(PDAPP_HOME_URL. '/shop/woocommerce');?>" target="_blank" class="text-danger bg-white p-1 px-2 rounded">{{ langs.upgrade_basic }}</a>
                                </h5>
                            </div>
                        </div>
                    </div>
                </template>
            </div>
        </div>
    </div>

    <div class="modal-footer">
        <button type="button" class="btn btn-light" @click="modal.show = false">{{ langs.cancel }}</button>
        <button type="button" class="btn btn-primary" :disabled="modal.data.addeds.length == 0" @click="savePrintValues()">{{ langs.add }}</button>
    </div>
</template>