Fixes
This commit is contained in:
parent
55e0594eb4
commit
9f7ad503ef
64
src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/+
Normal file
64
src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/+
Normal file
@ -0,0 +1,64 @@
|
||||
import {v4 as uuidv4} from 'uuid'
|
||||
import Dependency from './Dependency.ts'
|
||||
|
||||
export default class Border {
|
||||
uuid: string = "";
|
||||
formula: string = "";
|
||||
calcValue: string = "";
|
||||
calcValue1: string = "";
|
||||
calcValue2: string = "";
|
||||
calcValue3: string = "";
|
||||
calcValue4: string = "";
|
||||
calcValue5: string = "";
|
||||
calcValue6: string = "";
|
||||
calcValue7: string = "";
|
||||
calcValue8: string = "";
|
||||
calcValue9: string = "";
|
||||
calcValue10: string = "";
|
||||
flatRate: string = "";
|
||||
value: string = "";
|
||||
dependencys: Dependency[] = [];
|
||||
|
||||
constructor() {
|
||||
this.uuid = uuidv4();
|
||||
}
|
||||
|
||||
addDependency(dep: Dependeny)
|
||||
{
|
||||
this.dependencys.push(dep)
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
'formula': this.formula,
|
||||
'calcValue': this.calcValue,
|
||||
'calcValue1': this.calcValue1,
|
||||
'calcValue2': this.calcValue2,
|
||||
'calcValue3': this.calcValue3,
|
||||
'calcValue4': this.calcValue4,
|
||||
'calcValue5': this.calcValue5,
|
||||
'calcValue6': this.calcValue6,
|
||||
'calcValue7': this.calcValue7,
|
||||
'calcValue8': this.calcValue8,
|
||||
'calcValue9': this.calcValue9,
|
||||
'calcValue10': this.calcValue10,
|
||||
'flatRate': this.flatRate,
|
||||
'value': this.value,
|
||||
'dependencys': this.dependencys.reduce((result, dep) => {
|
||||
result.push(dep.toJSON())
|
||||
return result
|
||||
}, [])
|
||||
}
|
||||
}
|
||||
fromJSON(obj) {
|
||||
this.formula = obj.formula
|
||||
this.value = obj.value
|
||||
this.flatRate = obj.flatRate
|
||||
this.calcValue = obj.calcValue
|
||||
obj.dependencys.map((d) => {
|
||||
const dep = new Dependency()
|
||||
dep.fromJSON(d)
|
||||
this.dependencys.push(dep)
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,6 @@
|
||||
import HeadlineElement from '@/model/HeadlineElement';
|
||||
import { computed } from 'vue';
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { SquareDot } from 'lucide-vue-next';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: HeadlineElement
|
||||
@ -17,10 +16,8 @@ const theModel = computed({
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex gap-2 flex-row items-center content-center">
|
||||
<SquareDot />
|
||||
<h1 v-if="theModel.variant == 1" class="text-4xl">{{theModel.default}}</h1>
|
||||
<h6 v-else-if="theModel.variant == 6" class="text-base">{{theModel.default}}</h6>
|
||||
<h5 v-else-if="theModel.variant == 5" class="text-lg">{{theModel.default}}</h5>
|
||||
|
||||
@ -20,7 +20,6 @@ const theModel = computed({
|
||||
|
||||
<template>
|
||||
<div class="flex gap-2 flex-row">
|
||||
<SquareDashed />
|
||||
<label>{{theModel?.id}}</label>
|
||||
<label class="w-60 flex-inital">{{theModel.name}}</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -20,7 +20,6 @@ const theModel = computed({
|
||||
|
||||
<template>
|
||||
<div class="flex gap-2 flex-row items-center">
|
||||
<SquarePen class="flex-none" />
|
||||
<label class="w-60 flex-inital">{{theModel.name}} {{theModel.default}}</label>
|
||||
<Input v-model:placeholder="theModel.placeholder" :modelValue="theModel.default" v-model:name="theModel.name" v-model:id="theModel.id" v-model:required="theModel.required"/>
|
||||
</div>
|
||||
|
||||
@ -17,6 +17,8 @@ const props = defineProps({
|
||||
|
||||
let emit = defineEmits(['update:modelValue']);
|
||||
const dragUuid = ref("");
|
||||
let isPreview = ref(false)
|
||||
|
||||
const store = useElementStore()
|
||||
|
||||
const theModel = computed({
|
||||
@ -55,6 +57,13 @@ const dragLeaveEmpty = (event: DragEvent, uuid: string) => {
|
||||
event.stopImmediatePropagation()
|
||||
}
|
||||
|
||||
store.$subscribe((mutation, state) => {
|
||||
if(state.showPreview) {
|
||||
isPreview.value = true
|
||||
}else{
|
||||
isPreview.value = false
|
||||
}
|
||||
})
|
||||
|
||||
const dragEnterEmpty = (event: DragEvent, uuid: string) => {
|
||||
dragUuid.value = uuid
|
||||
@ -68,8 +77,9 @@ const dragEnterEmpty = (event: DragEvent, uuid: string) => {
|
||||
<template>
|
||||
<div class="flex gap-2 flex-col">
|
||||
<div class="w-full flex flex-row gap-1" v-if="theModel!.columns.length > 0">
|
||||
<div class="grow border p-1 bg-white" v-for="col in theModel!.columns">
|
||||
<div class="h-8 group items-center content-justify w-full mb-2" v-if="col.items.length == 0" @drop="onDrop($event, theModel!.uuid, col)" @dragleave="dragLeaveEmpty($event, col.uuid)" @dragenter="dragEnterEmpty($event, col.uuid)"> <div class="inline-flex items-center justify-center w-full pointer-events-none">
|
||||
<div :class="{border: !isPreview}" class="flex-1 p-1 bg-white" v-for="col in theModel!.columns">
|
||||
<div class="h-8 group items-center content-justify w-full mb-2" v-if="col.items.length == 0" @drop="onDrop($event, theModel!.uuid, col)" @dragleave="dragLeaveEmpty($event, col.uuid)" @dragenter="dragEnterEmpty($event, col.uuid)">
|
||||
<div class="inline-flex items-center justify-center w-full pointer-events-none">
|
||||
<hr class="w-64 h-px my-2 bg-gray-200 border-0 dark:bg-gray-700 transition duration-200 pointer-events-none" :class="{ 'bg-orange-500': dragUuid == col.uuid }" >
|
||||
<span class="absolute px-3 font-medium text-gray-900 bg-white dark:text-white dark:bg-gray-900 pointer-events-none"><CirclePlus :class="{ 'text-orange-500': dragUuid == col.uuid }" class="transition duration-200 pointer-events-none" /></span>
|
||||
</div>
|
||||
|
||||
@ -28,7 +28,6 @@ const theModel = computed({
|
||||
|
||||
<template>
|
||||
<div class="flex gap-2 flex-row items-center">
|
||||
<SquareChevronDown class="flex-none" />
|
||||
<label class="w-60 flex-inital">{{theModel?.name}}</label>
|
||||
<div class="w-full">
|
||||
<Select :modelValue="theModel?.default">
|
||||
|
||||
@ -20,7 +20,6 @@ const theModel = computed({
|
||||
|
||||
<template>
|
||||
<div class="flex gap-2 flex-row">
|
||||
<SquareParking />
|
||||
<p>{{theModel?.default}}</p>
|
||||
<p style="white-space: pre-line;">{{theModel?.default}}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -20,7 +20,6 @@ const theModel = computed({
|
||||
|
||||
<template>
|
||||
<div class="flex gap-2 flex-row">
|
||||
<SquareMenu class="flex-none" />
|
||||
<label class="w-60 flex-inital">{{theModel?.name}}</label>
|
||||
<Textarea :value="theModel?.default" :name="theModel?.name" :id="theModel?.id"/>
|
||||
</div>
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { useElementStore } from '@/stores/Items'
|
||||
import { SquareParking, SquareDot, SquareMenu, SquarePen, SquareChevronDown, SquareDashed } from 'lucide-vue-next';
|
||||
import { Switch } from '@/components/ui/switch'
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
const store = useElementStore()
|
||||
|
||||
let previewMode = ref(false)
|
||||
|
||||
function startDrag(event: DragEvent, item: string) {
|
||||
event.dataTransfer.dropEffect = 'move';
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
@ -11,10 +16,22 @@ function startDrag(event: DragEvent, item: string) {
|
||||
store.setDragMode("insert")
|
||||
}
|
||||
|
||||
watch(previewMode, (newPreviewMode) => {
|
||||
if(newPreviewMode === false) {
|
||||
store.setShowPreview(false)
|
||||
}else{
|
||||
store.setShowPreview(true)
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col p-3 gap-3 overflow-auto">
|
||||
<div class="flex items-center space-x-2">
|
||||
<Switch id="preview-mode" v-model="previewMode" />
|
||||
<Label for="preview-mode">Preview Mode</Label>
|
||||
</div>
|
||||
<div id="headline" class="border-1 p-2 w-full flex flex-row gap-2" draggable="true" @dragstart="startDrag($event, '6')" @dragenter.prevent @dragover.prevent>
|
||||
<SquareDot />
|
||||
<span>Headline</span>
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
import TextElement from '@/model/TextElement';
|
||||
import { computed } from 'vue';
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { Checkbox } from '@/components/ui/checkbox'
|
||||
|
||||
const props = defineProps({
|
||||
@ -20,8 +21,8 @@ const theModel = computed({
|
||||
<template>
|
||||
<label>ID</label>
|
||||
<Input v-model="theModel!.id" />
|
||||
<label>Default</label>
|
||||
<Input v-model="theModel!.default"/>
|
||||
<label>Name</label>
|
||||
<Input v-model="theModel!.name"/>
|
||||
<label>Default</label>
|
||||
<Textarea v-model="theModel!.default"/>
|
||||
</template>
|
||||
|
||||
@ -26,7 +26,16 @@ const props = defineProps({
|
||||
|
||||
const store = useElementStore()
|
||||
|
||||
const dragUuid = ref("");
|
||||
const dragUuid = ref("")
|
||||
let isPreview = ref(false)
|
||||
|
||||
store.$subscribe((mutation, state) => {
|
||||
if(state.showPreview) {
|
||||
isPreview.value = true
|
||||
}else{
|
||||
isPreview.value = false
|
||||
}
|
||||
})
|
||||
|
||||
const startDrag = (event: DragEvent, uuid: string) => {
|
||||
event.dataTransfer!.dropEffect = 'move'
|
||||
@ -50,8 +59,13 @@ const dragEnter = (event: DragEvent, uuid: string) => {
|
||||
}
|
||||
|
||||
const stopDrag = (event: DragEvent, uuid: string) => {
|
||||
dragUuid.value = ""
|
||||
if(event.dataTransfer?.getData('mode') == "sort") {
|
||||
dragUuid.value = ""
|
||||
if(store.getSourceDragUuid == uuid) {
|
||||
store.setDragMode("")
|
||||
event.stopImmediatePropagation()
|
||||
return
|
||||
}
|
||||
store.moveItemBefore(store.getSourceDragUuid, uuid)
|
||||
store.setDragMode("")
|
||||
event.stopImmediatePropagation()
|
||||
@ -81,52 +95,56 @@ const editElementDependency = (item: BaseElement) => {
|
||||
<template>
|
||||
<div class="overflow-auto h-full">
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="d-flex flex flex-col relative items-center " v-for="item in items" v-if="items.length > 0" :key="item.uuid">
|
||||
<div class="h-8 group w-full mb-2" @dragleave.self="dragLeave($event, item.uuid)" @dragenter.self="dragEnter($event, item.uuid)" @drop="stopDrag($event, item.uuid)">
|
||||
<div class="inline-flex items-center justify-center w-full pointer-events-none">
|
||||
<hr class="w-64 h-px my-2 bg-gray-200 border-0 dark:bg-gray-700 transition duration-200 pointer-events-none" :class="{ 'bg-orange-500': dragUuid == item.uuid }" >
|
||||
<span class="absolute px-3 font-medium text-gray-900 -translate-x-1/2 bg-white left-1/2 dark:text-white dark:bg-gray-900 pointer-events-none"><CirclePlus :class="{ 'text-orange-500': dragUuid == item.uuid }" class="transition duration-200 pointer-events-none" /></span>
|
||||
<div class="d-flex flex flex-col relative items-center" v-for="item in items" v-if="items.length > 0" :key="item.uuid">
|
||||
<div class="w-full" v-if="item.type !== 1 || (item.type === 1 && !isPreview) ">
|
||||
<div class="h-8 group w-full" @dragleave.self="dragLeave($event, item.uuid)" @dragenter.self="dragEnter($event, item.uuid)" @drop="stopDrag($event, item.uuid)" v-if="!isPreview">
|
||||
<div class="inline-flex items-center justify-center w-full pointer-events-none">
|
||||
<hr class="w-64 h-px my-2 bg-gray-200 border-0 dark:bg-gray-700 transition duration-200 pointer-events-none" :class="{ 'bg-orange-500': dragUuid == item.uuid }" >
|
||||
<span class="absolute px-3 font-medium text-gray-900 -translate-x-1/2 bg-white left-1/2 dark:text-white dark:bg-gray-900 pointer-events-none"><CirclePlus :class="{ 'text-orange-500': dragUuid == item.uuid }" class="transition duration-200 pointer-events-none" /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div @dragstart="startDrag($event, item.uuid)" draggable="true" class="w-full flex flex-row border-1 border-slate-200 border-dashed p-2 hover:bg-gray-100 transition duration-500" v-bind:class="{ ' bg-slate-50': item.isFocused === true }">
|
||||
<div class="m-2 cursor-pointer">
|
||||
<Move />
|
||||
</div>
|
||||
|
||||
<div class="grow content-center items-center">
|
||||
<InputElementForm
|
||||
v-if="item.type === 2"
|
||||
v-model="item as InputElement"
|
||||
<div :class="{ 'border-white' : item.dependencys.length == 0, 'border-blue-500': item.dependencys.length > 0 }" @dragstart="startDrag($event, item.uuid)" draggable="true" class="element w-full flex flex-row border-l-2 hover:border-orange-500 pl-2 transition duration-500 min-h-5" v-bind:class="{ ' bg-slate-50': item.isFocused === true }">
|
||||
<div class="grow content-center items-center">
|
||||
<InputElementForm
|
||||
v-if="item.type === 2"
|
||||
v-model="item as InputElement"
|
||||
/>
|
||||
<HiddenElementForm
|
||||
v-if="item.type === 1"
|
||||
v-model="item as InputElement"
|
||||
/>
|
||||
<SelectElementForm
|
||||
v-if="item.type === 3"
|
||||
v-model="item as SelectElement"
|
||||
/>
|
||||
<TextElementForm
|
||||
v-if="item.type === 4"
|
||||
v-model="item as TextElement"
|
||||
/>
|
||||
<TextareaElementForm
|
||||
v-if="item.type === 5"
|
||||
v-model="item as TextareaElement"
|
||||
/>
|
||||
<SelectElementForm
|
||||
v-if="item.type === 3"
|
||||
v-model="item as SelectElement"
|
||||
<HeadlineElementForm
|
||||
v-if="item.type === 6"
|
||||
v-model="item as HeadlineElement"
|
||||
/>
|
||||
<TextElementForm
|
||||
v-if="item.type === 4"
|
||||
v-model="item as TextElement"
|
||||
<RowElementForm
|
||||
v-if="item.type === 7"
|
||||
v-model="item as Row"
|
||||
/>
|
||||
<TextareaElementForm
|
||||
v-if="item.type === 5"
|
||||
v-model="item as TextareaElement"
|
||||
/>
|
||||
<HeadlineElementForm
|
||||
v-if="item.type === 6"
|
||||
v-model="item as HeadlineElement"
|
||||
/>
|
||||
<RowElementForm
|
||||
v-if="item.type === 7"
|
||||
v-model="item as Row"
|
||||
/>
|
||||
</div>
|
||||
<div v-on:click="editElementDependency(item)" class="m-2 cursor-pointer">
|
||||
<Waypoints />
|
||||
</div>
|
||||
<div v-on:click="editElementProperties(item)" class="m-2 cursor-pointer">
|
||||
<Settings />
|
||||
</div>
|
||||
<div v-on:click="deleteItem(item)" class="text-red-500 m-2 cursor-pointer">
|
||||
<Trash />
|
||||
</div>
|
||||
<div class="buttons absolute rounded-sm invisible right-0 bg-slate-100/70 flex flex-row gap-2" v-if="!isPreview">
|
||||
<div v-on:click="editElementDependency(item)" class="m-2 cursor-pointer">
|
||||
<Waypoints />
|
||||
</div>
|
||||
<div v-on:click="editElementProperties(item)" class="m-2 cursor-pointer">
|
||||
<Settings />
|
||||
</div>
|
||||
<div v-on:click="deleteItem(item)" class="text-red-500 m-2 cursor-pointer">
|
||||
<Trash />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -135,4 +153,7 @@ const editElementDependency = (item: BaseElement) => {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.element:hover > .buttons {
|
||||
visibility: visible
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import {
|
||||
SwitchRoot,
|
||||
type SwitchRootEmits,
|
||||
type SwitchRootProps,
|
||||
SwitchThumb,
|
||||
useForwardPropsEmits,
|
||||
} from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<SwitchRootProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const emits = defineEmits<SwitchRootEmits>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<SwitchRoot
|
||||
data-slot="switch"
|
||||
v-bind="forwarded"
|
||||
:class="cn(
|
||||
'peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
||||
props.class,
|
||||
)"
|
||||
>
|
||||
<SwitchThumb
|
||||
data-slot="switch-thumb"
|
||||
:class="cn('bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0')"
|
||||
>
|
||||
<slot name="thumb" />
|
||||
</SwitchThumb>
|
||||
</SwitchRoot>
|
||||
</template>
|
||||
@ -0,0 +1 @@
|
||||
export { default as Switch } from './Switch.vue'
|
||||
@ -5,6 +5,16 @@ export default class Border {
|
||||
uuid: string = "";
|
||||
formula: string = "";
|
||||
calcValue: string = "";
|
||||
calcValue1: string = "";
|
||||
calcValue2: string = "";
|
||||
calcValue3: string = "";
|
||||
calcValue4: string = "";
|
||||
calcValue5: string = "";
|
||||
calcValue6: string = "";
|
||||
calcValue7: string = "";
|
||||
calcValue8: string = "";
|
||||
calcValue9: string = "";
|
||||
calcValue10: string = "";
|
||||
flatRate: string = "";
|
||||
value: string = "";
|
||||
dependencys: Dependency[] = [];
|
||||
@ -22,6 +32,16 @@ export default class Border {
|
||||
return {
|
||||
'formula': this.formula,
|
||||
'calcValue': this.calcValue,
|
||||
'calcValue1': this.calcValue1,
|
||||
'calcValue2': this.calcValue2,
|
||||
'calcValue3': this.calcValue3,
|
||||
'calcValue4': this.calcValue4,
|
||||
'calcValue5': this.calcValue5,
|
||||
'calcValue6': this.calcValue6,
|
||||
'calcValue7': this.calcValue7,
|
||||
'calcValue8': this.calcValue8,
|
||||
'calcValue9': this.calcValue9,
|
||||
'calcValue10': this.calcValue10,
|
||||
'flatRate': this.flatRate,
|
||||
'value': this.value,
|
||||
'dependencys': this.dependencys.reduce((result, dep) => {
|
||||
@ -35,6 +55,16 @@ export default class Border {
|
||||
this.value = obj.value
|
||||
this.flatRate = obj.flatRate
|
||||
this.calcValue = obj.calcValue
|
||||
this.calcValue1 = obj.calcValue1
|
||||
this.calcValue2 = obj.calcValue2
|
||||
this.calcValue3 = obj.calcValue3
|
||||
this.calcValue4 = obj.calcValue4
|
||||
this.calcValue5 = obj.calcValue5
|
||||
this.calcValue6 = obj.calcValue6
|
||||
this.calcValue7 = obj.calcValue7
|
||||
this.calcValue8 = obj.calcValue8
|
||||
this.calcValue9 = obj.calcValue9
|
||||
this.calcValue10 = obj.calcValue10
|
||||
obj.dependencys.map((d) => {
|
||||
const dep = new Dependency()
|
||||
dep.fromJSON(d)
|
||||
|
||||
@ -74,4 +74,15 @@ export default class Column extends BaseElement {
|
||||
|
||||
return inserted
|
||||
}
|
||||
}
|
||||
|
||||
deleteItem(item: BaseElement): boolean {
|
||||
return this.items.some((element,indexArray) => {
|
||||
if(element.uuid === item.uuid) {
|
||||
item = this.items.splice(indexArray, 1)[0]
|
||||
return true
|
||||
}
|
||||
if(element.deleteItem(item)) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
}}
|
||||
|
||||
@ -9,6 +9,7 @@ export default class HeadlineElement extends BaseElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.type = 6
|
||||
this.default = "Headline"
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
|
||||
@ -8,6 +8,7 @@ export default class HiddenElement extends BaseElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.type = 1
|
||||
this.name = "hidden"
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
|
||||
@ -49,14 +49,21 @@ export default class Row extends BaseElement {
|
||||
|
||||
insertItem(item: BaseElement, targetUuid: string): boolean {
|
||||
this.columns.some((col,indexArray) => {
|
||||
item = col.insertItem(item, targetUuid)
|
||||
if(item !== null) {
|
||||
if(col.insertItem(item, targetUuid)) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
deleteItem(item: BaseElement): boolean {
|
||||
this.columns.some((col,indexArray) => {
|
||||
if(col.deleteItem(item)) {
|
||||
return true;
|
||||
}
|
||||
})
|
||||
return false
|
||||
}
|
||||
insertItemInEmptyColumn(item: BaseElement, targetUuid: string, column: Column) {
|
||||
if(this.uuid == targetUuid) {
|
||||
column.items.push(item)
|
||||
|
||||
@ -8,6 +8,7 @@ export default class TextElement extends BaseElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.type = 4
|
||||
this.default = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.';
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import BaseElement from '@/model/BaseElement';
|
||||
import Parser from '@/lib/parser';
|
||||
import BaseElement from '@/model/BaseElement'
|
||||
import Parser from '@/lib/parser'
|
||||
import {v4 as uuidv4} from 'uuid'
|
||||
|
||||
export const useElementStore = defineStore('items', {
|
||||
@ -11,6 +11,7 @@ export const useElementStore = defineStore('items', {
|
||||
activeItem: {} as BaseElement | {},
|
||||
showProperties: false,
|
||||
showDependency: false,
|
||||
showPreview: false,
|
||||
sourceDragUuid: "",
|
||||
dragMode: "",
|
||||
json: "",
|
||||
@ -22,12 +23,13 @@ export const useElementStore = defineStore('items', {
|
||||
getActiveItem: (state) => state.activeItem as BaseElement,
|
||||
isShowPropierties: (state) => state.showProperties,
|
||||
isShowDependency: (state) => state.showDependency,
|
||||
isShowPreview: (state) => state.showPreview,
|
||||
getSourceDragUuid: (state) => state.sourceDragUuid,
|
||||
getDragMode: (state) => state.dragMode,
|
||||
},
|
||||
actions: {
|
||||
addElement(item: BaseElement) {
|
||||
this.items.push(item);
|
||||
this.items.push(item)
|
||||
},
|
||||
loadJSON() {
|
||||
let options: [] = this.items.reduce((result, opt) => {
|
||||
@ -51,48 +53,52 @@ export const useElementStore = defineStore('items', {
|
||||
this.uuid = obj[0].uuid
|
||||
}
|
||||
obj[0].options.map((ob) => {
|
||||
const item = Parser.getModelForType(ob.type);
|
||||
const item = Parser.getModelForType(ob.type)
|
||||
item.fromJSON(ob)
|
||||
console.log(item)
|
||||
this.addElement(item)
|
||||
})
|
||||
},
|
||||
changeFocus(uuid: string) {
|
||||
this.items.forEach(element => {
|
||||
element.changeFocus(uuid);
|
||||
element.changeFocus(uuid)
|
||||
})
|
||||
},
|
||||
clearSelection() {
|
||||
this.items.forEach(element => {
|
||||
element.changeFocus("xx");
|
||||
element.changeFocus("xx")
|
||||
})
|
||||
this.showProperties = false
|
||||
},
|
||||
setShowDependency(value: boolean) {
|
||||
this.showDependency = value;
|
||||
this.showDependency = value
|
||||
},
|
||||
setShowProperties(value: boolean) {
|
||||
this.showProperties = value;
|
||||
this.showProperties = value
|
||||
},
|
||||
setShowPreview(value: boolean) {
|
||||
this.showPreview = value
|
||||
},
|
||||
setActiveItem(item: BaseElement) {
|
||||
this.activeItem = item;
|
||||
this.activeItem = item
|
||||
},
|
||||
deleteItem(item: BaseElement) {
|
||||
for (let i = 0; i < this.items.length; ++i) {
|
||||
if(this.items[i].uuid === item.uuid) {
|
||||
this.items.splice(i, 1);
|
||||
break;
|
||||
return this.items.some((element,indexArray) => {
|
||||
if(element.uuid === item.uuid) {
|
||||
item = this.items.splice(indexArray, 1)[0]
|
||||
return true
|
||||
}
|
||||
this.items[i].deleteItem(item)
|
||||
}
|
||||
if(element.deleteItem(item)) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
},
|
||||
moveSortItemToEmptyElement(targetUuid: string, column: Column) {
|
||||
const item = this.cutItem(this.sourceDragUuid);
|
||||
const item = this.cutItem(this.sourceDragUuid)
|
||||
this.insertItemInEmptyColumn(this.items, item!, targetUuid, column)
|
||||
|
||||
},
|
||||
moveItemBefore(dragUuid: string, targetUuid: string): boolean {
|
||||
const item = this.cutItem(dragUuid);
|
||||
const item = this.cutItem(dragUuid)
|
||||
return this.insertItem(this.items, item, targetUuid)
|
||||
},
|
||||
addElementAfter(item: BaseElement, targetUuid: string) {
|
||||
@ -102,7 +108,7 @@ export const useElementStore = defineStore('items', {
|
||||
this.sourceDragUuid = uuid
|
||||
},
|
||||
cutItem(existingUuid: string) {
|
||||
let item: BaseElement|null = null;
|
||||
let item: BaseElement|null = null
|
||||
this.items.some((element,indexArray) => {
|
||||
if(element.uuid === existingUuid) {
|
||||
item = this.items.splice(indexArray, 1)[0]
|
||||
@ -114,11 +120,11 @@ export const useElementStore = defineStore('items', {
|
||||
return true
|
||||
}
|
||||
}
|
||||
});
|
||||
return item;
|
||||
})
|
||||
return item
|
||||
},
|
||||
getItem(existingUuid: string) {
|
||||
let item: BaseElement|null = null;
|
||||
let item: BaseElement|null = null
|
||||
item = this.items.some((element,indexArray) => {
|
||||
if(element.uuid === existingUuid) {
|
||||
return element
|
||||
@ -130,16 +136,16 @@ export const useElementStore = defineStore('items', {
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return item;
|
||||
})
|
||||
return item
|
||||
},
|
||||
insertItem(items: BaseElement[], item: BaseElement, targetUuid: string): boolean {
|
||||
let inserted = false;
|
||||
let inserted = false
|
||||
for (let i = 0; i < items.length; ++i) {
|
||||
if(items[i].uuid === targetUuid) {
|
||||
items.splice(i, 0, item);
|
||||
items.splice(i, 0, item)
|
||||
inserted = true
|
||||
break;
|
||||
break
|
||||
}
|
||||
if(!inserted) {
|
||||
inserted = items[i].insertItem(item, targetUuid)
|
||||
@ -149,7 +155,7 @@ export const useElementStore = defineStore('items', {
|
||||
return inserted
|
||||
},
|
||||
insertItemInEmptyColumn(items: BaseElement[], item: BaseElement, targetUuid: string, column: Column): boolean {
|
||||
let inserted = false;
|
||||
let inserted = false
|
||||
for (let i = 0; i < items.length; ++i) {
|
||||
inserted = items[i].insertItemInEmptyColumn(item, targetUuid, column)
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ $this->headScript()->prependFile('/'. $this->designPath . '/js/saxoprint.js');
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="border border-slate-200 mt-10 md:w-2/4 md:m-auto ml-2 mr-2 md:mt-10">
|
||||
<div class="mt-10 md:m-auto ml-2 mr-2">
|
||||
<!--
|
||||
<div class="bg-gray-200 divide-x flex w-full" id="default-tab" data-tabs-active-classes="border-b-2 border-gray-400 bg-gray-300" data-tabs-toggle="#product-content" role="tablist">
|
||||
<div class="w-1/2 p-1 cursor-pointer" data-tabs-target="#div-calc" type="button" role="tab" aria-controls="div-calc" aria-selected="false">Kalkulation</div>
|
||||
@ -72,9 +72,6 @@ $this->headScript()->prependFile('/'. $this->designPath . '/js/saxoprint.js');
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="div-details" role="tabpanel" aria-labelledby="div-details-tab">
|
||||
<div class="m-2"><?php echo $this->article->info ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,249 +1,35 @@
|
||||
<script>
|
||||
function loadFile(link, file, title) {
|
||||
if(file == "pic") {
|
||||
$('.thumbnail').html('<a href="' + link + '" data-lightbox="article_detail"><img id="layouter" src="' + link +'" class="articlelistimg " alt="' + title + '" title="' + title + '"></a>');
|
||||
} else if(file == "youtube") {
|
||||
$('.thumbnail').html('<iframe style="width:100%;" src="' + link + '" frameborder="0" allowfullscreen=""></iframe>');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="row articletemplates-2">
|
||||
|
||||
<div class="col-xs-12">
|
||||
<a class="btn-large pull-right" href="<?php echo $this->backurl ?>"><?php echo $this->translate('Zurück') ?></a>
|
||||
<h1><?php echo $this->article->title ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
|
||||
<li class="active" role="presentation" ><a href="#details" data-toggle="tab"><?php echo $this->translate('Produkt') ?></a></li>
|
||||
<?php if(!$this->designsettings()->get('einbetten')): ?><li><a href="#einbetten" data-toggle="tab"><?php echo $this->translate('Einbetten')?></a></li><?php endif; ?>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="details">
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="thumbnail">
|
||||
|
||||
<?php echo $this->image()->thumbnailImage($this->article->title, 'layouter', $this->article->file); ?>
|
||||
<br/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if ($this->admin && $this->role->level >= 40): ?>
|
||||
|
||||
<a class="btn btn-inverse btn-large pop_over" data-trigger="hover" data-placement="bottom" data-content="Bearbeiten Sie die Eigenschaften des Produkts." data-original-title="Eigenschaften" onclick="javascript:window.open('/admin/article/edit?sid=<?= $this->article->shop_id ?>&uid=<?= $this->article->id ?>&type=<?= $this->article->typ ?>', 'contactWindow', 'width=800,height=600,top=10,left=10,directories=no,toolbar=no,location=no,menubar=no,scrollbars=no,status=no,resizable=yes,dependent=no');return false;" href="/myshop/editarticle/<?= $this->article->uuid ?>">
|
||||
<span class="glyphicon glyphicon-folder-open"></span> <?php echo $this->translate('Eigenschaften bearbeiten')?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
/******************************************************************************************************************************************************************************
|
||||
* Beginn SPalte 2
|
||||
*/
|
||||
?>
|
||||
<div class="col-md-9">
|
||||
|
||||
<form method="post" action="">
|
||||
<dl> <?php echo $this->form->auflage ?></dl> <?php echo $this->form->ajax_calc_id ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Produktkonfiguration und Summe:
|
||||
* Verschachtelte Anzeige: daher: neue Row
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8" style="padding:0 2em">
|
||||
<?php if ($this->article->lager_file_preview != ""): ?>
|
||||
|
||||
<a href="<?= $this->image()->thumbnailImage('test', 'test', $this->article->lager_file_preview, true, true) ?>"><?php $this->translate('Vorschau') ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
<?= $this->article->info ?>
|
||||
|
||||
|
||||
<p><br/></p>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4" style="padding-right: 0px;padding-left: 0px;">
|
||||
<div class="well wellMobile2 andMobile" style="padding: 10px;">
|
||||
<?php if(!$this->article->display_no_price): ?>
|
||||
<?php if($this->article->stock): ?>
|
||||
<label class="basketstocklabel"><?php echo $this->translate('Aktueller Bestand')?>: <?php echo $this->article->stock_count ?> <?php echo $this->translate('Stk.')?></label><br />
|
||||
<?php endif; ?>
|
||||
<?php if(!$this->article->display_no_price AND !$this->designsettings()->get('display_no_price')): ?>
|
||||
<h3><?php echo $this->translate('Summe')?></h3>
|
||||
<br/>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if($this->weight > 0): ?>
|
||||
<p id="weight_display" class="text-info"><?php echo $this->translate('Gewicht')?>: <span><?php echo $this->weight ?></span>g</p>
|
||||
<?php endif; ?>
|
||||
<div class="wellforMobilePrice">
|
||||
<?php if(!$this->article->display_no_price AND !$this->designsettings()->get('display_no_price')): ?>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo $this->translate('Preis (netto)')?>:</td>
|
||||
<td class="pull-right"><span
|
||||
id="price_netto"><?= $this->currency->toCurrency($this->netto) ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $this->translate('zzgl. ') ?> <?php echo $this->article->mwert; ?>% <?= $this->translate('MwSt.') ?></td>
|
||||
<td class="pull-right"><span
|
||||
id="price_steuer"><?= $this->currency->toCurrency(($this->brutto - $this->netto) * 1) ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo $this->translate('Preis (brutto)')?>:</strong></td>
|
||||
<td class="pull-right"><strong><span
|
||||
id="price_brutto"><?= $this->currency->toCurrency($this->brutto) ?></span></strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="wellforMobileBTN">
|
||||
<form action="/article/buy/?id=<?= $this->article->id ?>" target="_self" role="form" class="form-horizontal buy" id="buyform" method="POST" style="padding:8px">
|
||||
<div class="form-group form-group-sm">
|
||||
<label class="col-sm-3 control-label" for="count"><?php echo $this->translate('Anzahl')?>: </label>
|
||||
<div class="col-sm-5 col-sm-offset-4">
|
||||
<input type="text" value="1" class="form-control" name="count">
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<?= $this->formHidden('load', $this->load) ?>
|
||||
<input type="submit" class="btn btn-success btn-large orderbtn"
|
||||
value="<?= $this->translate('Buy') ?>">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md:flex">
|
||||
<?php if($this->form->auflage): ?>
|
||||
<form method="post" class="basis-2/3" action="">
|
||||
<?php echo $this->form->auflage ?><?php echo $this->form->ajax_calc_id ?>
|
||||
</form>
|
||||
<div class="basis-1/3">
|
||||
<?php else: ?>
|
||||
<div class="w-full">
|
||||
<?php endif; ?>
|
||||
<h2 class="text-lg font-lenzFont font-medium">Summe</h2>
|
||||
<table class="table-auto w-full">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo $this->translate('Preis (netto)') ?>:</td>
|
||||
<td class="text-right"><span id="netto"><?= $this->currency->toCurrency($this->netto) ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $this->translate('zzgl. ') ?> <?php echo $this->article->mwert; ?>% <?= $this->translate('MwSt.') ?></td>
|
||||
<td class="text-right"><span id="mwert"><?= $this->currency->toCurrency(($this->brutto - $this->netto) * 1) ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo $this->translate('Preis (brutto)') ?>:</strong></td>
|
||||
<td class="text-right"><strong><span id="brutto"><?= $this->currency->toCurrency($this->brutto) ?></span></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (!$this->article->not_buy) : ?>
|
||||
<div class="flex flex-row gap-2">
|
||||
<input type="text" value="1" class="border border-gray-300 m bg-gray-200 text-black p-2 w-full" name="count">
|
||||
<input type="hidden" id="upload_mode" name="upload_mode" value="<?php echo $this->upload_mode ?>" />
|
||||
<button type="button" id="in_basket" class="w-full transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-slate-200 border bg-highlight text-white p-2 pl-5 pr-5 rounded-full disabled bg-highlight "><?= $this->translate('Buy') ?></button>
|
||||
</div>
|
||||
|
||||
<?php if(!$this->designsettings()->get('einbetten')): ?>
|
||||
<div class="tab-pane" id="einbetten">
|
||||
<h2><?php echo $this->translate('Einbetten') ?></h2>
|
||||
<p><?php echo $this->translate('Teilen Sie dieses Produkt mit Anderen, bewerben Sie es im eigenen BLOG oder Ihrer Website') ?></p>
|
||||
<div class="htmlSnippet">
|
||||
<textarea onclick="this.focus(); this.select();" style="width:99%; height: 180px;">
|
||||
<?php echo $this->escape($this->htmlsnippet) ?>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="col-xs-12">
|
||||
<!-- vorschau-bilder -->
|
||||
<?php if($this->article->file1 != "" || $this->article->file2 != "" || $this->article->file3 != "" || $this->article->file4 != "" || $this->article->file5 != ""): ?>
|
||||
|
||||
<div class="vorschau-bilder-klein clearfix">
|
||||
|
||||
<?php if($this->article->file != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->file1 != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file1, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file1, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->file2 != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file2, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file2, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->file3 != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file3, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file3, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->file4 != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file4, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file4, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->file5 != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file5, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file5, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->file6 != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file6, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file6, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->file7 != ""): ?>
|
||||
<label onclick="loadFile('<?php echo $this->image()->thumbnailImage($this->article->title, 'articlesinglegreater', $this->article->file7, true); ?>', 'pic', '<?php echo $this->article->title ?>')">
|
||||
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file7, true); ?>" class="img-fluid">
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if ( $this->article->getYoutubeId() != '') : ?>
|
||||
<label onclick="loadFile('//www.youtube.com/embed/<?php echo $this->article->getYoutubeId(); ?>', 'youtube')">
|
||||
<img style="background:url(<?php echo'https://img.youtube.com/vi/'.$this->article->getYoutubeId().'/1.jpg'; ?>)" src="/<?php echo $this->designPath ?>bootstrap/img/miniplay.png"alt="" />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="col-md-4" style="padding-left: 0px;padding-right: 0px;">
|
||||
<?php if($this->article->text_art != ""):?><?php echo $this->article->text_art ?><br/><?php endif; ?>
|
||||
<?php if($this->article->text_format != ""):?><?php echo $this->article->text_format ?><br/><?php endif; ?>
|
||||
<?php if($this->article->kostenstelle): ?>
|
||||
<?= $this->translate('Kostenstelle') ?>: <?php echo $this->article->kostenstelle; ?><br />
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->article_nr_extern): ?>
|
||||
<?= $this->translate('Artikelnummer') ?>: <?php echo $this->article->article_nr_extern; ?><br />
|
||||
<?php endif; ?>
|
||||
<?php if($this->weight > 0): ?>
|
||||
<p id="weight_display" class="text-info"><?= $this->translate('Gewicht') ?>: <span><?php echo $this->weight ?></span>g</p>
|
||||
<?php endif; ?>
|
||||
<?php if($this->article->article_nr_extern or $this->article->stock or $this->weight > 0): ?>
|
||||
<?php endif; ?>
|
||||
<p>
|
||||
<br/><?php if($this->shop->install_id == 7):?><a target="_blank" href="/cms/zahlung-versand#lieferzeiten"><?php echo $this->translate('Die Lieferzeiten in der Übersicht')?></a><?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-5" style="padding-left: 0px;padding-right: 0px;">
|
||||
<?php /*var_dump($this->article->getAblaufDatum(),"d.m.Y"); if($this->article->getAblaufDatum()) { echo "Ablaufdatum: " . date_format($this->article->getAblaufDatum(),"d.m.Y") . "<br />"; }*/
|
||||
if($this->article->getZusatzDesigner() != "") { echo $this->article->getZusatzDesigner() . "<br />"; }
|
||||
if($this->article->getZusatzAbmessung() != "") { echo $this->article->getZusatzAbmessung() . "<br />"; }
|
||||
if($this->article->getZusatzShipping() != "") { echo $this->article->getZusatzShipping() . "<br />"; }
|
||||
if($this->article->getAnsprechPartner() != "") { echo $this->article->getAnsprechPartner() . "<br />"; }
|
||||
?>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div style="margin-bottom:50px;"><?php echo $this->article->getText() ?></div>
|
||||
</div> <!-- // row articletemplates-2 -->
|
||||
</div>
|
||||
|
||||
@ -36,55 +36,31 @@
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="md:flex mt-10 md:w-2/4 md:m-auto gap-10 ml-2 mr-2">
|
||||
<div class="md:w-1/2">
|
||||
<?php if ($this->article->file != "" && $this->layouterPreviewId == "") : ?>
|
||||
<?php echo $this->image()->thumbnailImage($this->article->title, 'productdetail', $this->article->file); ?>
|
||||
<div class="md:flex">
|
||||
<form id="CALCFORM" class="m-2 basis-2/3"></form>
|
||||
<div class="basis-1/3 m-2">
|
||||
<h2 class="text-lg font-lenzFont font-medium">Summe</h2>
|
||||
<table class="table-auto w-full">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo $this->translate('Preis (netto)') ?>:</td>
|
||||
<td class="text-right"><span id="netto"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $this->translate('zzgl. ') ?> <?php echo $this->article->mwert; ?>% <?= $this->translate('MwSt.') ?></td>
|
||||
<td class="text-right"><span id="mwert"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo $this->translate('Preis (brutto)') ?>:</strong></td>
|
||||
<td class="text-right"><strong><span id="brutto"></span></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (!$this->article->not_buy) : ?>
|
||||
<input type="hidden" id="upload_mode" name="upload_mode" value="<?php echo $this->upload_mode ?>" />
|
||||
<button type="button" id="in_basket" class="w-full transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-slate-200 border bg-highlight text-white p-2 pl-5 pr-5 rounded-full disabled bg-highlight "><?= $this->translate('Buy') ?></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="md:w-1/2">
|
||||
<h2 class="text-highlight text-2xl font-lenzFont"><?php echo $this->article->title ?></h2>
|
||||
<p><?php echo $this->article->einleitung ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border border-slate-200 mt-10 md:w-2/4 md:m-auto ml-2 mr-2 md:mt-10">
|
||||
<div class="bg-gray-200 divide-x flex w-full" id="default-tab" data-tabs-active-classes="border-b-2 border-gray-400 bg-gray-300" data-tabs-toggle="#product-content" role="tablist">
|
||||
<div class="w-1/2 p-1 cursor-pointer" data-tabs-target="#div-calc" type="button" role="tab" aria-controls="div-calc" aria-selected="false">Kalkulation</div>
|
||||
<div class="w-1/2 p-1 cursor-pointer" data-tabs-target="#div-details" type="button" role="tab" aria-controls="div-details" aria-selected="false">Beschreibung</div>
|
||||
</div>
|
||||
<div id="product-content">
|
||||
<div id="div-calc" role="tabpanel" aria-labelledby="div-calc-tab">
|
||||
<div class="md:flex">
|
||||
<form id="CALCFORM" class="m-2 basis-2/3"></form>
|
||||
<div class="basis-1/3 m-2">
|
||||
<h2 class="text-lg font-lenzFont font-medium">Summe</h2>
|
||||
<table class="table-auto w-full">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo $this->translate('Preis (netto)') ?>:</td>
|
||||
<td class="text-right"><span id="netto"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $this->translate('zzgl. ') ?> <?php echo $this->article->mwert; ?>% <?= $this->translate('MwSt.') ?></td>
|
||||
<td class="text-right"><span id="mwert"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo $this->translate('Preis (brutto)') ?>:</strong></td>
|
||||
<td class="text-right"><strong><span id="brutto"></span></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (!$this->article->not_buy) : ?>
|
||||
<input type="hidden" id="upload_mode" name="upload_mode" value="<?php echo $this->upload_mode ?>" />
|
||||
<button type="button" id="in_basket" class="w-full transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-slate-200 border bg-highlight text-white p-2 pl-5 pr-5 rounded-full disabled bg-highlight "><?= $this->translate('Buy') ?></button>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->article->as_offer) : ?><button type="button" class="w-full transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-slate-200 border bg-highlight text-black p-2 pl-5 pr-5 rounded-full disabled bg-slate-50 mt-5 "><?php echo $this->translate('Angebot drucken') ?></button><?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="div-details" role="tabpanel" aria-labelledby="div-details-tab">
|
||||
<div class="m-2"><?php echo $this->article->info ?></div>
|
||||
</div>
|
||||
<?php if ($this->article->as_offer) : ?><button type="button" class="w-full transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-slate-200 border bg-highlight text-black p-2 pl-5 pr-5 rounded-full disabled bg-slate-50 mt-5 "><?php echo $this->translate('Angebot drucken') ?></button><?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -53,18 +53,18 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="bg-white"> <?php
|
||||
<div> <?php
|
||||
$PriorityMessenger = $this->PriorityMessenger();
|
||||
if(count($PriorityMessenger)): ?>
|
||||
<div class="w-3/4 md:w-2/4 m-auto border border-gray-300 p-2 mt-2 mb-2">
|
||||
<div class="m-auto border border-gray-300 p-2 mb-2">
|
||||
<?php
|
||||
foreach ($PriorityMessenger as $label => $messages) {
|
||||
if (count($messages)) {
|
||||
foreach ($messages as $message) {
|
||||
if($label == 'error') {
|
||||
echo '<div class="text-red-500">'.$this->translate($message).'</div>';
|
||||
echo '<div class="text-red-500 text-xl">'.$this->translate($message).'</div>';
|
||||
}else{
|
||||
echo '<div class="text-green-500">'.$this->translate($message).'</div>';
|
||||
echo '<div class="text-green-500 text-xl">'.$this->translate($message).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<?php
|
||||
$relatedbuys = $this->article->getRelated();
|
||||
if (!empty($relatedbuys)):
|
||||
if (false && !empty($relatedbuys)):
|
||||
?>
|
||||
<div class="md:w-2/4 m-auto">
|
||||
<h3 class="text-highlight text-2xl mt-5"><?php echo $this->translate('Wir empfehlen auch', 'text', 'releated_article_h1') ?></h3>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
<script>
|
||||
parent.postMessage({action: 'redirectBasket'}, '*');
|
||||
parent.postMessage({action: 'setBasketCount', data: 0}, '*');
|
||||
parent.postMessage({action: 'redirectBasket'}, '*');
|
||||
</script>
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="md:flex bg-white mt-4 border mb-4">
|
||||
<div class="md:flex bg-white border mb-4">
|
||||
<label class="bg-lenzBlue md:p-4 text-white md:flex-1">
|
||||
<a href="/basket"><h4><?php echo $this->translate('Schritt') ?> 1: <?php echo $this->translate('Warenkorb') ?></h4><?php echo $this->translate('Übersicht über Ihre Bestellung') ?></a>
|
||||
</label>
|
||||
@ -81,8 +81,8 @@
|
||||
|
||||
|
||||
<div class="flex mt-4 mb-4 ml-1 mr-1 md:ml-0 md:mr-0">
|
||||
<div class="flex-1"><?php echo $this->translate('Gewählte Versandart') ?>: <b><?php echo $this->shippingtype->title ?></b> <a href="/basket/index"><?php echo $this->translate('Ändern') ?></a></div>
|
||||
<div class="flex-1"><?php echo $this->translate('Gewählte Zahlungsart') ?>: <b><?php echo $this->paymenttype->title ?></b> <a href="/basket/index"><?php echo $this->translate('Ändern') ?></a></div>
|
||||
<!--<div class="flex-1"><?php echo $this->translate('Gewählte Versandart') ?>: <b><?php echo $this->shippingtype->title ?></b> <a href="/basket/index"><?php echo $this->translate('Ändern') ?></a></div>-->
|
||||
<div class="flex-1"><?php echo $this->translate('Gewählte Zahlungsart') ?>: <b><?php echo $this->paymenttype->title ?></b></div>
|
||||
</div>
|
||||
|
||||
<h3 class="mb-4 ml-1 md:ml-0"><?php echo $this->translate('Warenkorb') ?> <a class="underline" href="/basket/index"><?php echo $this->translate('Produkte ändern') ?></a></h3>
|
||||
@ -161,7 +161,7 @@
|
||||
<?php endif; ?>
|
||||
</thead><?php } ?>
|
||||
|
||||
<tr>
|
||||
<!--<tr>
|
||||
|
||||
<td align="right">
|
||||
<?php if(!$this->designsettings()->get('display_no_price')) { ?><?php echo $this->translate('zzgl. Versand'); ?><?php } else { ?><?php echo $this->translate('Versand'); ?><?php } ?>:
|
||||
@ -172,9 +172,9 @@
|
||||
<td align="right">
|
||||
<?php if(!$this->designsettings()->get('display_no_price')) { ?><?php echo $this->currency->toCurrency(TP_Basket::getBasket()->getVersandBrutto()) ?><?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>-->
|
||||
<?php if (!$this->no_payment) : ?>
|
||||
<?php if(!$this->designsettings()->get('display_no_price')) { ?><tr>
|
||||
<?php if(!$this->designsettings()->get('display_no_price')) { ?><!--<tr>
|
||||
|
||||
|
||||
<td align="right">
|
||||
@ -186,7 +186,7 @@
|
||||
<td align="right">
|
||||
<?php echo $this->currency->toCurrency(TP_Basket::getBasket()->getZahlartBrutto()) ?>
|
||||
</td>
|
||||
</tr><?php } ?>
|
||||
</tr>--><?php } ?>
|
||||
<?php endif; ?>
|
||||
<?php if(!$this->designsettings()->get('display_no_price')) { ?><?php if ($this->withTax) : ?>
|
||||
<?php foreach (TP_Basket::getBasket()->getMWert() as $key => $mw) : ?>
|
||||
@ -268,7 +268,7 @@
|
||||
<div class="controls">
|
||||
<label class="checkbox" style="padding-top: 0">
|
||||
<input type="checkbox" name="agb" value="1" data-toggle="toggle" data-size="small" data-offstyle="danger" data-onstyle="success" data-on="Ja" data-off="Nein" />
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="/agb" class="underline" target="_blank">AGBs</a> habe ich zur Kenntnis genommen und akzeptiere diese.') ?></span>
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="https://lenzdruck.ch/agb/" class="underline" target="_blank">AGBs</a> habe ich zur Kenntnis genommen und akzeptiere diese.') ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@ -277,33 +277,13 @@
|
||||
<div class="controls">
|
||||
<label class="checkbox" style="padding-top: 0">
|
||||
<input type="checkbox" name="agb" value="1" data-toggle="toggle" data-size="small" data-offstyle="danger" data-onstyle="success" data-on="Ja" data-off="Nein" />
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="/agb" class="underline" target="_blank">AGBs</a> habe ich zur Kenntnis genommen und akzeptiere diese.') ?></span>
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="https://lenzdruck.ch/agb/" class="underline" target="_blank">AGBs</a> habe ich zur Kenntnis genommen und akzeptiere diese.') ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="revocation" value="0" />
|
||||
|
||||
<?php if ($this->errorrevocation == true) : ?>
|
||||
<div class="control-group error">
|
||||
<div class="controls">
|
||||
<label class="checkbox" style="padding-top: 0">
|
||||
<input type="checkbox" name="revocation" value="1" data-toggle="toggle" data-size="small" data-offstyle="danger" data-onstyle="success" data-on="Ja" data-off="Nein" />
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="/revocation" class="underline" target="_blank">Widerrufsbelehrung</a> habe ich zur Kenntnis genommen.') ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox" style="padding-top: 0">
|
||||
<input type="checkbox" name="revocation" value="1" data-toggle="toggle" data-size="small" data-offstyle="danger" data-onstyle="success" data-on="Ja" data-off="Nein" />
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="/revocation" class="underline" target="_blank">Widerrufsbelehrung</a> habe ich zur Kenntnis genommen.') ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="revocation" value="1" />
|
||||
|
||||
<input type="hidden" name="privacy" value="0" />
|
||||
|
||||
@ -312,7 +292,7 @@
|
||||
<div class="controls">
|
||||
<label class="checkbox" style="padding-top: 0">
|
||||
<input type="checkbox" name="privacy" value="1" data-toggle="toggle" data-size="small" data-offstyle="danger" data-onstyle="success" data-on="Ja" data-off="Nein" />
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="/privacy" class="underline" target="_blank">Datenschutzerklärung</a> habe ich zur Kenntnis genommen.') ?></span>
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="https://lenzdruck.ch/datenschutzbestimmungen/" class="underline" target="_blank">Datenschutzerklärung</a> habe ich zur Kenntnis genommen.') ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@ -321,7 +301,7 @@
|
||||
<div class="controls">
|
||||
<label class="checkbox" style="padding-top: 0">
|
||||
<input type="checkbox" name="privacy" value="1" data-toggle="toggle" data-size="small" data-offstyle="danger" data-onstyle="success" data-on="Ja" data-off="Nein" />
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="/privacy" class="underline" target="_blank">Datenschutzerklärung</a> habe ich zur Kenntnis genommen.') ?></span>
|
||||
<span style="margin-bottom: 0"><?php echo $this->translate('Die <a href="https://lenzdruck.ch/datenschutzbestimmungen/" class="underline" target="_blank">Datenschutzerklärung</a> habe ich zur Kenntnis genommen.') ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -6,12 +6,6 @@
|
||||
<div class="text-white" style=""><?php echo $this->translate('Sie haben keine Artikel im Warenkorb. Keine Bestellung möglich.') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="mt-5" style="">
|
||||
<h3><?php echo $this->translate('Vielleicht möchten Sie einfach auf der Startseite beginnen?')?></h3>
|
||||
<br>
|
||||
<a class=" transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-gray-300 border bg-highlight text-white p-2 pl-5 pr-5 rounded-full disabled bg-highlight " href="/" title="<?= $this->shop->name; ?>: zur Startseite"><?php echo $this->translate('Zur Startseite') ?></a>
|
||||
</div>
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
@ -56,7 +50,7 @@
|
||||
</tr>
|
||||
</thead><?php } ?>
|
||||
<tbody>
|
||||
|
||||
<!--
|
||||
<tr>
|
||||
|
||||
<td class="text-right p-1">
|
||||
@ -73,7 +67,7 @@
|
||||
<td class="p-1 text-right">
|
||||
<?php if(!$this->designsettings()->get('display_no_price')) { ?><?php echo $this->currency->toCurrency($this->versand) ?> (<?php echo $this->currency->toCurrency($this->versandbrutto) ?>)<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>-->
|
||||
<?php if (!$this->no_payment) : ?>
|
||||
<tr>
|
||||
|
||||
@ -197,7 +191,6 @@
|
||||
</table>
|
||||
|
||||
<div class="mt-5 text-right">
|
||||
<input type="submit" class=" transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-gray-300 border bg-highlight text-black p-2 pl-5 pr-5 rounded-full disabled bg-slate-200 " title="weiter" onclick="location.href='/';return false;" value="<?php echo $this->translate('weiter einkaufen') ?>" />
|
||||
<input type="submit" class=" transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-gray-300 border bg-highlight text-white p-2 pl-5 pr-5 rounded-full disabled bg-highlight " title="bestellen" value="<?php echo $this->translate('Zur Kasse gehen') ?>" />
|
||||
</div>
|
||||
</form>
|
||||
@ -210,4 +203,4 @@
|
||||
</div>
|
||||
<script>
|
||||
parent.postMessage({action: 'setBasketCount', data: <?php echo count($this->articles) ?>}, '*');
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@ -19,7 +19,7 @@ $this->headScript()->prependFile('/' . $this->designPath . '/js/review.js');
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="md:flex bg-white mb-4 mt-4 border">
|
||||
<div class="md:flex bg-white mb-4 border">
|
||||
<label class="bg-lenzBlue md:p-4 text-white md:flex-1">
|
||||
<a href="/basket"><h4><?php echo $this->translate('Schritt') ?>1: <?php echo $this->translate('Warenkorb') ?></h4><?php echo $this->translate('Übersicht über Ihre Bestellung') ?></a>
|
||||
</label>
|
||||
|
||||
@ -350,7 +350,7 @@ function buildForm(elements, display_group = "", validElements = []) {
|
||||
}
|
||||
}
|
||||
});
|
||||
$obj.addClass('form-control');
|
||||
$obj.addClass('border border-gray-300 bg-gray-200 text-black p-2 w-full');
|
||||
}
|
||||
if(element.htmlType == "text") {
|
||||
var $obj = $('<input>', {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user