Add member edit layout
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2022-12-02 00:42:06 +01:00
parent 4a31d3349a
commit f03ae5eede
10 changed files with 297 additions and 225 deletions

4
resources/js/app.js vendored
View File

@ -9,6 +9,8 @@ import FTextarea from './components/FTextarea.vue';
import VPages from './components/VPages.vue'; import VPages from './components/VPages.vue';
import VLabel from './components/VLabel.vue'; import VLabel from './components/VLabel.vue';
import VBool from './components/VBool.vue'; import VBool from './components/VBool.vue';
import Box from './components/Box.vue';
import Heading from './components/Heading.vue';
import AppLayout from './layouts/AppLayout.vue'; import AppLayout from './layouts/AppLayout.vue';
import VTooltip from 'v-tooltip'; import VTooltip from 'v-tooltip';
import hasModule from './mixins/hasModule.js'; import hasModule from './mixins/hasModule.js';
@ -23,6 +25,8 @@ Vue.component('SvgSprite', SvgSprite);
Vue.component('VPages', VPages); Vue.component('VPages', VPages);
Vue.component('v-bool', VBool); Vue.component('v-bool', VBool);
Vue.component('v-label', VLabel); Vue.component('v-label', VLabel);
Vue.component('box', Box);
Vue.component('heading', Heading);
const el = document.getElementById('app'); const el = document.getElementById('app');

View File

@ -7,7 +7,7 @@
<heading class="col-span-full" v-if="heading">{{ heading }}</heading> <heading class="col-span-full" v-if="heading">{{ heading }}</heading>
<slot name="in-title"></slot> <slot name="in-title"></slot>
</div> </div>
<main :class="{'mt-3': heading, 'containerClass': true}"> <main :class="{'mt-2': heading, 'containerClass': true}">
<slot></slot> <slot></slot>
</main> </main>
</section> </section>
@ -29,9 +29,5 @@ export default {
}, },
}, },
}, },
components: {
heading: () => import('./Heading'),
},
}; };
</script> </script>

View File

