Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobifra committed Mar 22, 2024
1 parent 8ff6fe7 commit ed0e4fb
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 37 deletions.
26 changes: 14 additions & 12 deletions frontend/src/components/main/Camp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,29 @@ export default {
},
isSameDay(date1, date2) {
return (
format(new Date(date1), "dd.MM.yyyy") ===
format(new Date(date2), "dd.MM.yyyy")
format(new Date(date1), "dd.MM.yyyy", { locale: de }) ===
format(new Date(date2), "dd.MM.yyyy", { locale: de })
);
},
getDate(camp) {
if (this.isSameDay(camp.startAt, camp.finishAt)) {
return this.formatDate(camp.startAt);
}
if (
format(new Date(camp.startAt), "yyyy") ===
format(new Date(camp.finishAt), "yyyy")
format(new Date(camp.startAt), "yyyy", { locale: de }) ===
format(new Date(camp.finishAt), "yyyy", { locale: de })
) {
return `${format(new Date(camp.startAt), "dd.")} - ${format(
new Date(camp.finishAt),
"dd. MMMM yyyy",
)}`;
return `${format(new Date(camp.startAt), "dd.", {
locale: de,
})} - ${format(new Date(camp.finishAt), "dd. MMMM yyyy", {
locale: de,
})}`;
}
return `${format(new Date(camp.startAt), "dd. MMMM yyyy")} - ${format(
new Date(camp.finishAt),
"dd. MMMM yyyy",
)}`;
return `${format(new Date(camp.startAt), "dd. MMMM yyyy", {
locale: de,
})} - ${format(new Date(camp.finishAt), "dd. MMMM yyyy", {
locale: de,
})}`;
},
beforeEnter(el) {
el.style.height = "0";
Expand Down
14 changes: 9 additions & 5 deletions frontend/src/components/main/FooterGroupLink.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<template>
<router-link
v-if="!group.externalLink"
:to="group.hasPage ? `/group/${group.route}` : '#'"
>{{ group.name }}</router-link
<router-link v-if="group.hasPage" :to="`/group/${group.route}`">{{
group.name
}}</router-link>
<a
v-else-if="group.externalLink"
:href="group.externalLink"
target="_blank"
>{{ group.name }}</a
>
<a v-else :href="group.externalLink" target="_blank">{{ group.name }}</a>
<span v-else>{{ group.name }}</span>
</template>
<script>
export default {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/main/FormItem.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<ContentWrapper>
<form class="space-y-5" @submit.prevent="handleForm">
<form v-if="item.form" class="space-y-5" @submit.prevent="handleForm">
<HeadingTwo class="text-primary">{{ item.form.name }}</HeadingTwo>
<div v-if="submitSuccess" class="p-5 rounded-lg bg-primary">
<HeadingThree class="text-white font-bold">
Expand Down
37 changes: 18 additions & 19 deletions frontend/src/components/main/GroupDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,29 @@
<div class="relative">
<li
@click="showDropdown = !showDropdown"
class="min-w-[130px] flex flex-row space-x-2 items-center font-light p-3 py-5 md:py-0 md:p-0 hover:text-secondary text-white main-text md:text-2xl cursor-pointer"
class="flex flex-row space-x-2 items-center font-light p-3 py-5 md:py-0 md:p-0 hover:text-secondary text-white main-text md:text-2xl cursor-pointer"
>
<div>{{ $t("page.groups") }}</div>
<font-awesome-icon class="" :icon="icons.faCaretDown" />
</li>
<transition @beforeEnter="beforeEnter" @enter="enter" @leave="leave">
<ul
v-if="showDropdown"
class="absolute z-10 bg-primary w-full h-full rounded-lg"
>
<template v-for="group in groups" :key="group.id">
<li
v-if="group.hasPage"
class="font-light p-3 py-5 pl-8 md:py-2 md:p-3 w-full md:px-5 hover:text-secondary text-white main-text md:text-2xl"
>
<router-link
@click="showDropdown = false"
:to="`/group/${group.route}`"
>{{ group.name }}</router-link
<div class="absolute z-10 right-0 w-full md:w-fit">
<transition @beforeEnter="beforeEnter" @enter="enter" @leave="leave">
<ul v-if="showDropdown" class="bg-primary w-full h-full rounded-lg">
<template v-for="group in groups" :key="group.id">
<li
v-if="group.hasPage"
class="font-light p-3 py-5 pl-8 md:py-2 md:p-3 w-full md:px-5 hover:text-secondary text-white main-text md:text-2xl"
>
</li>
</template>
</ul>
</transition>
<router-link
@click="showDropdown = false"
:to="`/group/${group.route}`"
>{{ group.name }}</router-link
>
</li>
</template>
</ul>
</transition>
</div>
</div>
</template>

Expand Down
4 changes: 4 additions & 0 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ const routes = [
name: "Home2",
component: Home,
},
{
path: "/:path/",
redirect: { name: "Home2" },
},
];

const router = createRouter({
Expand Down

0 comments on commit ed0e4fb

Please sign in to comment.