Skip to content

Commit ec944a4

Browse files
author
Felix Ruf
committed
added dates to text on guest event view
1 parent e80d7bf commit ec944a4

File tree

7 files changed

+73
-42
lines changed

7 files changed

+73
-42
lines changed

config/services.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ parameters:
4747
app.secret: '%env(APP_SECRET)%'
4848

4949
mealz.lock_toggle_participation_at: '-1 day 16:00'
50-
mealz.meal.price: 3.60
50+
mealz.meal.price: 4.13
5151
mealz.meal.search_timestamp: '2000-01-01'
5252
mealz.meal.new_flag_counter: 2
53-
mealz.meal.combined.price: 5.60
54-
53+
mealz.meal.combined.price: 6.13
5554
# PDO Session Handler options
5655
# Define table and column names to store session data
5756
app.session.handler.pdo.options:

src/Mealz/MealBundle/DataFixtures/ORM/LoadDishVariations.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function getDishVariation(Dish $dish): DishVariation
7474
$dishVariation->setTitleDe($dish->getTitleDe() . $dummyPrefix);
7575
$dishVariation->setTitleEn($dish->getTitleEn() . $dummyPrefix);
7676
$dishVariation->setParent($dish);
77-
$dishVariation->setPrice(3.60);
77+
$dishVariation->setPrice(4.13);
7878

7979
$variations = $dish->getVariations();
8080
$variations->add($dishVariation);

