<template>
    <div class="container_fluid">
        <PageTitle TitleFa=" مدیریت وبسایت " TitleEn=" Website Management " ThemeColor="Green" TitleFaClass="WM-Color-Black"></PageTitle>
        <!-- Nav tabs -->
        <ul class="nav nav-tabs WM-Margin-T-20" id="WMTabs">
            <template v-for="(Tab, index) in Tabs">
                <component :is="Tab.Type" :TitleFa="Tab.NameFa" :TitleEn="Tab.NameEn" :Status="Tab.Status" :SubItems="Tab.SubItems" :TabContent="index" Color="Green"></component>
            </template>
        </ul>

        <!-- Tab panes -->
        <div class="tab-content">
            <div class="tab-pane container-fluid active" id="MembersClub">
                <PartTitle class="WM-Margin-T-20" TitleFa=" باشگاه مشتریان " TitleEn=" Members Club " ThemeColor="Green"></PartTitle>
                <table class="table table-striped WM-Margin-T-20 WM-Align-R RTL">
                    <thead>
                        <tr>
                            <th style="width:5%">#</th>
                            <th style="width:20%"> نام و نام خانوادگی </th>
                            <th style="width:20%"> شماره تماس / ایمیل </th>
                            <th style="width:55%" class="WM-Align-C"> ابزارها </th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="(User, index) in Users">
                            <td> {{ index }} </td>
                            <td> {{ User.Name }} </td>
                            <td class="WM-Align-L">
                                <div v-if="User.Email"> {{ User.Email }} </div>
                                <div v-if="User.CellNumber"> {{ User.CellNumber }} </div>
                            </td>
                            <td class="WM-Align-C">
                                <ButtonShodowed @click.native="UserDetails = true" BtnClass="WM-Btn-Cyan WM-Btn-SM" Icon="info"></ButtonShodowed>
                                <ButtonShodowed @click.native="UserRoles = true" BtnClass="WM-Btn-Black WM-Btn-SM" Icon="sliders"></ButtonShodowed>
                                <ButtonShodowed BtnClass="WM-Btn-Purple WM-Btn-SM" Icon="mail"></ButtonShodowed>
                                <ButtonShodowed BtnClass="WM-Btn-Orange WM-Btn-SM" Icon="message-text-outline"></ButtonShodowed>
                                <ButtonShodowed BtnClass="WM-Btn-Red WM-Btn-SM" Icon="trash"></ButtonShodowed>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="tab-pane container fade" id="SpecialForms">...</div>
            <div class="tab-pane container fade" id="Reservation">...</div>
        </div>

        <template>
            <div class="text-xs-center">
                <v-dialog v-model="UserDetails" width="90%" transition="slide-x-transition">
                    <v-card>
                        <v-card-title class=" grey lighten-3" primary-title>
                            <PartTitle class="WM-Margin-T-20" TitleFa=" اطلاعات کاربر " TitleEn=" Member's Info " ThemeColor="Cyan"></PartTitle>
                        </v-card-title>

                        <v-card-text>
                            <div class="row">
                                <div class="col-md-3 WM-Align-R">
                                    <div class="WM-Font-14 WM-Color-Gray"><i class="WMi-user"></i> نام و نام خانوادگی </div>
                                    <div class="WM-Font-20"> علیرضا حسنی </div>
                                </div>
                                <div class="col-md-3 WM-Align-R">
                                    <div class="WM-Font-14 WM-Color-Gray"><i class="WMi-mail-alt"></i> آدرس آیمیل </div>
                                    <div class="WM-Font-20"> Alireza-Hassani@outlook.com </div>
                                </div>
                                <div class="col-md-3 WM-Align-R">
                                    <div class="WM-Font-14 WM-Color-Gray"><i class="WMi-phone"></i> شماره ی همراه </div>
                                    <div class="WM-Font-20"> 09127004945 </div>
                                </div>

                            </div>
                        </v-card-text>

                        <v-divider></v-divider>

                        <v-card-actions>
                            <v-spacer></v-spacer>
                            <v-btn color="cyan" depressed dark @click="UserDetails = false">
                                <v-icon dark right>check</v-icon> بسیار خب، ممنونم
                            </v-btn>
                        </v-card-actions>
                    </v-card>
                </v-dialog>
            </div>
        </template>

        <template>
            <div class="text-xs-center">
                <v-dialog v-model="UserRoles" width="60%" transition="slide-x-transition">
                    <v-card>
                        <v-card-title class=" grey lighten-3" primary-title>
                            <PartTitle class="WM-Margin-T-20" TitleFa=" دسترسی های این کاربر " TitleEn=" Member's Roles " ThemeColor="Black"></PartTitle>
                        </v-card-title>

                        <v-card-text>
                            <div class="row">
                                <div class="col-md-1">
                                    <i class="WMi-rss WM-Font-36"></i>
                                    <div style="margin-top:-15px;"> اخبار </div>
                                </div>
                            </div>
                        </v-card-text>

                        <v-divider></v-divider>

                        <v-card-actions>
                            <v-spacer></v-spacer>
                            <v-btn color="black" depressed dark @click="UserRoles = false">
                                <v-icon dark right>check</v-icon> ذخیره ی دسترسی ها
                            </v-btn>
                        </v-card-actions>
                    </v-card>
                </v-dialog>
            </div>
        </template>



    </div>


</template>



<script>
import PartTitle from "../components/Dividers/PartTitle.vue";
import PageTitle from "../components/Dividers/PageTitle.vue";
import QuickLink from "../components/Misc/QuickLink.vue";
import TabItem from "../components/Misc/TabItem.vue";
import TabDropdownItem from "../components/Misc/TabDropdownItem.vue";
import ButtonShodowed from "../components/Inputs/ButtonShodowed.vue";

export default {
    components: {
        PartTitle,
        PageTitle,
        QuickLink,
        TabItem,
        TabDropdownItem,
        ButtonShodowed
    },
    data: function ()  {
        return {
            UserDetails: false,
            UserRoles: false,
            Tabs: {
                MembersClub: {
                    Type: 'TabItem',
                    NameFa: ' باشگاه مشتریان ',
                    NameEn: 'Members Club',
                    Status: 'Active',
                },
                SpecialForms: {
                    Type: 'TabDropdownItem',
                    NameFa: ' فرم های خاص من ',
                    NameEn: 'My Special Forms',
                    SubItems: {
                        Item1: { NameFa: ' فرم تماس با ما ', NameEn: 'Contact Us' },
                        Item2: { NameFa: ' فرم پیش ثبت نام من ', NameEn: 'My Pre SignUp Form' }
                    }
                },
                Reservation: {
                    Type: 'TabItem',
                    NameFa: ' رزرو وقت ',
                    NameEn: 'Reservation',
                },
            },


            Users: {
                1: { Name: ' علیرضا حسنی ', Email: 'Alireza-Hassani@outlook.com', CellNumber: '09127004945' },
                4: { Name: ' فرید ساروی ', CellNumber: '09127476990' },
                27:{ Name: ' سعید خاکبازان ', CellNumber: '09336541236' },
            },

            UserDetails: { Name: ' علیرضا حسنی ', Email: 'Alireza-Hassani@outlook.com', CellNumber: '09127004945' }

        }
    },
};


</script>
