Skip to content

Commit

Permalink
updated dashboard to show both events (not working yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
IrisOlfermann committed Jul 26, 2024
1 parent 3732435 commit 92802be
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
2 changes: 0 additions & 2 deletions src/Resources/src/components/dashboard/Day.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
class="col-start-2 row-start-2 print:hidden"
:day="day"
:dayId="dayID"
:eventId="eventId"
/>
</div>
</template>
Expand Down Expand Up @@ -133,7 +132,6 @@ const day = props.guestData ? props.guestData : dashboardStore.getDay(props.week
const weekday = computed(() => translateWeekday(day.date, locale));
const emptyDay = Object.keys(day.meals).length === 0;
const isEventDay = day.events.EventParticipation !== null;
const eventId = day.events[Object.keys(day.events)[0]][0].eventId;
const date = computed(() => {
if (day === null || day === undefined) {
return '';
Expand Down
64 changes: 33 additions & 31 deletions src/Resources/src/components/dashboard/EventData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,42 @@
:size="20"
/>
</BannerSpacer>
<div class="flex w-full flex-col items-center px-[15px] min-[380px]:flex-row">
<span
class="inline-block grow self-start break-words text-[12px] font-bold leading-[20px] tracking-[0.5px] text-primary-1 max-[380px]:basis-9/12 min-[380px]:self-center min-[380px]:text-note"
>
{{ getEventById(day.events.EventParticipation.eventId)?.title }}
</span>
<div class="flex w-fit flex-row items-center gap-1 self-end justify-self-end max-[380px]:basis-3/12">
<GuestButton
v-if="!day.isLocked && day.events.isPublic"
:dayID="dayId"
:index="0"
:invitation="Invitation.EVENT"
:icon-white="false"
class="col-start-1 w-[24px] text-center"
/>
<EventPopup
:event-title="getEventById(day.events.EventParticipation.eventId)?.title"
:date="day.date.date"
/>
<ParticipationCounter
:limit="0"
:mealCSS="!day.isLocked ? 'bg-primary-4' : 'bg-[#80909F]'"
<div v-for="(event, key) in day.events" :key="key">
<div class="flex w-full flex-col items-center px-[15px] min-[380px]:flex-row">
<span
class="inline-block grow self-start break-words text-[12px] font-bold leading-[20px] tracking-[0.5px] text-primary-1 max-[380px]:basis-9/12 min-[380px]:self-center min-[380px]:text-note"
>
{{ day.events.EventParticipation?.participations }}
</ParticipationCounter>
<CheckBox
:isActive="new Date(day.date.date) > new Date()"
:isChecked="day.events.EventParticipation?.isParticipating ?? false"
@click="handleClick"
/>
{{ getEventById(event.eventId)?.title }}
</span>
<div class="flex w-fit flex-row items-center gap-1 self-end justify-self-end max-[380px]:basis-3/12">
<GuestButton
v-if="!day.isLocked && day.events.isPublic"
:dayID="dayId"
:index="0"
:invitation="Invitation.EVENT"
:icon-white="false"
class="col-start-1 w-[24px] text-center"
/>
<EventPopup
:event-title="getEventById(event.eventId)?.title"
:date="day.date.date"
/>
<ParticipationCounter
:limit="0"
:mealCSS="!day.isLocked ? 'bg-primary-4' : 'bg-[#80909F]'"
>
{{ event?.participations }}
</ParticipationCounter>
<CheckBox
:isActive="new Date(day.date.date) > new Date()"
:isChecked="event?.isParticipating ?? false"
@click="handleClick"
/>
</div>
</div>
<div />
</div>
</div>
<div />
</div>
</template>

<script setup lang="ts">
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/src/components/menu/MenuDay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ import Popover from '../misc/Popover.vue';
import MenuParticipationPanel from './MenuParticipationPanel.vue';
import MenuLockDatePicker from './MenuLockDatePicker.vue';
import EventInput from './EventInput.vue';
import { Event, useEvents } from '@/stores/eventsStore';
import { Event } from '@/stores/eventsStore';
import { DateTime } from '@/api/getDashboardData';
import { Dictionary } from 'types/types';
const { getDishArrayBySlugs, getDishBySlug } = useDishes();
const { locale, t } = useI18n();
const { getEventById } = useEvents();
const props = defineProps<{
modelValue: DayDTO;
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"title": "Titel",
"isPublic": "Öffentliches Event?"
},
"event": "Event"
"event": "Events"
},
"flashMessage": {
"error": {
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"title": "Title",
"isPublic": "Public event?"
},
"event": "Event"
"event": "Events"
},
"flashMessage": {
"error": {
Expand Down

0 comments on commit 92802be

Please sign in to comment.