Use layout for Handlungsfelder
This commit is contained in:
parent
a0ea8a18a6
commit
a198da395a
|
|
@ -1,6 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as log from 'loglevel';
|
import * as log from 'loglevel';
|
||||||
import LinkCard from "@/components/mediacenter/LinkCard.vue";
|
import LinkCard from "@/components/mediacenter/LinkCard.vue";
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import HandlungsfeldLayout from "@/views/HandlungsfeldLayout.vue";
|
||||||
|
|
||||||
log.debug('Handlungsfeld created');
|
log.debug('Handlungsfeld created');
|
||||||
|
|
||||||
|
|
@ -50,6 +52,13 @@ const field = {
|
||||||
linkText: 'PDF anzeigen',
|
linkText: 'PDF anzeigen',
|
||||||
link: 'https://www.iterativ.ch'
|
link: 'https://www.iterativ.ch'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Die Motorfahrzeughaftpflicht',
|
||||||
|
iconUrl: '/static/icons/demo/icon-hf-book.png',
|
||||||
|
description: 'Buch «Sach- und Vermögensversicherungen» – Kapitel 16',
|
||||||
|
linkText: 'PDF anzeigen',
|
||||||
|
link: 'https://www.iterativ.ch'
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -115,14 +124,14 @@ const field = {
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: 'Rechtsstreigkeiten',
|
title: 'Rechtsstreigkeiten',
|
||||||
iconUrl: '',
|
iconUrl: '/static/icons/demo/icon-hf-einkommenssicherung.svg',
|
||||||
description: 'Lernmedium: Verkehrsrechtsschutz – Buch «Sach- und Vermögensversicherungen/Kapitel 12.3»',
|
description: 'Lernmedium: Verkehrsrechtsschutz – Buch «Sach- und Vermögensversicherungen/Kapitel 12.3»',
|
||||||
linkText: 'Handlungsfeldanzeigen',
|
linkText: 'Handlungsfeldanzeigen',
|
||||||
link: 'https://www.iterativ.ch'
|
link: 'https://www.iterativ.ch'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Rechtsstreigkeiten',
|
title: 'Rechtsstreigkeiten',
|
||||||
iconUrl: '',
|
iconUrl: '/static/icons/demo/icon-hf-einkommenssicherung.svg',
|
||||||
description: 'Lernmedium: Verkehrsrechtsschutz – Buch «Sach- und Vermögensversicherungen/Kapitel 12.3»',
|
description: 'Lernmedium: Verkehrsrechtsschutz – Buch «Sach- und Vermögensversicherungen/Kapitel 12.3»',
|
||||||
linkText: 'Handlungsfeldanzeigen',
|
linkText: 'Handlungsfeldanzeigen',
|
||||||
link: 'https://www.iterativ.ch'
|
link: 'https://www.iterativ.ch'
|
||||||
|
|
@ -132,49 +141,84 @@ const field = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const maxCardItems = 4;
|
||||||
|
const maxListItems = 6;
|
||||||
|
|
||||||
|
const displayAsCard = (itemType: string): boolean => {
|
||||||
|
return itemType === 'learnmedia' || itemType === 'realtiveLinks';
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasMoreItems = (items: object[], maxItems: number): boolean => {
|
||||||
|
return items.length > maxItems
|
||||||
|
}
|
||||||
|
|
||||||
|
const getMaxDisplayItems = (items: object[], maxItems: number) => {
|
||||||
|
return items.slice(maxItems - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getMaxDisplayItemsForType = (itemType: string, subItems: object[]) => {
|
||||||
|
return displayAsCard(itemType) ? getMaxDisplayItems(subItems, maxCardItems) : getMaxDisplayItems(subItems, maxListItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="body">
|
<Teleport to="body">
|
||||||
<div class="px-16 fixed top-0 overflow-y-scroll bg-white h-full w-full">
|
<HandlungsfeldLayout>
|
||||||
<div class="-mx-16 pt-4 pb-24 px-16 mb-20 bg-gray-200 flex justify-between">
|
<template #header>
|
||||||
<div class="w-5/12">
|
<div class="flex justify-between">
|
||||||
<h3 class="font-normal text-large mb-3">Handlungsfeld</h3>
|
<div class="w-5/12">
|
||||||
<h1 class="mb-4">{{field.title}}</h1>
|
<h3 class="font-normal text-large mb-3">Handlungsfeld</h3>
|
||||||
<p>{{field.description}}</p>
|
<h1 class="mb-4">{{field.title}}</h1>
|
||||||
|
<p>{{field.description}}</p>
|
||||||
|
</div>
|
||||||
|
<img
|
||||||
|
class="w-5/12"
|
||||||
|
:src="field.icon"/>
|
||||||
</div>
|
</div>
|
||||||
<img
|
</template>
|
||||||
class="w-5/12"
|
<template #body>
|
||||||
:src="field.icon"/>
|
<section class="mb-20">
|
||||||
</div>
|
<h2 class="mb-4">Das erwartet dich in diesem Handlungsfeld</h2>
|
||||||
<section class="mb-20">
|
<p class="mb-4 lg:w-2/3">{{field.summary.text}}</p>
|
||||||
<h2 class="mb-4">Das erwartet dich in diesem Handlungsfeld</h2>
|
<ul>
|
||||||
<p class="mb-4 lg:w-2/3">{{field.summary.text}}</p>
|
<li
|
||||||
<ul>
|
v-for="item in field.summary.items"
|
||||||
<li
|
:key="item"
|
||||||
v-for="item in field.summary.items"
|
class="mb-2 h-10 leading-10 flex items-center">
|
||||||
:key="item"
|
<it-icon-check class="text-sky-500 bg-[url('/static/icons/icon-check.svg')] bg-no-repeat h-10 w-10 mr-2"></it-icon-check>
|
||||||
class="mb-2">{{item}}</li>
|
{{item}}
|
||||||
</ul>
|
</li>
|
||||||
</section>
|
</ul>
|
||||||
<section
|
</section>
|
||||||
class="mb-20"
|
<section
|
||||||
v-for="item in field.items" :key="item.title">
|
class="mb-20"
|
||||||
<h2 class="mb-4">{{item.title}}</h2>
|
v-for="item in field.items" :key="item.title">
|
||||||
<ul class="grid gap-4 grid-cols-2">
|
<h2 class="mb-4">{{item.title}}</h2>
|
||||||
<li v-for="subItem in item.items" :key="subItem.link">
|
<ul :class="{
|
||||||
<LinkCard
|
'grid gap-4 grid-cols-2': displayAsCard(item.type),
|
||||||
v-if="item.type === 'learnmedia'"
|
'border-t': !displayAsCard(item.type)
|
||||||
:title="subItem.title"
|
}">
|
||||||
:icon="subItem.iconUrl"
|
<li v-for="subItem in item.items" :key="subItem.link">
|
||||||
:description="subItem.description"
|
<LinkCard
|
||||||
:url="subItem.link"
|
v-if="displayAsCard(item.type)"
|
||||||
:link-text="subItem.linkText" />
|
:title="subItem.title"
|
||||||
</li>
|
:icon="subItem.iconUrl"
|
||||||
</ul>
|
:description="subItem.description"
|
||||||
|
:url="subItem.link"
|
||||||
</section>
|
:link-text="subItem.linkText" />
|
||||||
</div>
|
<div v-else class="flex items-center justify-between border-b py-4">
|
||||||
|
<h4 class="text-bold">{{subItem.title}}</h4>
|
||||||
|
<router-link :to="subItem.link" class="link">{{subItem.linkText}}</router-link>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
</HandlungsfeldLayout>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Teleport to="body">
|
||||||
|
<div class="px-16 fixed top-0 overflow-y-scroll bg-white h-full w-full">
|
||||||
|
<div class="-mx-16 pt-4 pb-24 px-16 mb-20 bg-gray-200">
|
||||||
|
<nav>
|
||||||
|
<a
|
||||||
|
class="block my-9 cursor-pointer flex items-center"
|
||||||
|
@click="router.go(-1)"><it-icon-arrow-left /><span>zurück</span></a>
|
||||||
|
</nav>
|
||||||
|
<slot name="header"></slot>
|
||||||
|
</div>
|
||||||
|
<slot name="body"></slot>
|
||||||
|
</div>
|
||||||
|
</Teleport>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.it-icon-hf {
|
||||||
|
color: blue
|
||||||
|
}
|
||||||
|
.it-icon-hf > * {
|
||||||
|
@apply m-auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as log from 'loglevel';
|
import * as log from 'loglevel';
|
||||||
import OverviewCard from '@/components/mediacenter/OverviewCard.vue';
|
|
||||||
|
|
||||||
log.debug('HandlungsfelderOverview created');
|
log.debug('HandlungsfelderOverview created');
|
||||||
|
|
||||||
|
|
@ -70,10 +69,12 @@ const fields = [
|
||||||
v-for="field in fields"
|
v-for="field in fields"
|
||||||
:key="field.name"
|
:key="field.name"
|
||||||
>
|
>
|
||||||
|
<router-link to="/mediacenter/handlungsfeld">
|
||||||
<img
|
<img
|
||||||
class="m-auto"
|
class="m-auto"
|
||||||
:src="`/static/icons/demo/${field.icon}.svg`"/>
|
:src="`/static/icons/demo/${field.icon}.svg`"/>
|
||||||
<h3 class="text-base text-center">{{field.name}}</h3>
|
<h3 class="text-base text-center">{{field.name}}</h3>
|
||||||
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue