HTML Editor go on

This commit is contained in:
Surya Paolo
2022-11-13 22:39:25 +01:00
parent 5076d72523
commit 711f1b515d
35 changed files with 3684 additions and 1663 deletions

View File

@@ -0,0 +1,482 @@
.testo-banda {
//background: -webkit-gradient(linear, left top, left bottom, from(#3144f0), to(transparent));
//background: linear-gradient(180deg, #3144f0, transparent);
//background: rgba(0, 0, 0, .6)
}
$grayshadow: #555;
$textcol: blue;
$textcol_scuro: darkblue;
p {
margin: 0 0 1.25rem;
//text-shadow: .125rem .125rem .25rem $grayshadow;
}
h4 {
font-size: 1.25rem;
}
.mycard {
visibility: hidden;
}
.landing {
}
.landing_background {
background: #000 url(../../../public/images/foto1.jpg) no-repeat 50% fixed;
background-size: cover
}
.landing > section {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
//padding: 0 16px
}
.intro {
display: flex;
justify-content: space-between;
align-items: stretch;
/* flex-flow: row nowrap; */
padding: 1.25rem 0 1.25rem 0;
margin: .125rem;
* {
width: 100%;
flex: 1;
margin-left: auto;
margin-right: auto;
}
&__associazione {
min-width: 350px;
}
&__comeassociarsi {
min-width: 350px;
}
}
.subtitle {
font-weight: 600;
text-align: center;
letter-spacing: 0.125rem;
text-transform: uppercase;
font-size: 1rem;
}
.landing > section.padding {
padding: 5.62rem 1rem;
}
.landing > section.padding_testo {
padding-top: 1.25rem;
padding-bottom: 1rem;
}
.landing > section.padding_gallery {
padding-top: 3.125rem;
padding-bottom: 5.625rem;
}
.landing > section > div {
position: relative;
width: 100%
}
.maxwidth1200 {
max-width: 1200px;
}
.landing__toolbar {
background: -webkit-gradient(linear, left top, left bottom, from(#000), to(transparent));
background: linear-gradient(180deg, #000, transparent);
padding: 0 !important
}
.landing__toolbar .q-btn {
border-radius: 0 0 .315rem .315rem;
-ms-flex-item-align: stretch;
align-self: stretch
}
.landing__hero {
min-height: 50vh
}
.landing__header {
height: 18vh
}
.landing__arrow {
bottom: 1.5rem;
opacity: .4
}
.landing__front {
background: -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(15%, rgba(0, 0, 0, .6)));
background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .6) 15%)
}
.landing__logo {
width: 9.40rem;
height: 9.40rem;
margin-top: 1.315rem;
//-webkit-animation: logo-rotate 240s linear infinite;
//animation: logo-rotate 240s linear infinite
}
.landing__features .q-icon {
font-size: 4rem
}
h4 {
line-height: 1.5;
text-shadow: .25rem .25rem .5rem $grayshadow;
}
.landing__features h4, .landing__features h6 {
margin: 1rem 0
}
.landing__features p {
opacity: .7;
font-size: 1rem;
line-height: 1.5;
}
.landing__footer {
//background: -webkit-gradient(linear, left top, left bottom, color-stop(65%, rgba(0, 0, 0, .1)), to(#000));
background: linear-gradient(180deg, rgba(0, 0, 0, .8) 95%, #FFF);
padding-top: 4.5rem !important;
padding-bottom: 4.5rem !important;
padding-left: 1.25rem;
padding-right: 1.25rem;
color: #9f9f9f;
}
.icon_contact:hover {
color: blue;
border-color: white;
border-width: .0625rem;
}
.landing__footer .doc-link {
color: $textcol;
}
.landing__footer .doc-link:hover {
opacity: .8
}
.landing__swirl-bg {
background-repeat: no-repeat !important;
background-position: top;
background-size: contain !important;
background-image: url(../../../public/images/landing_first_section.png) !important
}
.feat-descr {
font-size: 1.15rem;
}
.feat-descr:hover {
transition: opacity 0.5s ease-in-out;
opacity: 0.9;
}
.q-col-gutter-sm {
padding: 3.125rem 3.125rem;
//margin-left: -48px
}
body.mobile .landing {
//background: unset
}
body.mobile .landing:before {
content: "";
position: fixed;
top: 0;
height: 100vh;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
//background: #000 url(../../public/images/cover.jpg) 50%;
background-size: cover
}
/*
@-webkit-keyframes logo-rotate {
to {
-webkit-transform: rotate(-1turn);
transform: rotate(-1turn)
}
}
@keyframes logo-rotate {
to {
-webkit-transform: rotate(-1turn);
transform: rotate(-1turn)
}
}
*/
.home {
//background-color: rgb(250, 250, 250);
padding: 3.125rem;
display: flex;
//flex-wrap: nowrap;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.btn-start {
margin: 3.125rem;
}
.shadow {
//color: white;
text-shadow: 0.125rem 0.125rem 0.25rem $grayshadow;
}
.text-h1, h1 {
font-size: 3rem;
font-weight: bold;
line-height: 3rem;
letter-spacing: -.01562em;
margin-bottom: 8px !important;
}
.text-h2 {
font-size: 3.75rem;
font-weight: 300;
line-height: 3.75rem;
letter-spacing: -.00833em;
}
.text-weight-bold {
font-weight: 700;
}
.text-vers {
font-size: 0.75rem;
font-weight: 400;
line-height: 1.75rem;
letter-spacing: .00937em;
text-shadow: .25rem .25rem .5rem $grayshadow;
}
.homep-cover-img-1 {
background: #000 url(../../../public/images/foto1.jpg) no-repeat 50% fixed;
//transition: background-image 1s ease-in-out;
}
.homep-cover-img-2 {
background: #000 url(../../../public/images/foto2.jpg) no-repeat 50% fixed;
//transition: background-image 1s ease-in-out;
}
.homep-cover-img-3 {
background: #000 url(../../../public/images/foto3.jpg) no-repeat 50% fixed;
//transition: background-image 1s ease-in-out;
}
.homep-cover-img.hide-filter:before {
opacity: 0
}
.landing__footer-icons {
font-size: 1.75rem
}
.landing__footer-icons a {
margin: 0 .5rem .5rem;
text-decoration: none;
outline: 0;
color: $textcol;
transition: color .28s
}
.landing__footer-icons a:hover {
color: $textcol_scuro;
}
.doc-img {
max-width: 100%;
}
.mylist {
background: #3fdaff;
padding-left: 1.25rem;
}
.clgutter {
margin-top: 1.25rem;
padding: .62rem;
}
.carousel_img_3 {
//background-image: url(../../public/images/cibo_sano.jpg);
background-size: cover !important;
background-position: 50% center !important;
background-repeat: no-repeat !important;
}
@media (max-width: 718px) {
// PER VERSIONE MOBILE
.landing__hero {
text-align: center
}
.landing__header {
height: 7vh
}
.clgutter {
margin-top: 0;
padding: 0;
}
.landing__hero .text-h1, h1 {
font-size: 2rem;
line-height: 2.05rem;
margin-bottom: 1.25rem
}
.landing > section.padding {
padding: 2.5rem 1rem;
}
.landing > section.padding_testo {
padding-top: 1.25rem;
padding-bottom: 1rem;
}
.landing > section.padding_gallery {
padding-top: 3.125rem;
padding-bottom: 5.625rem;
max-width: 800px;
}
.landing > section.padding_gallery > div {
padding-top: 3.125rem;
padding-bottom: 5.625rem;
}
.landing__features h4, .landing__features h6 {
margin: 1.25rem 0
}
h4 {
line-height: 1.4;
text-shadow: 0.25rem 0.25rem 0.5rem $grayshadow;
}
.landing .feature-item {
text-align: center;
margin-top: 1.25rem;
}
.landing__hero-content {
padding-bottom: 11.25rem;
}
.landing__hero2-content {
padding-bottom: 7.25rem;
}
.landing__hero-btns {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center
}
.q-col-gutter-sm {
padding: .625rem .315rem;
}
.text-subtitle1 {
font-size: 1.25rem;
}
.text-vers {
font-size: 0.6rem;
}
}
.custom-caption {
text-align: center;
padding: .75rem;
color: $textcol;
background-color: rgba(0, 0, 0, .3);
}
.sfondo-grigio {
padding: 1rem;
color: $textcol;
background-color: rgba(0, 0, 0, .35);
}
.mycontacts {
color: gray;
letter-spacing: 0.078rem;
}
.mycontacts_title {
text-shadow: 0.125rem 0.125rem 0.125rem #555;
font-weight: bold;
color: #999;
letter-spacing: 0.125rem;
}
.mycontacts_text {
color: #999;
letter-spacing: 0.093rem;
}
.clEditDiv {
border: #c8c9cb solid 2px;
padding: 2px;
}
.clEditNotActive {
background-color: #e6e6e6;
}
.clEdit {
border: #f69f09 solid 2px;
padding: 2px;
}
.clEdit:hover {
border: #11f609 solid 2px;
cursor: pointer;
}
.align_center {
text-align: center;
}
.align_right {
text-align: right;
}
.align_left {
text-align: left;
}
.flex3 {
display: flex;
justify-content: space-between;
background-color: green;
}

View File

@@ -0,0 +1,259 @@
import {
defineComponent, onMounted, PropType, ref, toRef, watch,
} from 'vue'
import { ILabelValue, IMyElem, IMyPage, IOperators } from '@src/model'
import { useGlobalStore } from '@store/globalStore'
import { CImgTitle } from '../CImgTitle/index'
import { CTitle } from '@/components/CTitle/index'
import { tools } from '@store/Modules/tools'
import { shared_consts } from '@/common/shared_vuejs'
import { LandingFooter } from '@/components/LandingFooter'
import { COpenStreetMap } from '@src/components/COpenStreetMap'
import { CCardCarousel } from '@src/components/CCardCarousel'
import { CMyPage } from '@src/components/CMyPage'
import { CMyPageIntro } from '@src/components/CMyPageIntro'
import { CEventsCalendar } from '@src/components/CEventsCalendar'
import { CMyEditor } from '@src/components/CMyEditor'
import { CMyFieldRec } from '@src/components/CMyFieldRec'
import { CSelectColor } from '@src/components/CSelectColor'
import { CSelectFontSize } from '@src/components/CSelectFontSize'
import MixinMetaTags from '@/mixins/mixin-metatags'
import MixinBase from '@/mixins/mixin-base'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { emitKeypressEvents } from 'readline'
import { costanti } from '@costanti'
export default defineComponent({
name: 'CMyEditElem',
components: { CImgTitle, CTitle, LandingFooter, CEventsCalendar,
CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec,
CSelectColor, CSelectFontSize },
emits: ['saveElem'],
props: {
myelem: {
type: Object as PropType<IMyElem>,
required: true,
},
path: {
type: String,
required: false,
default: '',
},
editOn: {
type: Boolean,
required: false,
default: false,
},
addOn: {
type: Boolean,
required: false,
default: false,
},
},
setup(props, { emit }) {
const globalStore = useGlobalStore()
const { setmeta, getsrcbyimg } = MixinMetaTags()
const { setValDb, getValDb } = MixinBase()
const $q = useQuasar()
const { t } = useI18n()
const animare = ref(0)
const slide = ref(0)
const slide2 = ref(0)
const arrPages = ref([] as any[])
const disableSave = ref(true)
const enableEdit = ref(true)
const elemChanged = ref(false)
const enableAdd = ref(true)
const neworder = ref(<number|undefined>0)
const myel = toRef(props, 'myelem')
const newtype = ref(<any>'')
watch(() => myel.value.order, (value, oldval) => {
mounted()
})
function getArrDisciplines() {
return globalStore.disciplines.filter((rec: any) => rec.showinhome)
}
function getheightgallery() {
if (tools.isMobile())
return '400px'
else
return '600px'
}
function saveElem(exit?: boolean) {
// Save Elem record
const myelem = props.myelem
myelem.order = neworder.value
globalStore.saveMyElem($q, t, myelem).then((ris) => {
if (ris) {
// OK
disableSave.value = true
emit('saveElem', myelem)
if (exit)
elemChanged.value = false
}
})
}
function addNewElem(order?: number) {
const newrec: IMyElem = {
_id: undefined,
type: newtype.value,
path: props.myelem.path,
order: order ? order : 1000,
active: true,
container: ''
}
if (newrec.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS) {
newrec.container2 = '8'
newrec.height = 600
} else if (newrec.type === shared_consts.ELEMTYPE.CARD) {
newrec.class2 = 'row justify-center'
}
globalStore.addNewElem($q, t, newrec)
}
function dupElem(order?: number) {
const newrec = props.myelem
newrec._id = undefined
newrec.order = order ? order : newrec.order! + 10
globalStore.addNewElem($q, t, newrec)
}
function delElem() {
$q.dialog({
message: 'Eliminare ' + props.myelem.container + ' ?',
html: true,
ok: {
label: 'Elimina',
push: true,
},
title: '',
cancel: true,
persistent: false,
}).onOk(async () => {
// Save Elem record
await globalStore.delMyElem($q, t, props.myelem).then((ris) => {
if (ris) {
// OK
disableSave.value = true
}
})
})
}
function modifElem(value: any) {
disableSave.value = false
elemChanged.value = true
}
function mounted() {
neworder.value = props.myelem.order
arrPages.value = []
arrPages.value.push({label: '[Vuoto]', path: ''})
for (const page of globalStore.mypage) {
const rec = {
// @ts-ignore
label: page.title,
// @ts-ignore
value: page.path
}
arrPages.value.push(rec)
}
if (props.myelem)
newtype.value = props.myelem.type
}
function clickOnElem() {
if (props.editOn) {
}
}
function addNewCard() {
if (!myel.value.listcards)
myel.value.listcards = []
myel.value.listcards.push({ imagefile: '', alt: '', description: '' })
modifElem(true)
}
function getClass() {
let mycl = ''
if (props.myelem.align === shared_consts.ALIGNTYPE.CEHTER) {
mycl += ' align_center'
} else if (props.myelem.align === shared_consts.ALIGNTYPE.RIGHT) {
mycl += ' align_right'
} else if (props.myelem.align === shared_consts.ALIGNTYPE.LEFT) {
mycl += ' align_left'
}
return mycl
}
function showFit() {
if (props.myelem.type)
return [shared_consts.ELEMTYPE.TEXT].includes(props.myelem.type)
else
return false
}
onMounted(mounted)
return {
tools,
shared_consts,
getArrDisciplines,
getheightgallery,
slide,
slide2,
animare,
setmeta,
getsrcbyimg,
saveElem,
myel,
disableSave,
modifElem,
delElem,
addNewElem,
newtype,
neworder,
elemChanged,
enableAdd,
clickOnElem,
getClass,
showFit,
getValDb,
dupElem,
enableEdit,
addNewCard,
arrPages,
costanti,
}
},
})

View File

@@ -0,0 +1,647 @@
<template>
<div
v-if="myel"
:class="
(editOn ? ` clEditDiv` : ``) +
`` +
(!myel.active ? ` clEditNotActive` : ``)
"
>
<div>
<q-bar v-if="enableEdit" dense class="bg-blue-1 q-px-sm">
<q-toggle
left-label="Attiva"
v-model="myel.active"
color="positive"
icon="fas fa-eye"
>
</q-toggle>
<!--<q-toggle v-if="tools.isManager()"
v-model="enableAdd"
icon="fas fa-plus"
</q-toggle>
>-->
&nbsp;
<q-input
style="max-width: 60px"
hide-bottom-space
borderless
dense
@update:model-value="modifElem"
v-model="neworder"
v-on:keyup.enter="saveElem(false)"
type="number"
>
</q-input>
<q-space />
<q-btn
icon="fas fa-trash-alt"
color="negative"
dense
flat
size="sm"
@click="delElem"
>
</q-btn>
<q-btn
icon="far fa-copy"
color="primary"
dense
flat
size="sm"
@click="dupElem(myel.order + 10)"
>
</q-btn>
<q-select
v-if="enableAdd"
v-model="newtype"
dense
style="width: 150px"
:options="shared_consts.TypesElem"
emit-value
map-options
>
</q-select>
<q-btn
v-if="enableAdd"
size="sm"
dense
flat
icon="fas fa-plus"
color="positive"
@click="addNewElem(myel.order - 10)"
>
</q-btn>
</q-bar>
<div class="justify-center q-gutter-xs row">
<q-btn
dense
v-if="enableEdit && !disableSave"
icon="fas fa-check"
color="positive"
label="Applica"
size="sm"
:disable="disableSave"
@click="saveElem"
>
</q-btn>
<q-btn
dense
v-if="enableEdit && !disableSave"
icon="fas fa-check"
color="positive"
label="Salva"
size="sm"
:disable="disableSave"
@click="saveElem(true)"
>
</q-btn>
</div>
<div class="row">
<q-select
v-if="enableEdit"
rounded
outlined
v-model="myel.align"
:options="tools.SelectListAlign"
@update:model-value="modifElem"
dense
label="Allinea"
style="min-width: 100px"
emit-value
map-options
>
</q-select>
<q-select
v-if="enableEdit"
rounded
style="min-width: 100px"
outlined
v-model="myel.class"
:options="tools.SelectListClass"
@update:model-value="modifElem"
dense
label="Classe"
emit-value
map-options
>
</q-select>
<q-select
v-if="enableEdit && showFit"
rounded
style="min-width: 100px"
outlined
v-model="myel.fit"
:options="tools.SelectListFit"
@update:model-value="modifElem"
dense
label="Fit"
emit-value
map-options
>
</q-select>
</div>
<div class="row">
<q-input
label="Classe:"
@update:model-value="modifElem"
v-model="myel.class2"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div v-if="myel.type === shared_consts.ELEMTYPE.TEXT">
<div v-if="enableEdit">
<q-input
class="fa-border"
@update:model-value="modifElem"
v-model="myel.container"
dense
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div
v-if="myel.type === shared_consts.ELEMTYPE.CARD"
:class="myel.span ? '' : ''"
>
<q-btn
rounded
dense
color="primary"
label="Card"
icon="fas fa-plus"
@click="addNewCard"
>
</q-btn>
<div v-for="(rec, ind) in myel.listcards" :key="ind">
<div v-if="enableEdit" class="column">
<CMyFieldRec
title="Lista Immagini:"
table="myelems"
:id="myel._id"
:rec="myel"
field="listcards"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true"
>
</CMyFieldRec>
<q-input
label="Immagine:"
dense
class="fa-border"
@update:model-value="modifElem"
v-model="rec.imagefile"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<div v-if="enableEdit" class="row">
<q-input
dense
style="min-width: 100px"
label="Titolo:"
class="fa-border"
@update:model-value="modifElem"
v-model="rec.alt"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<CSelectColor
v-if="enableEdit"
style="min-width: 100px"
v-model="rec.color"
@update:model-value="modifElem"
title="Col Titolo"
>
</CSelectColor>
<CSelectFontSize
v-if="enableEdit"
style="min-width: 100px"
v-model="rec.size"
@update:model-value="modifElem"
title="Font Titolo"
>
</CSelectFontSize>
</div>
<CMyEditor
v-model:value="rec.content"
title="Contenuto:"
@keyup.enter.stop
:showButtons="false"
:canModify="true"
@update:value="modifElem"
@showandsave="saveElem"
>
</CMyEditor>
<q-input
label="Sottotitolo:"
class="fa-border"
dense
@update:model-value="modifElem"
v-model="rec.description"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div v-if="enableEdit" class="row">
<CSelectColor
v-if="enableEdit"
v-model="rec.colorsub"
@update:model-value="modifElem"
title="Col Sottotitolo"
>
</CSelectColor>
</div>
</div>
</div>
<div v-if="myel.type === shared_consts.ELEMTYPE.MARGINI">
<div v-if="enableEdit">
<q-input
label="Margine:"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.size"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.TITLE">
<div v-if="enableEdit">
<q-input
label="Titolo"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.title"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Style"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.styleadd"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Immagine:"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.imgback"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMGTITLE">
<div v-if="enableEdit">
<q-input
label="Img"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem(false)"
>
</q-input>
<q-input
label="Title"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.HTML">
<div v-if="enableEdit">
<q-input
label="Classe:"
@update:model-value="modifElem"
v-model="myel.class"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<CMyEditor
v-model:value="myel.containerHtml"
title=""
@keyup.enter.stop
:showButtons="false"
:canModify="true"
@update:value="modifElem"
@showandsave="saveElem"
>
</CMyEditor>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMAGE">
<div v-if="enableEdit">
<q-input
label="NomeFile Img:"
@update:model-value="modifElem"
v-model="myel.container"
filled
dense
v-on:keyup.enter="saveElem"
>
</q-input>
<CMyFieldRec
title="NomeFile Img:"
table="myelems"
:id="myel._id"
:rec="myel"
field="container"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true"
:type="costanti.FieldType.images"
>
</CMyFieldRec>
<div class="row">
<q-input
label="Width:"
@update:model-value="modifElem"
v-model="myel.widthimg"
filled
dense
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Height:"
@update:model-value="modifElem"
v-model="myel.heightimg"
filled
dense
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMAGEUPLOAD">
<div v-if="enableEdit">
<q-input
label="NomeFile Img:"
@update:model-value="modifElem"
v-model="myel.image"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<CMyFieldRec
title="NomeFile Img:"
table="myelems"
:id="myel._id"
:rec="myel"
field="image"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true"
:type="costanti.FieldType.images"
>
</CMyFieldRec>
<div class="row">
<q-input
label="Width:"
@update:model-value="modifElem"
v-model="myel.widthimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Height:"
@update:model-value="modifElem"
v-model="myel.heightimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.VIDEO">
<div v-if="enableEdit" class="row">
<q-input
label="NomeFile Video:"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Ratio:"
type="number"
@update:model-value="modifElem"
v-model="myel.ratio"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.FOOTER"></div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.PAGE">
<div v-if="enableEdit" class="row">
<q-select
rounded
outlined
v-model="myel.container"
:options="arrPages"
label="Pagina"
emit-value
map-options
@change="saveElem"
>
</q-select>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.PAGEINTRO">
<div v-if="enableEdit" class="row">
<q-input
label="NomeFile Img:"
@update:model-value="modifElem"
v-model="myel.container"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Width:"
type="number"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.widthimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Height:"
type="number"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.heightimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Link:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.link"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div
v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_IDISCIPLINE"
>
<CCardCarousel :myarr="getArrDisciplines()"> </CCardCarousel>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.OPENSTREETMAP">
<div v-if="enableEdit" class="row">
<q-input
label="ImgMap:"
@update:model-value="modifElem"
v-model="myel.container"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="UrlMap:"
@update:model-value="modifElem"
v-model="myel.container2"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Title:"
@update:model-value="modifElem"
v-model="myel.container3"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Coordinata Mappa 1:"
@update:model-value="modifElem"
v-model="myel.containerHtml"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Coordinata Mappa Big:"
@update:model-value="modifElem"
v-model="myel.link"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS">
<div v-if="enableEdit" class="row">
<CMyFieldRec
title="Lista Immagini:"
table="myelems"
:id="myel._id"
:rec="myel"
field="list"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true"
>
</CMyFieldRec>
<!--sss
-->
<q-input
label="Secondi tra un'immagine e l'altra:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.container2"
type="number"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-toggle
label="Sottotitoli"
v-model="myel.parambool"
color="positive"
icon="fas fa-eye"
>
</q-toggle>
<q-toggle
label="Miniature"
v-model="myel.parambool2"
color="positive"
icon="fas fa-eye"
>
</q-toggle>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_HOME"></div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CALENDAR">
<div v-if="enableEdit" class="row">
<q-input
label="Visualizza ultimi N eventi:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.number"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECK_EMAIL"></div>
</div>
</div>
</template>
<script lang="ts" src="./CMyEditElem.ts">
</script>
<style lang="scss" scoped>
@import './CMyEditElem.scss';
</style>

View File

@@ -0,0 +1 @@
export { default as CMyEditElem } from './CMyEditElem.vue'

View File

@@ -474,3 +474,9 @@ body.mobile .landing:before {
.align_left {
text-align: left;
}
.flex3 {
display: flex;
justify-content: space-between;
background-color: green;
}

View File

@@ -2,7 +2,7 @@ import {
defineComponent, onMounted, PropType, ref, toRef, watch,
} from 'vue'
import { IMyElem, IMyPage, IOperators } from '@src/model'
import { IMyCard, IMyElem, IMyPage, IOperators } from '@src/model'
import { useGlobalStore } from '@store/globalStore'
import { CImgTitle } from '../CImgTitle/index'
@@ -17,15 +17,21 @@ import { CMyPageIntro } from '@src/components/CMyPageIntro'
import { CEventsCalendar } from '@src/components/CEventsCalendar'
import { CMyEditor } from '@src/components/CMyEditor'
import { CMyFieldRec } from '@src/components/CMyFieldRec'
import { CSelectColor } from '@src/components/CSelectColor'
import { CSelectFontSize } from '@src/components/CSelectFontSize'
import MixinMetaTags from '@/mixins/mixin-metatags'
import MixinBase from '@/mixins/mixin-base'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
export default defineComponent({
name: 'CMyElem',
components: { CImgTitle, CTitle, LandingFooter, CEventsCalendar, CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec },
components: { CImgTitle, CTitle, LandingFooter, CEventsCalendar,
CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec,
CSelectColor, CSelectFontSize },
emits: ['selElemClick'],
props: {
myelem: {
type: Object as PropType<IMyElem>,
@@ -47,10 +53,12 @@ export default defineComponent({
default: false,
},
},
setup(props) {
setup(props, { emit }) {
const globalStore = useGlobalStore()
const { setmeta, getsrcbyimg } = MixinMetaTags()
const { setValDb, getValDb } = MixinBase()
const $q = useQuasar()
const { t } = useI18n()
@@ -115,6 +123,16 @@ export default defineComponent({
globalStore.addNewElem($q, t, newrec)
}
function dupElem(order?: number) {
const newrec = props.myelem
newrec._id = undefined
newrec.order = order ? order : newrec.order! + 10
globalStore.addNewElem($q, t, newrec)
}
function delElem() {
$q.dialog({
message: 'Eliminare ' + props.myelem.container + ' ?',
@@ -153,6 +171,7 @@ export default defineComponent({
function clickOnElem() {
if (props.editOn) {
enableEdit.value = true
emit('selElemClick', props.myelem)
}
}
@@ -166,9 +185,24 @@ export default defineComponent({
mycl += ' align_left'
}
if (props.myelem.class2)
mycl += ' ' + props.myelem.class2
return mycl
}
function getImgFileByElem(elem: IMyElem, reccard?: IMyCard) {
if (elem) {
if (elem.type === shared_consts.ELEMTYPE.CARD) {
return 'upload/pages/' + elem.path + '/' + reccard!.imagefile
} else if (elem.type === shared_consts.ELEMTYPE.IMAGE) {
return 'upload/pages/' + elem.path + '/' + elem.container
} else {
return 'upload/pages/' + elem.path + '/' + elem.image
}
}
}
function showFit() {
if (props.myelem.type)
return [shared_consts.ELEMTYPE.TEXT].includes(props.myelem.type)
@@ -201,6 +235,9 @@ export default defineComponent({
clickOnElem,
getClass,
showFit,
getValDb,
dupElem,
getImgFileByElem,
}
},

View File

@@ -1,125 +1,48 @@
<template>
<div v-if="myel"
:class="(editOn ? ` clEditDiv` : ``) + `` + (!myel.active ? ` clEditNotActive` : ``)"
<div
v-if="myel"
:class="
(editOn ? ` clEditDiv` : ``) +
`` +
(!myel.active ? ` clEditNotActive` : ``)
"
>
<q-bar v-if="enableEdit" dense class="bg-blue-1 text-white q-px-sm">
<q-toggle
v-model="myel.active"
color="positive"
icon="fas fa-eye"
>
</q-toggle>
<q-toggle
v-model="enableEdit"
icon="fas fa-pencil-alt"
>
</q-toggle>
<!--<q-toggle v-if="tools.isManager()"
v-model="enableAdd"
icon="fas fa-plus"
</q-toggle>
>-->
<q-input
style="max-width: 60px"
hide-bottom-space
borderless
dense
@update:model-value="modifElem"
v-model="neworder"
v-on:keyup.enter="saveElem(false)"
type="number"
>
</q-input>
<q-select
v-if="enableEdit"
rounded outlined v-model="myel.align"
:options="tools.SelectListAlign"
@update:model-value="modifElem"
dense
label="Allinea" emit-value map-options>
</q-select>
<q-select
v-if="enableEdit"
rounded outlined v-model="myel.class"
:options="tools.SelectListClass"
@update:model-value="modifElem"
dense
label="Classe" emit-value map-options>
</q-select>
<q-select
v-if="enableEdit && showFit"
rounded outlined v-model="myel.fit"
:options="tools.SelectListFit"
@update:model-value="modifElem"
dense
label="Fit" emit-value map-options>
</q-select>
<q-space/>
<q-btn
icon="fas fa-trash-alt"
color="negative"
dense
flat
size="sm"
@click="delElem">
</q-btn>
<q-select v-if="enableAdd"
v-model="newtype"
dense
style="width: 150px;"
:options="shared_consts.TypesElem"
emit-value map-options>
</q-select>
<q-btn
v-if="enableAdd"
size="sm"
dense
flat
icon="fas fa-plus"
color="positive"
@click="addNewElem(myel.order-10)">
</q-btn>
</q-bar>
<div v-if="myel.type === shared_consts.ELEMTYPE.TEXT">
<div v-if="enableEdit">
<q-input
class="fa-border"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem"
<div>
<div v-if="myel.type === shared_consts.ELEMTYPE.TEXT">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
</q-input>
{{ myel.container }}
</div>
</div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">{{ myel.container }}
v-if="myel.type === shared_consts.ELEMTYPE.CARD"
:class="myel.span ? '' : ''"
>
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<div v-for="(rec, ind) in myel.listcards" :key="ind" >
<q-card class="my-card center_img" flat bordered>
rec: {{rec}}
<q-img :src="getImgFileByElem(myel, rec)" />
<q-card-section>
<div :class="` ` + rec.size" :style="`color: ` + rec.color">
{{ rec.alt }}
</div>
<div :class="`q-mt-sm q-mb-xs `" v-html="rec.content"></div>
<div
v-if="rec.description"
class="text-caption"
:style="`color: ` + rec.colorsub"
>
{{ rec.description }}
</div>
</q-card-section>
</div>
</div>
<div v-if="myel.type === shared_consts.ELEMTYPE.CARD">
<q-card class="my-card" flat bordered>
<q-img
:src="myel.img"
/>
<q-card-section>
<div class="text-overline text-orange-9">{{ myel.container }}</div>
<div class="text-h5 q-mt-sm q-mb-xs">{{ myel.container2 }}</div>
<div class="text-caption text-grey">
{{ myel.container3 }}
</div>
</q-card-section>
<!--<q-card-actions>
<!--<q-card-actions>
<q-btn flat color="dark" label="Share"/>
<q-btn flat color="primary" label="Book"/>
@@ -135,436 +58,309 @@
/>
</q-card-actions>-->
<q-slide-transition>
<div v-show="expanded">
<q-separator/>
<q-card-section class="text-subitle2">
{{ lorem }}
</q-card-section>
<!--<q-slide-transition>
<div v-show="expanded">
<q-separator />
<q-card-section class="text-subitle2">
</q-card-section>
</div>
</q-slide-transition>
-->
</q-card>
</div>
</q-slide-transition>
</q-card>
</div>
<div v-if="myel.type === shared_consts.ELEMTYPE.MARGINI">
<div v-if="enableEdit">
<q-input
label="Margine:"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.size"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
</div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
:style="`margin: ` + myel.size">&nbsp;
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.TITLE">
<div v-if="enableEdit">
<q-input
class="fa-border"
@update:model-value="modifElem"
v-model="myel.title"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div>
<div v-if="myel.type === shared_consts.ELEMTYPE.MARGINI">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CTitle
:imgbackground="myel.imgback"
:headtitle="myel.title" :sizes="myel.size" :styleadd="myel.styleadd">
</CTitle>
@click="clickOnElem"
:style="`margin: ` + myel.size"
>
&nbsp;
</div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMGTITLE">
<div v-if="enableEdit">
<q-input
label="Img"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem(false)"
>
</q-input>
<q-input
label="Title"
class="fa-border"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div>
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CImgTitle v-if="myel.container" :src="myel.container" :title="myel.title">
</CImgTitle>
</div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.HTML">
<div v-if="enableEdit">
<q-input
label="Classe:"
@update:model-value="modifElem"
v-model="myel.class"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<CMyEditor
v-model:value="myel.containerHtml" title="" @keyup.enter.stop
:showButtons="false"
:canModify="true"
@update:value="modifElem"
@showandsave="saveElem"
>
</CMyEditor>
</div>
<div>
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
v-html="myel.containerHtml"></div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMAGE">
<div v-if="enableEdit">
<q-input
label="NomeFile Img:"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<div class="row">
<q-input
label="Width:"
@update:model-value="modifElem"
v-model="myel.widthimg"
filled
v-on:keyup.enter="saveElem"
<div v-else-if="myel.type === shared_consts.ELEMTYPE.TITLE">
<div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
</q-input>
<q-input
label="Height:"
@update:model-value="modifElem"
v-model="myel.heightimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<CTitle
:imgbackground="myel.imgback"
:headtitle="myel.title"
:sizes="myel.size"
:styleadd="myel.styleadd"
>
</CTitle>
</div>
</div>
</div>
<div class="text-center">
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<q-img :src="myel.container" :fit="myel.fit" class="img" :width="myel.widthimg ? myel.widthimg: undefined" :height="myel.heightimg ? myel.heightimg : undefined"></q-img>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMGTITLE">
<div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<CImgTitle
v-if="myel.container"
:src="myel.container"
:title="myel.title"
>
</CImgTitle>
</div>
</div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.VIDEO">
<div v-if="enableEdit" class="row">
<q-input
label="NomeFile Video:"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Ratio:"
type="number"
@update:model-value="modifElem"
v-model="myel.ratio"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<q-video v-if="!!rec.container" :src="rec.container" :ratio="rec.ratio">
</q-video>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.FOOTER">
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<LandingFooter></LandingFooter>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.PAGE">
<div v-if="enableEdit" class="row">
<q-input
label="Importa Pagina:"
@update:model-value="modifElem"
v-model="myel.container"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CMyPage :mypath="myel.container">&nbsp;</CMyPage>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.PAGEINTRO">
<div v-if="enableEdit" class="row">
<q-input
label="NomeFile Img:"
@update:model-value="modifElem"
v-model="myel.container"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Width:"
type="number"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.widthimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Height:"
type="number"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.heightimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Link:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.link"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CMyPageIntro :mypath="myel.container" :maxheightimg="myel.heightimg" :maxwidthimg="myel.widthimg" :link="myel.link"></CMyPageIntro>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_IDISCIPLINE">
<CCardCarousel :myarr="getArrDisciplines()">
</CCardCarousel>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.OPENSTREETMAP">
<!-- Da Fare -->
<COpenStreetMap :imgmap="getValDb('IMGMAP', false)" :urlmap="getValDb('URLMAP', false)" :title="getValDb('MAP_TITLE', false)"
:coordinates="getValDb('COORD_MAP_1', false)" :coord_big="getValDb('COORD_MAP_BIG', false)">
</COpenStreetMap>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS">
<section class="maxwidth padding_gallery bg-white text-grey-10 text-center">
<div v-if="enableEdit" class="row">
<CMyFieldRec
title="Lista Immagini:"
table="myelems"
:id="myel._id"
:rec="myel"
field="list"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true">
</CMyFieldRec>
<!--sss
-->
<q-input
label="Secondi tra un'immagine e l'altra:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.container2"
type="number"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-toggle
label="Sottotitoli"
v-model="myel.parambool"
color="positive"
icon="fas fa-eye"
>
</q-toggle>
<q-toggle
label="Miniature"
v-model="myel.parambool2"
color="positive"
icon="fas fa-eye"
>
</q-toggle>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.HTML">
<div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
v-html="myel.containerHtml"
></div>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<q-carousel
swipeable
animated
:autoplay="myel.container2 ? (myel.container2 * 1000) : 8000"
v-model="slide2"
arrows
:fit="myel.fit"
:thumbnails="myel.parambool2"
infinite
:height="myel.height ? myel.height.toString() : 600">
<q-carousel-slide v-for="(rec, index) in myel.list" :key="index" :name="index"
:img-src="getsrcbyimg(`upload/pages/`+ path + `/`+ rec.imagefile)"
:alt="rec.alt"
class="carousel_slide">
<div
v-if="myel.parambool" class="absolute-bottom custom-caption" style="margin-bottom: 70px">
<div class="text-h5"><span
class="text-h6 text-grey-1 shadow-max">{{ index + 1 }}. </span>
<span v-if="rec.alt"
class="text-h6 text-grey-2 shadow">{{ rec.alt }}</span></div>
<div class="text-subtitle1" v-if="rec.description"><span class="text-grey-4 shadow">{{ rec.description }}</span>
</div>
</div>
</q-carousel-slide>
</q-carousel>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMAGE">
<div class="text-center">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<q-img
:src="getImgFileByElem(myel.container)"
:fit="myel.fit"
class="img"
:width="myel.widthimg ? myel.widthimg : undefined"
:height="myel.heightimg ? myel.heightimg : undefined"
></q-img>
</div>
</div>
</section>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_HOME">
</div>
<section>
<div class="landing">
<div class="landing__hero maxwidth1200 text-white">
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMAGEUPLOAD">
<div class="text-center">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<q-img
:src="getImgFileByElem(myel)"
:fit="myel.fit"
class="img"
:width="myel.widthimg ? myel.widthimg : undefined"
:height="myel.heightimg ? myel.heightimg : undefined"
></q-img>
</div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.VIDEO">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<q-video
v-if="!!rec.container"
:src="rec.container"
:ratio="rec.ratio"
>
</q-video>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.FOOTER">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<LandingFooter></LandingFooter>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.PAGE">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<CMyPage :mypath="myel.container">&nbsp;</CMyPage>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.PAGEINTRO">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<CMyPageIntro
:mypath="myel.container"
:maxheightimg="myel.heightimg"
:maxwidthimg="myel.widthimg"
:link="myel.link"
></CMyPageIntro>
</div>
</div>
<div
v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_IDISCIPLINE"
>
<CCardCarousel :myarr="getArrDisciplines()"> </CCardCarousel>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.OPENSTREETMAP">
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<div v-if="myel.container">
<!-- Da Fare -->
<COpenStreetMap
:imgmap="myel.container"
:urlmap="myel.container2"
:title="myel.container3"
:coordinates="myel.containerHtml"
:coord_big="myel.link"
>
</COpenStreetMap>
</div>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS">
<section
class="maxwidth padding_gallery bg-white text-grey-10 text-center"
>
<div
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
>
<q-carousel
animated
:autoplay="animare"
swipeable
animated
:autoplay="myel.container2 ? myel.container2 * 1000 : 8000"
v-model="slide2"
arrows
:fit="myel.fit"
:thumbnails="myel.parambool2"
infinite
navigation
transition-next="slide-left"
transition-prev="slide-right"
v-model="slide"
:height="getheightgallery()"
width="100%"
:height="myel.height ? myel.height.toString() : 600"
>
<q-carousel-slide
v-for="(myrec, ind) in myel.list" :key="ind"
:name="ind"
:img-src="getsrcbyimg(`images/`+ myrec.imagefile)">
<div class="landing__header"></div>
<div class="landing__hero-content row justify-center q-gutter-xs clgutter">
<div class="row">
&nbsp;
v-for="(rec, index) in myel.list"
:key="index"
:name="index"
:img-src="
getsrcbyimg(`upload/pages/` + path + `/` + rec.imagefile)
"
:alt="rec.alt"
class="carousel_slide"
>
<div
v-if="myel.parambool"
class="absolute-bottom custom-caption"
style="margin-bottom: 70px"
>
<div class="text-h5">
<span class="text-h6 text-grey-1 shadow-max"
>{{ index + 1 }}.
</span>
<span v-if="rec.alt" class="text-h6 text-grey-2 shadow">{{
rec.alt
}}</span>
</div>
<div class="flex justify-end">
<div class="q-gutter-xs testo-banda clgutter">
<h1 class="text-h1 shadow-max">{{ tools.getappname() }}</h1>
<div class="text-subtitle1 shadow text-italic q-pl-sm">
{{ myel.container }}&nbsp;
</div>
<div class="text-subtitle1 shadow-max big text-italic q-pl-sm">
{{ myel.container2 }}
</div>
<div class="text-subtitle2 shadow text-italic q-pl-sm">
{{ myel.container3 }}
</div>
<div>
<br><br>
<div v-if="!tools.isLogged()" style="margin: 5px; padding: 5px;" class="home">
<br><br>
<div class="text-subtitle1" v-if="rec.description">
<span class="text-grey-4 shadow">{{
rec.description
}}</span>
</div>
</div>
</q-carousel-slide>
</q-carousel>
</div>
</section>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CAROUSEL_HOME">
<section>
<div class="landing">
<div class="landing__hero maxwidth1200 text-white">
<q-carousel
animated
:autoplay="animare"
swipeable
infinite
navigation
transition-next="slide-left"
transition-prev="slide-right"
v-model="slide"
:height="getheightgallery()"
width="100%"
>
<q-carousel-slide
v-for="(myrec, ind) in myel.list"
:key="ind"
:name="ind"
:img-src="getsrcbyimg(`images/` + myrec.imagefile)"
>
<div class="landing__header"></div>
<div
class="
landing__hero-content
row
justify-center
q-gutter-xs
clgutter
"
>
<div class="row">&nbsp;</div>
<div class="flex justify-end">
<div class="q-gutter-xs testo-banda clgutter">
<h1 class="text-h1 shadow-max">
{{ tools.getappname() }}
</h1>
<div class="text-subtitle1 shadow text-italic q-pl-sm">
{{ myel.container }}&nbsp;
</div>
<div
class="
text-subtitle1
shadow-max
big
text-italic
q-pl-sm
"
>
{{ myel.container2 }}
</div>
<div class="text-subtitle2 shadow text-italic q-pl-sm">
{{ myel.container3 }}
</div>
<div>
<br /><br />
<div
v-if="!tools.isLogged()"
style="margin: 5px; padding: 5px"
class="home"
>
<br /><br />
</div>
</div>
</div>
</div>
</div>
</div>
<!--<div class="landing__arrow absolute-bottom text-center">
<!--<div class="landing__arrow absolute-bottom text-center">
<i aria-hidden="true"
class="q-icon text-h2 text-white material-icons">expand_more</i>
</div>-->
</q-carousel-slide>
</q-carousel>
</q-carousel-slide>
</q-carousel>
</div>
</div>
</section>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CALENDAR">
<CEventsCalendar :mysingleevent="null" :showfirstN="myel.number || 3">
</CEventsCalendar>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECK_EMAIL">
<div class="q-pa-md q-gutter-md">
<div v-if="tools.isLogged() && !isVerified" class="text-verified">
{{ $t('components.authentication.email_verification.link_sent') }}
</div>
</div>
</section>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CALENDAR">
<div v-if="enableEdit" class="row">
<q-input
label="Visualizza ultimi N eventi:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.number"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<CEventsCalendar :mysingleevent="null" :showfirstN="myel.number || 3">
</CEventsCalendar>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECK_EMAIL">
<div class="q-pa-md q-gutter-md">
<div v-if="tools.isLogged() && !isVerified" class="text-verified">{{
$t('components.authentication.email_verification.link_sent')
}}
</div>
</div>
</div>
<div class="justify-center q-gutter-xs row">
<q-btn
v-if="enableEdit && !disableSave"
icon="fas fa-check"
color="positive"
label="Applica"
size="sm"
:disable="disableSave"
@click="saveElem">
</q-btn>
<q-btn
v-if="enableEdit && !disableSave"
icon="fas fa-check"
color="positive"
label="Salva"
size="sm"
:disable="disableSave"
@click="saveElem(true)">
</q-btn>
</div>
</div>
</template>

View File

@@ -62,9 +62,9 @@ export default defineComponent({
if (mypath.value !== '') rec.value = await globalStore.loadPage('/' + mypath.value)
})
// onMounted(load)
onMounted(load)
load()
// load()
return {
rec, globalStore

View File

@@ -7,6 +7,7 @@ import { IMyElem, IMyPage } from '@src/model'
import { useGlobalStore } from '@store/globalStore'
import { LandingFooter } from '@/components/LandingFooter'
import { CMyElem } from '@/components/CMyElem'
import { CMyEditElem } from '@/components/CMyEditElem'
import { CImgTitle } from '../CImgTitle/index'
import { CTitle } from '../CTitle/index'
@@ -17,7 +18,7 @@ import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'CMyPageElem',
components: { LandingFooter, CImgTitle, CTitle, CMyElem },
components: { LandingFooter, CImgTitle, CTitle, CMyElem, CMyEditElem },
props: {
title: String,
mypath: {
@@ -61,6 +62,7 @@ export default defineComponent({
const editOn = ref(false)
const addOn = ref(false)
const selElem = ref({} as IMyElem)
const myelemVoid = ref({active: true, type: shared_consts.ELEMTYPE.TEXT, container: '...', path: mypathin.value} as IMyElem)
const globalStore = useGlobalStore()
@@ -76,6 +78,11 @@ export default defineComponent({
const load = async (): Promise<void> => {
// console.log('load', mypathin.value)
if (mypathin.value !== '') rec.value = await globalStore.loadPage('/' + mypathin.value)
editOn.value = tools.getCookie('EDIT_' + mypathin.value) === '-1' ? true : false
if (mypathin.value === 'home')
editOn.value = false
console.log('getcookie: ', editOn.value, mypathin.value)
}
watch(() => props.mypath, async (to: string, from: string) => {
@@ -84,6 +91,19 @@ export default defineComponent({
})
function selElemClick(myelem: IMyElem) {
selElem.value = myelem
}
function saveElem(myelem: IMyElem) {
//
}
function changeVisuDrawer() {
console.log('changeVisuDrawer')
tools.setCookie('EDIT_' + mypathin.value, editOn.value ? '-1' : '0')
}
onMounted(load)
return {
@@ -94,6 +114,10 @@ export default defineComponent({
tools,
shared_consts,
myelemVoid,
selElemClick,
selElem,
saveElem,
changeVisuDrawer,
}
},

View File

@@ -1,26 +1,44 @@
<template>
<div>
<div v-if="mypathin && !!rec">
<q-toolbar>
<q-toggle v-if="tools.isManager()"
v-model="editOn"
icon="fas fa-pencil-alt"
>
</q-toggle>
<!-- <q-toggle v-if="tools.isManager()"
v-model="addOn"
icon="fas fa-plus"
>
</q-toggle>-->
</q-toolbar>
<q-toggle
v-if="tools.isManager()"
v-model="editOn"
color="green"
@update:model-value="changeVisuDrawer"
icon="fas fa-pencil-alt"
>
</q-toggle>
<q-drawer
v-model="editOn"
side="right"
show-if-above
:width="400"
:breakpoint="700"
elevated
>
<q-bar dense class="bg-primary text-white">
<q-toolbar-title> Editor </q-toolbar-title>
<q-btn
flat
round
color="white"
icon="close"
@click="editOn = false; changeVisuDrawer()"
></q-btn>
</q-bar>
<CMyEditElem
:myelem="selElem"
:editOn="true"
:path="rec.path"
@saveElem="saveElem"
>
</CMyEditElem>
</q-drawer>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<div v-if="!!rec.img1" class="text-center">
<q-img :src="``+ rec.img1" class="img"></q-img>
<q-img :src="`` + rec.img1" class="img"></q-img>
</div>
<div v-if="!!rec.content" v-html="rec.content"></div>
@@ -28,41 +46,62 @@
</q-video>
<div v-if="!!rec.img2" class="text-center">
<q-img :src="``+ rec.img2" class="img"></q-img>
<q-img :src="`` + rec.img2" class="img"></q-img>
</div>
<div v-if="!!rec.content2" v-html="rec.content2"></div>
<q-video v-if="!!rec.video2" :src="rec.video2" :ratio="rec.ratio2"></q-video>
<q-video
v-if="!!rec.video2"
:src="rec.video2"
:ratio="rec.ratio2"
></q-video>
<div v-if="!!rec.img3" class="text-center">
<q-img :src="``+ rec.img2" class="img"></q-img>
<q-img :src="`` + rec.img2" class="img"></q-img>
</div>
<div v-if="!!rec.content3" v-html="rec.content3"></div>
<q-video v-if="!!rec.video3" :src="rec.video3" :ratio="rec.ratio3"></q-video>
<q-video
v-if="!!rec.video3"
:src="rec.video3"
:ratio="rec.ratio3"
></q-video>
<div v-if="!!rec.content4" v-html="rec.content4"></div>
<span v-for="(myelem, ind) in myelems" :key="ind">
<CMyElem v-if="myelem.active || editOn" :myelem="myelem" :editOn="editOn" :addOn="addOn" :path="rec.path">
<div v-for="(myelem, ind) in myelems" :key="ind">
<CMyElem
v-if="myelem.active || editOn"
:myelem="myelem"
:editOn="editOn"
:addOn="addOn"
:path="rec.path"
@selElemClick="selElemClick"
>
</CMyElem>
</span>
</div>
<div v-if="myelems.length === 0">
<CMyElem v-if="editOn" :myelem="myelemVoid" :editOn="editOn" :addOn="addOn" :path="rec.path">
<CMyElem
v-if="editOn"
:myelem="myelemVoid"
:editOn="editOn"
:addOn="addOn"
:path="rec.path"
>
</CMyElem>
</div>
</div>
</div>
<div v-else>
<div v-if="!!title">
<CTitle
v-if="imgbackground" :imgbackground="imgbackground"
:headtitle="title" :sizes="sizes" :styleadd="styleadd"></CTitle>
v-if="imgbackground"
:imgbackground="imgbackground"
:headtitle="title"
:sizes="sizes"
:styleadd="styleadd"
></CTitle>
<div v-if="!imgbackground">
<CImgTitle v-if="img" :src="img" :title="title">
</CImgTitle>
<CImgTitle v-if="img" :src="img" :title="title"> </CImgTitle>
</div>
<slot></slot>
<div v-if="!nofooter">

View File

View File

@@ -0,0 +1,40 @@
import { defineComponent, ref, toRef, watch } from 'vue'
import { tools } from '@src/store/Modules/tools'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { toolsext } from '@store/Modules/toolsext'
export default defineComponent({
name: 'CSelectColor',
emits: ['update:modelValue'],
props: {
modelValue: {
type: String,
required: true,
},
title: {
type: String,
required: false,
default: '',
},
},
components: {},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n();
const color = toRef(props, 'modelValue')
function updateValue(str: string) {
emit('update:modelValue', str)
}
return {
tools,
toolsext,
updateValue,
color,
}
},
})

View File

@@ -0,0 +1,40 @@
<template>
<q-select
rounded
outlined
v-model="color"
@update:model-value="updateValue"
:options="tools.SelectListColors"
dense
:label="title"
emit-value
map-options
>
<template v-slot:selected>
<q-chip
dense
square
color="white"
class="q-my-none q-ml-xs q-mr-none"
>
<span :style="`color: `+ color">{{ color }}</span>
</q-chip>
</template>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label :style="`color: ` + scope.opt.value">{{
scope.opt.label
}}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
</template>
<script lang="ts" src="./CSelectColor.ts">
</script>
<style lang="scss" scoped>
@import './CSelectColor.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CSelectColor} from './CSelectColor.vue'

View File

@@ -0,0 +1,40 @@
import { defineComponent, ref, toRef, watch } from 'vue'
import { tools } from '@src/store/Modules/tools'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { toolsext } from '@store/Modules/toolsext'
export default defineComponent({
name: 'CSelectFontSize',
emits: ['update:modelValue'],
props: {
modelValue: {
type: String,
required: true,
},
title: {
type: String,
required: false,
default: '',
},
},
components: {},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n();
const classfont = toRef(props, 'modelValue')
function updateValue(str: string) {
emit('update:modelValue', str)
}
return {
tools,
toolsext,
updateValue,
classfont,
}
},
})

View File

@@ -0,0 +1,40 @@
<template>
<q-select
rounded
outlined
v-model="classfont"
@update:model-value="updateValue"
:options="tools.SelectListFontSize"
dense
:label="title"
emit-value
map-options
>
<template v-slot:selected>
<q-chip
dense
square
color="white"
class="q-my-none q-ml-xs q-mr-none"
>
<span :class="classfont">{{ classfont }}</span>
</q-chip>
</template>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label :class="scope.opt.value">{{
scope.opt.label
}}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
</template>
<script lang="ts" src="./CSelectFontSize.ts">
</script>
<style lang="scss" scoped>
@import './CSelectFontSize.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CSelectFontSize} from './CSelectFontSize.vue'

View File

@@ -244,7 +244,7 @@ export default defineComponent({
mylangtopass = toolsext.checkLangPassed($q, $router, mylangtopass)
userStore.setlang($router, mylangtopass)
userStore.setlang($q, $router, mylangtopass)
setshortlang(mylangtopass)

View File

@@ -20,6 +20,7 @@ export * from './CMyPageElem'
export * from './CMyPageIntro'
export * from './CMyElem'
export * from './CMyTeacher'
export * from './CSelectFontSize'
export * from './CProfile'
export * from './CProvaPao'
export * from './CSignIn'