@ -1,11 +1,11 @@
<template> <template>
<label class="flex flex-col relative field-switch cursor-pointer" :for="id" :class="{[`size-${outerSize}`]: true}"> <label class="flex flex-col relative field-switch cursor-pointer" :for="id" :class="sizes[size].wrap">
<span <span
v-if="label" v-if="label"
class="font-semibold leading-none text-gray-400" class="font-semibold leading-none text-gray-400"
:class="{ :class="{
'text-xs': size == 'sm', 'text-xs': size == 'sm',
'text-sm': size === null, 'text-sm': size === 'base',
}" }"
>{{ label }}</span >{{ label }}</span
> >
@ -27,14 +27,14 @@
<span <span
><svg-sprite ><svg-sprite
class="relative text-gray-400 flex-none" class="relative text-gray-400 flex-none"
:class="{'w-2 h-2': size === 'sm' || size == 'xs', 'w-4 h-4': size === null}" :class="{'w-2 h-2': size === 'sm' || size == 'xs', 'w-4 h-4': size === 'base'}"
src="check" src="check"
></svg-sprite ></svg-sprite
></span> ></span>
<span <span
><svg-sprite ><svg-sprite
class="relative text-gray-400 flex-none" class="relative text-gray-400 flex-none"
:class="{'w-2 h-2': size === 'sm' || size == 'xs', 'w-4 h-4': size === null}" :class="{'w-2 h-2': size === 'sm' || size == 'xs', 'w-4 h-4': size === 'base'}"
src="close" src="close"
></svg-sprite ></svg-sprite
></span> ></span>
@ -46,6 +46,24 @@
<script> <script>
export default { export default {
data: function () {
return {
sizes: {
sm: {
wrap: 'field-wrap-sm',
field: 'size-sm',
},
base: {
wrap: 'field-wrap-base',
field: 'size-base',
},
lg: {
wrap: 'field-wrap-lg',
field: 'size-lg',
},
},
};
},
model: { model: {
prop: 'items', prop: 'items',
event: 'input', event: 'input',
@ -56,7 +74,7 @@ export default {
default: false, default: false,
}, },
size: { size: {
default: null, default: 'base',
required: false, required: false,
}, },
id: { id: {

View File

@ -1,36 +1,44 @@
<template> <template>
<div class="p-6 grid gap-6 this-grid grow"> <div class="p-3 grid gap-3 this-grid grow">
<box heading="Stammdaten" class="area-stamm hidden 2xl:block"> <box heading="Stammdaten" class="area-stamm hidden xl:block">
<stamm :inner="inner"></stamm> <stamm :inner="inner"></stamm>
</box> </box>
<box heading="Kontakt" class="area-kontakt hidden 2xl:block"> <box heading="Kontakt" class="area-kontakt hidden xl:block">
<kontakt :inner="inner"></kontakt> <kontakt :inner="inner"></kontakt>
</box> </box>
<box class="area-stammkontakt block 2xl:hidden"> <box class="area-stammkontakt block xl:hidden">
<tabs v-model="tabs.stammkontakt"> <tabs v-model="tabs.stammkontakt">
<stamm v-show="tabs.stammkontakt.active === 'stamm'" :inner="inner"></stamm> <stamm v-show="tabs.stammkontakt.active === 'stamm'" :inner="inner"></stamm>
<kontakt v-show="tabs.stammkontakt.active === 'kontakt'" :inner="inner"></kontakt> <kontakt v-show="tabs.stammkontakt.active === 'kontakt'" :inner="inner"></kontakt>
</tabs> </tabs>
</box> </box>
<box container-class="" heading="Prävention" class="area-praev hidden 2xl:block"> <box container-class="" heading="Prävention" class="area-praev hidden xl:block">
<prae :inner="inner"></prae> <prae :inner="inner"></prae>
</box> </box>
<box heading="System" class="area-system hidden 2xl:block"> <box heading="System" class="area-system hidden xl:block">
<system :inner="inner"></system> <system :inner="inner"></system>
</box> </box>
<box class="area-praesystem block 2xl:hidden"> <box class="area-praesystem block xl:hidden">
<tabs v-model="tabs.praesystem"> <tabs v-model="tabs.praesystem">
<prae v-show="tabs.praesystem.active === 'prae'" :inner="inner"></prae> <prae v-show="tabs.praesystem.active === 'prae'" :inner="inner"></prae>
<system v-show="tabs.praesystem.active === 'system'" :inner="inner"></system> <system v-show="tabs.praesystem.active === 'system'" :inner="inner"></system>
</tabs> </tabs>
</box> </box>
<box heading="Ausbildungen" class="area-courses"> <box class="area-membershipcourse hidden xl:block">
<tabs v-model="tabs.membershipcourse">
<courses v-show="tabs.membershipcourse.active === 'course'" :value="inner.courses"></courses>
<memberships
v-show="tabs.membershipcourse.active === 'membership'"
:value="inner.memberships"
></memberships>
</tabs>
</box>
<box heading="Ausbildungen" class="area-courses xl:hidden">
<courses :value="inner.courses"></courses> <courses :value="inner.courses"></courses>
</box> </box>
<box heading="Mitgliedschaften" class="area-memberships xl:hidden">
<box heading="Mitgliedschaften" class="area-memberships">
<memberships :value="inner.memberships"></memberships> <memberships :value="inner.memberships"></memberships>
</box> </box>
@ -38,7 +46,7 @@
<payments :value="inner.payments"></payments> <payments :value="inner.payments"></payments>
</box> </box>
<box heading="Karte" container-class="grow" class="area-map hidden 2xl:block"> <box heading="Karte" container-class="grow" class="area-map hidden xl:block">
<vmap :inner="inner"></vmap> <vmap :inner="inner"></vmap>
</box> </box>
</div> </div>
@ -64,6 +72,13 @@ export default {
}, },
active: 'system', active: 'system',
}, },
membershipcourse: {
children: {
membership: 'Mitgliedshaften',
course: 'Ausbildungen',
},
active: 'membership',
},
}, },
}; };
}, },
@ -75,7 +90,6 @@ export default {
}, },
components: { components: {
box: () => import(/* webpackChunkName: "member" */ './Box'),
stamm: () => import(/* webpackChunkName: "member" */ './boxes/Stamm'), stamm: () => import(/* webpackChunkName: "member" */ './boxes/Stamm'),
kontakt: () => import(/* webpackChunkName: "member" */ './boxes/Kontakt'), kontakt: () => import(/* webpackChunkName: "member" */ './boxes/Kontakt'),
prae: () => import(/* webpackChunkName: "member" */ './boxes/Prae'), prae: () => import(/* webpackChunkName: "member" */ './boxes/Prae'),
@ -103,11 +117,11 @@ export default {
'payments'; 'payments';
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
@media screen and (min-width: 1536px) { @media screen and (min-width: 1280px) {
.this-grid { .this-grid {
grid-template-areas: grid-template-areas:
'stamm kontakt praev system' 'stamm kontakt praev system'
'courses courses memberships memberships' 'membershipcourse membershipcourse membershipcourse membershipcourse'
'payments payments map map'; 'payments payments map map';
grid-template-columns: max-content max-content max-content 1fr; grid-template-columns: max-content max-content max-content 1fr;
} }
@ -139,4 +153,10 @@ export default {
.area-stammkontakt { .area-stammkontakt {
grid-area: stammkontakt; grid-area: stammkontakt;
} }
.area-membershipcourse {
grid-area: membershipcourse;
}
.area-praesystem {
grid-area: praesystem;
}
</style> </style>

View File

@ -16,197 +16,253 @@
</div> </div>
</popup> </popup>
<!-- ****************************** menu links ******************************* -->
<v-tabs v-model="active" :entries="menu">
<div slot="bottom">
<button type="submit" class="mt-3 btn block w-full btn-primary">Speichern</button>
</div>
</v-tabs>
<!-- ***************************** Hauptbereich ****************************** --> <!-- ***************************** Hauptbereich ****************************** -->
<div class="grow"> <div class="grow grid grid-cols-2 gap-3 p-3">
<div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'Stammdaten'"> <box heading="Stammdaten">
<f-select <div class="grid grid-cols-2 gap-3">
id="gender_id"
name="gender_id"
:options="genders"
v-model="inner.gender_id"
label="Geschlecht"
></f-select>
<f-text id="firstname" v-model="inner.firstname" label="Vorname" required></f-text>
<f-text id="lastname" v-model="inner.lastname" label="Nachname" required></f-text>
<f-text id="address" v-model="inner.address" label="Adresse" required></f-text>
<f-text id="further_address" v-model="inner.further_address" label="Adresszusatz"></f-text>
<f-text id="zip" v-model="inner.zip" label="PLZ" required></f-text>
<f-text id="location" v-model="inner.location" label="Ort" required></f-text>
<f-text type="date" id="birthday" v-model="inner.birthday" label="Geburtsdatum" required></f-text>
<f-select
:options="regions"
name="region_id"
id="region_id"
v-model="inner.region_id"
label="Bundesland"
></f-select>
<f-select
:options="countries"
id="country_id"
v-model="inner.country_id"
label="Land"
name="country_id"
required
></f-select>
<f-select
:options="nationalities"
id="nationality_id"
v-model="inner.nationality_id"
label="Staatsangehörigkeit"
name="nationality_id"
required
></f-select>
<f-text
class="col-span-2"
id="other_country"
v-model="inner.other_country"
label="Andere Staatsangehörigkeit"
></f-text>
<div class="contents" v-if="mode === 'create'">
<h2 class="col-span-full font-semibold text-lg text-white">Erste Gruppierung</h2>
<f-select <f-select
:options="activities" id="gender_id"
id="first_activity_id" name="gender_id"
v-model="inner.first_activity_id" :options="genders"
label="Erste Tätigkeit" v-model="inner.gender_id"
name="first_activity_id" label="Geschlecht"
required size="sm"
></f-select> ></f-select>
<f-select <f-select
v-if="inner.first_activity_id" :options="nationalities"
:options="subactivities[inner.first_activity_id]" id="nationality_id"
id="first_subactivity_id" v-model="inner.nationality_id"
v-model="inner.first_subactivity_id" label="Staatsangehörigkeit"
label="Erste Untertätigkeit" name="nationality_id"
name="first_subactivity_id" size="sm"
required required
></f-select> ></f-select>
<f-text id="firstname" v-model="inner.firstname" size="sm" label="Vorname" required></f-text>
<f-text id="lastname" v-model="inner.lastname" size="sm" label="Nachname" required></f-text>
<f-text id="address" v-model="inner.address" size="sm" label="Adresse" required></f-text>
<f-text
id="further_address"
v-model="inner.further_address"
size="sm"
label="Adresszusatz"
></f-text>
<f-text id="zip" v-model="inner.zip" size="sm" label="PLZ" required></f-text>
<f-text id="location" v-model="inner.location" size="sm" label="Ort" required></f-text>
<f-text
type="date"
id="birthday"
v-model="inner.birthday"
size="sm"
label="Geburtsdatum"
required
></f-text>
<f-select
:options="regions"
name="region_id"
id="region_id"
v-model="inner.region_id"
label="Bundesland"
size="sm"
></f-select>
<f-select
:options="countries"
id="country_id"
v-model="inner.country_id"
label="Land"
name="country_id"
size="sm"
required
></f-select>
<f-text
id="other_country"
v-model="inner.other_country"
label="Andere Staatsangehörigkeit"
size="sm"
></f-text>
</div> </div>
</div> </box>
<div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'Kontakt'"> <box heading="Kontakt">
<f-text id="main_phone" v-model="inner.main_phone" label="Telefon (Eltern)"></f-text> <div class="grid gap-3 grid-cols-2">
<f-text id="mobile_phone" v-model="inner.mobile_phone" label="Handy (Eltern)"></f-text> <f-text id="main_phone" v-model="inner.main_phone" size="sm" label="Telefon (Eltern)"></f-text>
<f-text id="work_phone" v-model="inner.work_phone" label="Tel geschäftlich (Eltern)"></f-text> <f-text id="mobile_phone" v-model="inner.mobile_phone" size="sm" label="Handy (Eltern)"></f-text>
<f-text id="children_phone" v-model="inner.children_phone" label="Telefon (Kind)"></f-text> <f-text
<f-text id="email" v-model="inner.email" label="E-Mail"></f-text> id="work_phone"
<f-text id="email_parents" v-model="inner.email_parents" label="E-Mail eltern"></f-text> v-model="inner.work_phone"
<f-text id="fax" v-model="inner.fax" label="Fax"></f-text> size="sm"
</div> label="Tel geschäftlich (Eltern)"
<div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'System'"> ></f-text>
<f-select <f-text
:options="billKinds" id="children_phone"
id="bill_kind_id" v-model="inner.children_phone"
v-model="inner.bill_kind_id" size="sm"
label="Rechnung versenden über" label="Telefon (Kind)"
name="bill_kind_id" ></f-text>
></f-select> <f-text id="email" v-model="inner.email" size="sm" label="E-Mail"></f-text>
</div> <f-text id="email_parents" v-model="inner.email_parents" size="sm" label="E-Mail eltern"></f-text>
<div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'Prävention'"> <f-text id="fax" v-model="inner.fax" size="sm" label="Fax"></f-text>
<div class="grid grid-cols-[max-content_1fr] col-span-2 gap-3"> <f-textarea
<f-switch id="has_efz" v-model="hasEfz" label="Führungszeugnis eingesehen"></f-switch> class="col-span-2"
<div> rows="3"
<f-text id="letter_address"
v-if="inner.efz !== null" v-model="inner.letter_address"
type="date" label="Brief-Adresse"
id="efz" size="sm"
v-model="inner.efz" ></f-textarea>
label="Führungszeugnis eingesehen am" </div>
></f-text> </box>
</div> <box heading="System">
<f-switch id="has_ps" v-model="hasPs" label="Hat Präventionsschulung"></f-switch> <div class="grid gap-3">
<div> <f-select
<f-text :options="billKinds"
v-if="inner.ps_at !== null" id="bill_kind_id"
type="date" v-model="inner.bill_kind_id"
id="ps_at" label="Rechnung versenden über"
v-model="inner.ps_at" name="bill_kind_id"
label="Präventionsschulung am" size="sm"
></f-text> ></f-select>
</div> <f-select
<f-switch id="has_more_ps" v-model="hasMorePs" label="Hat Vertierungsschulung"></f-switch> :options="subscriptions"
<div> id="subscription_id"
<f-text v-model="inner.subscription_id"
v-if="inner.more_ps_at !== null" label="Beitrag"
type="date" name="subscription_id"
id="more_ps_at" size="sm"
v-model="inner.more_ps_at" ></f-select>
label="Vertiefungsschulung am" <f-switch id="has_nami" size="sm" v-model="inner.has_nami" label="In Nami eintragen"></f-switch>
></f-text>
</div>
<f-switch <f-switch
id="has_without_education" id="send_newspaper"
v-model="hasWithoutEducation" v-model="inner.send_newspaper"
label="Einsatz ohne Schulung" label="Mittendrin versenden"
size="sm"
></f-switch> ></f-switch>
<div> <f-text
<f-text class="col-span-2"
v-if="inner.without_education_at !== null" type="date"
type="date" id="joined_at"
id="without_education_at" v-model="inner.joined_at"
v-model="inner.without_education_at" label="Eintrittsdatum"
label="Einsatz ohne Schulung am" size="sm"
></f-text> ></f-text>
</div> <div class="contents" v-if="mode === 'create'">
<f-switch id="has_without_efz" v-model="hasWithoutEfz" label="Einsatz ohne EFZ"></f-switch> <f-select
<div> :options="activities"
<f-text id="first_activity_id"
v-if="inner.without_efz_at !== null" v-model="inner.first_activity_id"
type="date" label="Erste Tätigkeit"
id="without_efz_at" name="first_activity_id"
v-model="inner.without_efz_at" size="sm"
label="Einsatz ohne EFZ am" required
></f-text> ></f-select>
<f-select
v-if="inner.first_activity_id"
:options="subactivities[inner.first_activity_id]"
id="first_subactivity_id"
v-model="inner.first_subactivity_id"
label="Erste Untertätigkeit"
name="first_subactivity_id"
size="sm"
required
></f-select>
</div> </div>
</div> </div>
<div class="flex col-span-full space-x-3"> </box>
<f-switch id="has_svk" v-model="inner.has_svk" label="SVK unterschrieben"></f-switch> <box heading="Prävention">
<f-switch id="has_vk" v-model="inner.has_vk" label="Verhaltenskodex unterschrieben"></f-switch> <div class="grid grid-cols-[max-content_1fr] gap-2">
<f-switch <div class="grid grid-cols-[max-content_1fr] gap-1">
id="multiply_pv" <f-switch id="has_efz" v-model="hasEfz" size="sm" label="Führungszeugnis eingesehen"></f-switch>
v-model="inner.multiply_pv" <div>
label="Multiplikator*in Präventionsschulung" <f-text
></f-switch> v-if="inner.efz !== null"
<f-switch type="date"
id="multiply_more_pv" id="efz"
v-model="inner.multiply_more_pv" v-model="inner.efz"
label="Multiplikator*in Vertierungsschulung" label="am"
></f-switch> size="sm"
></f-text>
</div>
<f-switch id="has_ps" v-model="hasPs" size="sm" label="Hat Präventionsschulung"></f-switch>
<div>
<f-text
v-if="inner.ps_at !== null"
type="date"
id="ps_at"
v-model="inner.ps_at"
label="am"
size="sm"
></f-text>
</div>
<f-switch
id="has_more_ps"
v-model="hasMorePs"
size="sm"
label="Hat Vertierungsschulung"
></f-switch>
<div>
<f-text
v-if="inner.more_ps_at !== null"
type="date"
id="more_ps_at"
v-model="inner.more_ps_at"
label="am"
size="sm"
></f-text>
</div>
<f-switch
id="has_without_education"
v-model="hasWithoutEducation"
label="Einsatz ohne Schulung"
size="sm"
></f-switch>
<div>
<f-text
v-if="inner.without_education_at !== null"
type="date"
id="without_education_at"
v-model="inner.without_education_at"
label="am"
size="sm"
></f-text>
</div>
<f-switch
id="has_without_efz"
size="sm"
v-model="hasWithoutEfz"
label="Einsatz ohne EFZ"
></f-switch>
<div>
<f-text
v-if="inner.without_efz_at !== null"
type="date"
id="without_efz_at"
v-model="inner.without_efz_at"
label="am"
size="sm"
></f-text>
</div>
</div>
<div class="grid gap-1">
<f-switch id="has_svk" size="sm" v-model="inner.has_svk" label="SVK unterschrieben"></f-switch>
<f-switch
id="has_vk"
size="sm"
v-model="inner.has_vk"
label="Verhaltenskodex unterschrieben"
></f-switch>
<f-switch
id="multiply_pv"
v-model="inner.multiply_pv"
label="Multiplikator*in Präventionsschulung"
size="sm"
></f-switch>
<f-switch
id="multiply_more_pv"
v-model="inner.multiply_more_pv"
label="Multiplikator*in Vertierungsschulung"
size="sm"
></f-switch>
</div>
</div> </div>
</div> </box>
<div class="grid grid-cols-4 gap-3 p-4" v-show="menuTitle == 'Verwaltung'">
<f-switch id="has_nami" v-model="inner.has_nami" label="In Nami eintragen"></f-switch>
<f-switch id="send_newspaper" v-model="inner.send_newspaper" label="Mittendrin versenden"></f-switch>
<f-text
class="col-span-2"
type="date"
id="joined_at"
v-model="inner.joined_at"
label="Eintrittsdatum"
></f-text>
<f-select
class="col-span-2"
:options="subscriptions"
id="subscription_id"
v-model="inner.subscription_id"
label="Beitrag"
name="subscription_id"
></f-select>
<f-textarea
class="col-span-2"
rows="4"
id="letter_address"
v-model="inner.letter_address"
label="Brief-Adresse"
></f-textarea>
</div>
</div> </div>
</form> </form>
</template> </template>
@ -228,13 +284,6 @@ export default {
return { return {
inner: {}, inner: {},
active: 0, active: 0,
menu: [
{id: 'stammdaten', title: 'Stammdaten'},
{id: 'kontakt', title: 'Kontakt'},
{id: 'praevention', title: 'Prävention'},
{id: 'system', title: 'System'},
{id: 'verwaltung', title: 'Verwaltung'},
],
}; };
}, },
@ -271,9 +320,6 @@ export default {
}, },
computed: { computed: {
menuTitle() {
return this.menu[this.active].title;
},
hasEfz: issetComputed('efz'), hasEfz: issetComputed('efz'),
hasPs: issetComputed('ps_at'), hasPs: issetComputed('ps_at'),
hasMorePs: issetComputed('more_ps_at'), hasMorePs: issetComputed('more_ps_at'),

View File

@ -165,7 +165,6 @@ export default {
MemberCourses, MemberCourses,
'age-groups': () => import(/* webpackChunkName: "member" */ './AgeGroups'), 'age-groups': () => import(/* webpackChunkName: "member" */ './AgeGroups'),
'tags': () => import(/* webpackChunkName: "member" */ './Tags'), 'tags': () => import(/* webpackChunkName: "member" */ './Tags'),
'box': () => import(/* webpackChunkName: "member" */ './Box'),
}, },
methods: { methods: {

View File

@ -44,9 +44,6 @@ export default {
inner: [], inner: [],
}; };
}, },
components: {
box: () => import(/* webpackChunkName: "member" */ '../Box'),
},
props: { props: {
value: {}, value: {},
}, },

View File

@ -44,10 +44,6 @@ export default {
value: {}, value: {},
}, },
components: {
box: () => import(/* webpackChunkName: "member" */ '../Box'),
},
created() { created() {
this.inner = this.value; this.inner = this.value;
}, },

View File

@ -37,10 +37,6 @@ export default {
value: {}, value: {},
}, },
components: {
box: () => import(/* webpackChunkName: "member" */ '../Box'),
},
created() { created() {
this.inner = this.value; this.inner = this.value;
}, },