Files
newfreeplanet_OLD/src/components/CMyPageElem/CMyPageElem.vue

169 lines
4.9 KiB
Vue
Raw Normal View History

2022-11-10 19:32:56 +01:00
<template>
<div>
2024-09-13 19:42:55 +02:00
<div v-if="mypathin && !!rec && !onloading">
<q-toggle
2022-11-13 22:39:25 +01:00
v-if="tools.isManager()"
v-model="editOn"
dense
2022-11-13 22:39:25 +01:00
color="green"
size="sm"
2022-11-17 08:10:43 +01:00
@update:model-value="changeVisuDrawer(mypathin, editOn)"
2022-11-13 22:39:25 +01:00
icon="fas fa-pencil-alt"
>
</q-toggle>
2022-11-18 18:54:30 +01:00
2022-11-13 22:39:25 +01:00
<q-drawer
2022-11-18 18:54:30 +01:00
v-model="visuEditor"
2022-11-23 10:27:36 +01:00
v-if="selElem && editOn"
show-if-above
:breakpoint="800"
2022-11-13 22:39:25 +01:00
side="right"
:width="tools.isMobile() ? 350 : mywidthEditor"
2022-11-13 22:39:25 +01:00
elevated
style="transition: 'width 0.3s ease'"
2022-11-13 22:39:25 +01:00
>
2022-11-23 10:27:36 +01:00
<q-bar dense class="q-ma-xs bg-primary text-white">
<q-toolbar-title> Editor </q-toolbar-title>
<q-btn
flat
round
size="md"
color="white"
icon="close"
@click="
visuEditor = false;
selElem = {};
"
2022-11-23 10:27:36 +01:00
></q-btn>
</q-bar>
2022-11-29 13:59:18 +01:00
<CMyEditElem
:myelem="selElem"
:editOn="true"
:path="rec.path"
@selElemClick="selElemClick"
2024-09-13 19:42:55 +02:00
@deleteElem="deleteElem"
@toggleSize="toggleSize"
2022-11-29 13:59:18 +01:00
>
2022-11-23 10:27:36 +01:00
</CMyEditElem>
2022-11-13 22:39:25 +01:00
</q-drawer>
2022-11-10 19:32:56 +01:00
<div class="q-gutter-xs" style="margin-left: 1px; margin-right: 1px">
2022-11-10 19:32:56 +01:00
<div v-if="!!rec.img1" class="text-center">
2022-11-13 22:39:25 +01:00
<q-img :src="`` + rec.img1" class="img"></q-img>
2022-11-10 19:32:56 +01:00
</div>
<div v-if="!!rec.content" v-html="rec.content"></div>
<q-video v-if="!!rec.video1" :src="rec.video1" :ratio="rec.ratio1">
</q-video>
<div v-if="!!rec.img2" class="text-center">
2022-11-13 22:39:25 +01:00
<q-img :src="`` + rec.img2" class="img"></q-img>
2022-11-10 19:32:56 +01:00
</div>
<div v-if="!!rec.content2" v-html="rec.content2"></div>
2022-11-13 22:39:25 +01:00
<q-video
v-if="!!rec.video2"
:src="rec.video2"
:ratio="rec.ratio2"
></q-video>
2022-11-10 19:32:56 +01:00
<div v-if="!!rec.img3" class="text-center">
2022-11-13 22:39:25 +01:00
<q-img :src="`` + rec.img2" class="img"></q-img>
2022-11-10 19:32:56 +01:00
</div>
<div v-if="!!rec.content3" v-html="rec.content3"></div>
2022-11-13 22:39:25 +01:00
<q-video
v-if="!!rec.video3"
:src="rec.video3"
:ratio="rec.ratio3"
></q-video>
2022-11-10 19:32:56 +01:00
<div v-if="!!rec.content4" v-html="rec.content4"></div>
2024-09-13 19:42:55 +02:00
<div v-for="myelem in myelems" :key="myelem._id">
2022-11-20 10:21:02 +01:00
<div>
2024-09-13 19:42:55 +02:00
<transition :duration="1000" appear>
<CTitleBanner
v-if="
(myelem.active || editOn) && !!rec.path && myelem.titleBanner
"
:class="`q-pa-xs `"
:title="myelem.titleBanner"
bgcolor="bg-primary"
:clcolor="myelem.color ? `` : `text-white`"
:mystyle="
myelem.color ? `color: ${myelem.color} !important;` : ``
"
:myclass="myelem.classBanner"
:canopen="true"
>
<CMyElem
:myelem="myelem"
:editOn="editOn"
:addOn="addOn"
:path="!!rec.path ? rec.path : ''"
:selElem="selElem"
@selElemClick="selElemClick"
>
</CMyElem>
</CTitleBanner>
2024-09-13 19:42:55 +02:00
<CMyElem
v-else-if="(myelem.active || editOn) && !!rec.path"
2024-09-13 19:42:55 +02:00
:myelem="myelem"
:editOn="editOn"
:addOn="addOn"
:path="!!rec.path ? rec.path : ''"
:selElem="selElem"
@selElemClick="selElemClick"
>
</CMyElem>
</transition>
2022-11-20 10:21:02 +01:00
</div>
<div v-if="myelem.type === shared_consts.ELEMTYPE.PAGE">
<CMyPageElem2 :mypath="myelem.container">&nbsp;</CMyPageElem2>
</div>
2022-11-13 22:39:25 +01:00
</div>
2024-09-13 19:42:55 +02:00
2022-11-11 18:16:28 +01:00
<div v-if="myelems.length === 0">
2022-11-13 22:39:25 +01:00
<CMyElem
2022-11-23 10:27:36 +01:00
v-if="editOn && !!rec.path"
2022-11-13 22:39:25 +01:00
:myelem="myelemVoid"
:editOn="editOn"
:addOn="addOn"
2022-11-17 08:10:43 +01:00
:selElem="selElem"
2022-11-13 22:39:25 +01:00
:path="rec.path"
2022-11-17 08:10:43 +01:00
@selElemClick="selElemClick"
2022-11-13 22:39:25 +01:00
>
2022-11-11 18:16:28 +01:00
</CMyElem>
</div>
2022-11-10 19:32:56 +01:00
</div>
2022-11-20 10:21:02 +01:00
<LandingFooter v-if="rec.showFooter"></LandingFooter>
2022-11-10 19:32:56 +01:00
</div>
<div v-else>
<div v-if="!!title">
<CTitle
2022-11-13 22:39:25 +01:00
v-if="imgbackground"
:imgbackground="imgbackground"
:headtitle="title"
:sizes="sizes"
:styleadd="styleadd"
></CTitle>
2022-11-10 19:32:56 +01:00
<div v-if="!imgbackground">
2022-11-13 22:39:25 +01:00
<CImgTitle v-if="img" :src="img" :title="title"> </CImgTitle>
2022-11-10 19:32:56 +01:00
</div>
<slot></slot>
<div v-if="!nofooter"></div>
2022-11-10 19:32:56 +01:00
</div>
</div>
2024-09-13 19:42:55 +02:00
<q-inner-loading id="spinner" :showing="onloading">
<q-spinner-tail color="primary" size="4em"> </q-spinner-tail>
</q-inner-loading>
2022-11-10 19:32:56 +01:00
</div>
</template>
<script lang="ts" src="./CMyPageElem.ts">
</script>
<style lang="scss" scoped>
@import './CMyPageElem.scss';
</style>