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

if (!defined('ABSPATH'))
{
    exit;
}
?>
<template v-if="tempModal.modal.type == 'savetemp'">
    <div class="modal-body">
        <div class="row">
            <div class="col-6 col-md-7 col-lg-8 col-xl-9">
                <div class="d-flex flex-column gap-2 w-100">
                    <div class="w-100">
                        <label class="form-label">{{ langs.temp.temp_name }} <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" v-model="tempModal.data.title[tempModal.langCode]" :placeholder="langs.temp.temp_name_desc">
                    </div>
                    <div class="w-100" v-show="Object.keys(listLang.list).length > 1">
                        <label class="form-label">{{ langs.temp.languages }} <span class="text-danger">*</span></label>
                        <select class="form-select mw-100" v-model="tempModal.langCode">
                            <option v-for="(lang, lid) in listLang.list" :key="lid" :value="lid">{{ lang }}</option>
                        </select>
                    </div>
                    <div class="w-100">
                        <label class="form-label">{{ langs.temp.price }} <span class="text-danger">*</span></label>
                        <input type="number" min="0" step="0.1" class="form-control" value="0" :placeholder="langs.temp.price_desc" disabled>
                        <span class="help-block"><small>{{ langs.temp.price_help_desc }}</small></span>
                    </div>
                </div>
            </div>
            <div class="col-6 col-md-5 col-lg-4 col-xl-3">
                <img class="img-thumbnail mw-100" v-if="tempModal.data.thumb != ''" :src="tempModal.data.thumb">
            </div>
        </div>
    </div>

    <div class="modal-footer">
        <button type="button" class="btn btn-light" @click="tempModal.modal.show = false">{{ langs.cancel }}</button>
        <button type="button" class="btn btn-primary" :disabled="tempModal.modal.saving || tempModal.data.title[tempModal.langCode] == ''" @click="saveTempModal('')">
            <span class="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true" v-if="tempModal.modal.saving"></span>
            {{ tempModal.data.id == '' ? langs.save : langs.update }}
        </button>
    </div>
</template>