Add mobile tables to member detail page
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2022-11-29 21:38:55 +01:00
parent 4850f4ef5a
commit 5a97d0c84d
5 changed files with 119 additions and 28 deletions

View File

@ -1,5 +1,8 @@
<template> <template>
<section class="bg-gray-800 p-3 rounded-lg flex flex-col"> <section
class="p-3 rounded-lg flex flex-col"
:class="{'bg-gray-800': second === false, 'bg-gray-700': second === true}"
>
<div class="flex items-center"> <div class="flex items-center">
<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>
@ -16,6 +19,10 @@ export default {
heading: { heading: {
type: String, type: String,
}, },
second: {
type: Boolean,
default: false,
},
containerClass: { containerClass: {
default: function () { default: function () {
return ''; return '';

View File

@ -26,16 +26,16 @@
</tabs> </tabs>
</box> </box>
<box heading="Ausbildungen" class="area-courses hidden 2xl:block"> <box heading="Ausbildungen" class="area-courses">
<courses :inner="inner"></courses> <courses :value="inner.courses"></courses>
</box> </box>
<box heading="Mitgliedschaften" class="area-memberships hidden 2xl:block"> <box heading="Mitgliedschaften" class="area-memberships">
<memberships :inner="inner"></memberships> <memberships :value="inner.memberships"></memberships>
</box> </box>
<box heading="Zahlungen" class="area-payments hidden 2xl:block"> <box heading="Zahlungen" class="area-payments">
<payments :inner="inner"></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 2xl:block">
@ -97,7 +97,10 @@ export default {
.this-grid { .this-grid {
grid-template-areas: grid-template-areas:
'stammkontakt' 'stammkontakt'
'praesystem'; 'praesystem'
'courses'
'memberships'
'payments';
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
@media screen and (min-width: 1536px) { @media screen and (min-width: 1536px) {

View File

@ -4,8 +4,8 @@
cellspacing="0" cellspacing="0"
cellpadding="0" cellpadding="0"
border="0" border="0"
class="custom-table overflow-auto custom-table-sm text-sm" class="hidden md:table custom-table overflow-auto custom-table-sm text-sm"
v-if="inner.courses.length" v-if="inner.length"
> >
<thead> <thead>
<th>Datum</th> <th>Datum</th>
@ -13,7 +13,7 @@
<th>Veranstaltung</th> <th>Veranstaltung</th>
<th>Organisator</th> <th>Organisator</th>
</thead> </thead>
<tr v-for="(course, index) in inner.courses" :key="index"> <tr v-for="(course, index) in inner" :key="index">
<td v-text="course.completed_at_human"></td> <td v-text="course.completed_at_human"></td>
<td v-text="course.course.short_name"></td> <td v-text="course.course.short_name"></td>
<td v-text="course.event_name"></td> <td v-text="course.event_name"></td>
@ -21,13 +21,37 @@
</tr> </tr>
</table> </table>
<div class="py-3 text-gray-400 text-center" v-else>Keine Ausbildungen vorhanden</div> <div class="py-3 text-gray-400 text-center" v-else>Keine Ausbildungen vorhanden</div>
<div class="md:hidden grid gap-3">
<box
class="relative"
:heading="course.course.short_name"
v-for="(course, index) in inner"
:key="index"
second
>
<div class="text-xs text-gray-200" v-text="course.event_name"></div>
<div class="text-xs text-gray-200" v-text="course.completed_at_human"></div>
<div class="text-xs text-gray-200" v-text="course.organizer"></div>
</box>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data: function () {
return {
inner: [],
};
},
components: {
box: () => import(/* webpackChunkName: "member" */ '../Box'),
},
props: { props: {
inner: {}, value: {},
},
created() {
this.inner = this.value;
}, },
}; };
</script> </script>

View File

@ -1,24 +1,55 @@
<template> <template>
<div> <div>
<table cellspacing="0" cellpadding="0" border="0" class="custom-table overflow-auto custom-table-sm text-sm"> <table
cellspacing="0"
cellpadding="0"
border="0"
class="hidden md:table custom-table overflow-auto custom-table-sm text-sm"
>
<thead> <thead>
<th>Tätigkeit</th> <th>Tätigkeit</th>
<th>Untertätigkeit</th> <th>Untertätigkeit</th>
<th>Datum</th> <th>Datum</th>
</thead> </thead>
<tr v-for="(membership, index) in inner.memberships" :key="index"> <tr v-for="(membership, index) in inner" :key="index">
<td v-text="membership.activity_name"></td> <td v-text="membership.activity_name"></td>
<td v-text="membership.subactivity_name"></td> <td v-text="membership.subactivity_name"></td>
<td v-text="membership.human_date"></td> <td v-text="membership.human_date"></td>
</tr> </tr>
</table> </table>
<div class="md:hidden grid gap-3">
<box
class="relative"
:heading="membership.activity_name"
v-for="(membership, index) in inner"
:key="index"
second
>
<div class="text-xs text-gray-200" v-text="membership.subactivity_name"></div>
<div class="text-xs text-gray-200" v-text="membership.human_date"></div>
</box>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data: function () {
return {
inner: [],
};
},
props: { props: {
inner: {}, value: {},
},
components: {
box: () => import(/* webpackChunkName: "member" */ '../Box'),
},
created() {
this.inner = this.value;
}, },
}; };
</script> </script>

View File

@ -1,22 +1,48 @@
<template> <template>
<table cellspacing="0" cellpadding="0" border="0" class="custom-table custom-table-sm text-sm"> <div>
<thead> <table cellspacing="0" cellpadding="0" border="0" class="hidden md:table custom-table custom-table-sm text-sm">
<th>Tätigkeit</th> <thead>
<th>Untertätigkeit</th> <th>Nr</th>
<th>Datum</th> <th>Beitrag</th>
</thead> <th>Status</th>
<tr v-for="(membership, index) in inner.memberships" :key="index"> </thead>
<td v-text="membership.activity_name"></td> <tr v-for="(payment, index) in inner" :key="index">
<td v-text="membership.subactivity_name"></td> <td v-text="payment.nr"></td>
<td v-text="membership.human_date"></td> <td v-text="`${payment.subscription.name} (${payment.subscription.amount_human})`"></td>
</tr> <td v-text="payment.status_name"></td>
</table> </tr>
</table>
<div class="md:hidden grid gap-3">
<box class="relative" :heading="payment.nr" v-for="(payment, index) in inner" :key="index" second>
<div
class="text-xs text-gray-200"
v-text="`${payment.subscription.name} (${payment.subscription.amount_human})`"
></div>
<div class="text-xs text-gray-200" v-text="payment.status_name"></div>
</box>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
data: function () {
return {
inner: [],
};
},
props: { props: {
inner: {}, value: {},
},
components: {
box: () => import(/* webpackChunkName: "member" */ '../Box'),
},
created() {
this.inner = this.value;
}, },
}; };
</script> </script>