src/Mealz/MealBundle/DataFixtures/ORM/LoadDishes.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getOrder(): int
7272
protected function addDish(string $titleEN, string $titleDE, string $descEN = null, string $descDE = null, bool $oneSize = false): void
7373
{
7474
$dish = new Dish();
75-
$dish->setPrice(3.60);
75+
$dish->setPrice(4.13);
7676
$dish->setTitleEn($titleEN);
7777
$dish->setTitleDe($titleDE);
7878
$dish->setDescriptionEn('Description - ' . $titleEN);

src/Resources/src/api/getEventInvitionData.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { IMessage } from "@/interfaces/IMessage";
22
import useApi from "./api";
3+
import { DateTime } from "./getDashboardData";
34

45
export interface EventInvitationData {
5-
date: string,
6-
lockDate: string,
6+
date: DateTime,
7+
lockDate: DateTime,
78
event: string
89
}
910

src/Resources/src/locales/de.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@
232232
"description": "Als Gast in unserem Haus laden wir Sie gerne zu einem Mittagessen in der AOE Eatery ein. Für Ihre Bestellung tragen Sie sich bitte bis spätestens einen Tag vorher mit Ihren Daten ein und wählen das gewünschte Gericht aus, das dann an unsere Köche weitergeleitet wird.\n\nGuten Appetit wünscht Ihnen,\nAOE",
233233
"event": {
234234
"submit": "An Event teilnehmen",
235-
"title": "Event bei AOE",
236-
"description": "Hiermit laden wir Sie zu dem Event \"%EventTitle%\" bei uns ein."
235+
"title": "Veranstaltung bei AOE",
236+
"description": "Hiermit laden wir Sie zu der Veranstaltung \"%EventTitle%\" bei uns ein. Damit wir rechtzeitig mit Ihnen planen können tragen Sie sich bitte bis spätestens %lockDate% Uhr für das Event ein.\n\nWir freuen uns auf Sie!"
237237
}
238238
},
239239
"header": {

src/Resources/src/locales/en.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@
231231
"title": "Lunch at AOE",
232232
"description": "As our guest, we would like to invite you to lunch in the AOE Eatery. To order a meal, register no later than one day before your visit to AOE with your personal information and choose the desired dish. Your order will be forwarded to our cooks.\n\nWe hope that you enjoy your lunch\nAOE",
233233
"event": {
234-
"submit": "An Event teilnehmen",
235-
"title": "Event bei AOE",
236-
"description": "Hiermit laden wir Sie zu dem Event \"%EventTitle%\" bei uns ein."
234+
"submit": "Participate",
235+
"title": "Event at AOE",
236+
"description": "We would like to invite you to join us at the Event \"%EventTitle%\". To ensure we can plan ahead with you, please register for the event by %lockDate% at the latest.\n\nWe look forward to having you!"
237237
}
238238
},
239239
"header": {
+61-30
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,54 @@
11
<template>
2-
<h2>
3-
{{ t('guest.event.title') }}
4-
</h2>
5-
<p>
6-
{{ t('guest.event.description').replace('%EventTitle%', invitationData?.event) }}
7-
</p>
8-
<div>
9-
<form
10-
@submit.prevent="handleSubmit()"
11-
>
12-
<InputLabel
13-
v-model="formData.firstname"
14-
:required="true"
15-
:labelText="t('guest.form.firstname')"
16-
/>
17-
<InputLabel
18-
v-model="formData.lastname"
19-
:required="true"
20-
:labelText="t('guest.form.lastname')"
21-
/>
22-
<InputLabel
23-
v-model="formData.company"
24-
:labelText="t('guest.form.company')"
25-
/>
26-
<SubmitButton
27-
:btnText="t('guest.event.submit')"
28-
/>
29-
</form>
2+
<div
3+
v-if="invitationData !== null"
4+
class="mx-[5%] xl:mx-auto"
5+
>
6+
<h2 class="text-center text-primary xl:text-left">
7+
{{ `${t('guest.event.title')} | ${eventDate}` }}
8+
</h2>
9+
<p class="whitespace-pre-line text-[18px] leading-[24px] text-primary-1">
10+
{{ t('guest.event.description').replace('%EventTitle%', invitationData?.event).replace('%lockDate%', lockDate) }}
11+
</p>
12+
<div>
13+
<form
14+
@submit.prevent="handleSubmit()"
15+
>
16+
<InputLabel
17+
v-model="formData.firstname"
18+
:required="true"
19+
:labelText="t('guest.form.firstname')"
20+
/>
21+
<InputLabel
22+
v-model="formData.lastname"
23+
:required="true"
24+
:labelText="t('guest.form.lastname')"
25+
/>
26+
<InputLabel
27+
v-model="formData.company"
28+
:labelText="t('guest.form.company')"
29+
/>
30+
<SubmitButton
31+
:btnText="t('guest.event.submit')"
32+
/>
33+
</form>
34+
</div>
3035
</div>
36+
<LoadingSpinner
37+
v-else
38+
:loaded="invitationData === null"
39+
/>
3140
</template>
3241

3342
<script setup lang="ts">
3443
import getEventInvitationData, { EventInvitationData } from '@/api/getEventInvitionData';
3544
import InputLabel from '@/components/misc/InputLabel.vue';
45+
import LoadingSpinner from '@/components/misc/LoadingSpinner.vue';
3646
import SubmitButton from '@/components/misc/SubmitButton.vue';
3747
import { isMessage } from '@/interfaces/IMessage';
38-
import { onMounted, ref } from 'vue';
48+
import { computed, onMounted, ref } from 'vue';
3949
import { useI18n } from 'vue-i18n';
4050
41-
const { t } = useI18n();
51+
const { t, locale } = useI18n();
4252
4353
const invitationData = ref<EventInvitationData | null>(null);
4454
@@ -60,7 +70,28 @@ onMounted(async () => {
6070
}
6171
});
6272
73+
const eventDate = computed(() => {
74+
if (invitationData.value !== null) {
75+
return getLocaleDateRepr(invitationData.value.date.date);
76+
}
77+
return 'unknown';
78+
});
79+
80+
const lockDate = computed(() => {
81+
if (invitationData.value !== null) {
82+
return getLocaleDateRepr(invitationData.value.lockDate.date, true);
83+
}
84+
return 'unknown';
85+
});
86+
6387
async function handleSubmit() {
6488
console.log('HUHU')
6589
}
90+
91+
function getLocaleDateRepr(date: string, getTime = false) {
92+
if (getTime === true) {
93+
return new Date(date).toLocaleDateString(locale.value, { weekday: 'long', month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit' });
94+
}
95+
return new Date(date).toLocaleDateString(locale.value, { weekday: 'long', month: 'numeric', day: 'numeric' });
96+
}
6697
</script>

0 commit comments

Comments
 (0)