<template>
  <CMyPage
    title="Configura Sito"
    imgbackground="images/calendario_eventi.jpg"
    sizes="max-height: 120px"
  >
    <div class="q-ma-sm q-gutter-sm q-pa-xs">
      <div v-if="mysite">
        <q-banner
          rounded
          class="bg-primary text-white"
          color="primary q-title"
          style="text-align: center"
        >
          <p class="mybanner">{{ mysite.name }}</p>
        </q-banner>

        <CMyFieldDb
          title="Attivo"
          table="sites"
          mykey="active"
          :id="mysite._id"
          :rec="mysite"
        >
        </CMyFieldDb>

        <CMyFieldDb
          title="Email Admin"
          table="sites"
          :id="mysite._id"
          :rec="mysite"
          mykey="adminemail"
          debounce="1000"
          :type="costanti.FieldType.string"
        >
        </CMyFieldDb>

        <CMyFieldDb
          title="Titolo"
          table="sites"
          :id="mysite._id"
          :rec="mysite"
          mykey="name"
          debounce="1000"
        >
        </CMyFieldDb>

        <CMyFieldDb
          title="Descrizione"
          debounce="1000"
          table="sites"
          :id="mysite._id"
          :rec="mysite"
          :type="costanti.FieldType.string"
          mykey="description"
        >
        </CMyFieldDb>

        <CMyFieldDb
          title="Parole Chiave"
          table="sites"
          :id="mysite._id"
          :rec="mysite"
          mykey="keywords"
          :type="costanti.FieldType.string"
          debounce="1000"
        >
        </CMyFieldDb>

        <q-tabs v-model="tab" inline-label class="bg-yellow shadow-2">
          <q-tab name="server" label="Server" icon="mail" />
          <q-tab name="contacts" label="Contatti" icon="mail" />
        </q-tabs>

        <q-tab-panels v-model="tab" animated>
          <q-tab-panel name="contacts">
            <CMyFieldDb
              table="sites"
              title="Facebook"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="facebook"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="Instagram"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="instagram"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="Whatsapp"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="whatsapp"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="Whatsapp_home"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="whatsapp_home"
              debounce="1000"
              :type="costanti.FieldType.boolean"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="Telegram"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="telegram"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="YouTube"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="youtube"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="Email"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="email"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="Address"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="address"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
            <CMyFieldDb
              table="sites"
              title="Map"
              :id="mysite._id"
              :rec="mysite"
              mykey="contacts"
              mysubkey="map"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>
          </q-tab-panel>
          <q-tab-panel name="server">
            <CMyFieldDb
              title="Host"
              table="sites"
              :id="mysite._id"
              :rec="mysite"
              mykey="host"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>

            <CMyFieldDb
              title="Host Test"
              table="sites"
              :id="mysite._id"
              :rec="mysite"
              mykey="host_test"
              debounce="1000"
              :type="costanti.FieldType.string"
            >
            </CMyFieldDb>

            <CMyFieldRec
              title="Opzioni Sito"
              table="sites"
              :id="mysite._id"
              :rec="mysite"
              field="confsite.options"
              :canEdit="true"
              :canModify="true"
            >
            </CMyFieldRec>
          </q-tab-panel>
        </q-tab-panels>

        <CMyFieldDb
          title="BOT Telegram"
          mykey="TELEG_BOT_LINK"
          :serv="false"
          :type="costanti.FieldType.string"
        >
        </CMyFieldDb>

        <CMyFieldDb
          title="Nome del BOT Telegram"
          mykey="TELEG_BOT_NAME"
          :serv="false"
          :type="costanti.FieldType.string"
          debounce="1000"
        >
        </CMyFieldDb>
        <CMyFieldDb
          title="BOT Telegram (per Test)"
          mykey="TELEG_BOT_LINK_TEST"
          :serv="false"
          debounce="1000"
          :type="costanti.FieldType.string"
        >
        </CMyFieldDb>
        <CMyFieldDb
          title="Chat di Supporto (Help)"
          mykey="TELEGRAM_SUPPORT"
          :serv="false"
          :type="costanti.FieldType.string"
          debounce="1000"
        >
        </CMyFieldDb>
        <CMyFieldDb
          title="Sito ONLINE"
          mykey="SITO_ONLINE"
          :serv="false"
          :type="costanti.FieldType.boolean"
          debounce="1000"
        >
        </CMyFieldDb>
      </div>
    </div>
  </CMyPage>
</template>
<script lang="ts" src="./confsite.ts">
</script>
<style lang="scss" scoped>
@import 'confsite.scss';
</style>
