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

if (!defined('ABSPATH'))
{
    exit;
}
?>
<template v-if="modal.type == 'move'">
    <div class="modal-body">
        <ol class="breadcrumb m-0 p-0">
            <li class="breadcrumb-item" v-for="(bread, bid) in modal.data.breadcrumbs" :key="bid" @click="openMove(bread)">
                <a v-if="modal.data.tid != bread.id" href="javascript: void(0);" @click="">{{ bread.title }}</a>
                <template v-else>{{ bread.title }}</template>
            </li>
        </ol>
        <div class="list-group mt-2 mb-2" v-if="listFolders[modal.data.tid] != undefined && listFolders[modal.data.tid].length">
            <template v-for="(folder, mid) in listFolders[modal.data.tid]">
                <a v-if="folder.id != modal.data.id" href="javascript:void(0);" class="list-group-item list-group-item-action d-flex gap-2 align-items-center justify-content-between" :key="mid" @click="openMove(folder)">
                    <div class="d-flex gap-2 align-items-center">
                        <div class="avatar-xs">
                            <span class="avatar-title text-secondary rounded">
                                <img :src="showImg(folder.thumb, 'folder')" :alt="getTitle(folder.title)" class="mw-100">
                            </span>
                        </div>
                        <span>{{ getTitle(folder.title) }}</span>
                    </div>
                    <span class="badge bg-primary rounded-pill">{{ childFolders(folder.id) }}</span>
                </a>
            </template>
        </div>
        <h4 v-else class="mt-3 text-center">{{ langs.art.selected_folder }}: "{{ modal.data.breadcrumbs[modal.data.breadcrumbs.length - 1].title }}"</h4>
    </div>
    
    <div class="modal-footer">
        <button type="button" class="btn btn-light" @click="modal.show = false">{{ langs.cancel }}</button>
        <button v-if="modal.type == 'move'" type="button" class="btn btn-primary" :disabled="folderID == modal.data.tid || modal.saving" @click="moveArt">
            <span class="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true" v-if="modal.saving"></span>
            {{ langs.art.start_move }}
        </button>
    </div>
</template>