Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable registration #310

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import react from "@astrojs/react";
import tailwind from "@astrojs/tailwind";
import icon from "astro-icon";
import { defineConfig } from "astro/config";
import { isRegistrationEnabled } from "./src/config";
import { defaultLang, languages } from "./src/i18n/constants";

// https://astro.build/config
Expand All @@ -14,6 +15,7 @@ export default defineConfig({
integrations: [tailwind(), react(), icon()],
site: "https://blz-it.de",
redirects: {
...(isRegistrationEnabled ? {} : { "/de/anmeldung": "/" }),
"/de/skill08": "/mobile-applications-development",
"/de/skill09": "/software-applications-development",
"/it-software-solutions-for-business": "/software-applications-development",
Expand Down
16 changes: 11 additions & 5 deletions src/components/EventCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
title: string;
img: ImageMetadata;
date: string;
link: string;
link?: string;
hoverTextColor?: "black" | "white";
}

Expand All @@ -27,33 +27,39 @@ const hoverTextShadowColor =
<div
class={clsx(
className,
"grid grid-cols-8 grid-rows-11 w-1/2 md:w-3/12 aspect-[18/24]",
"grid grid-cols-8 grid-rows-11 w-1/2 md:w-3/12 aspect-[18/24]"
)}
>
<a
target="_blank"
rel="noopener noreferrer"
href={link}
class="bg-group peer col-start-1 col-end-8 row-start-1 row-end-11 rounded-lg bg-wsg-orange-500 shadow-2xl"
tabindex={link || -1}
class={clsx(
"bg-group peer col-start-1 col-end-8 row-start-1 row-end-11 rounded-lg bg-wsg-orange-500 shadow-2xl",
link || "pointer-events-none"
)}
>
</a>
<a
target="_blank"
rel="noopener noreferrer"
href={link}
tabindex={link || -1}
class={clsx(
"relative rounded-lg shadow-2xl bg-white",
"col-start-2 row-start-2 col-end-9 row-end-12 overflow-hidden",
"group transition-all",
"hover:mt-[-1rem] hover:ml-[-1rem] peer-hover:mt-[-1rem] peer-hover:ml-[-1rem]",
link || "pointer-events-none"
)}
>
<div class="pointer-events-none absolute z-10 w-full px-3 pt-2 text-sm">
<h4
class={clsx(
"card-title peer md:text-lg md:font-bold mt-1 text-left",
"transition-all duration-300",
"group-hover:mt-0 group-hover:text-base group-hover:font-normal",
"group-hover:mt-0 group-hover:text-base group-hover:font-normal"
)}
>
{title}
Expand All @@ -63,7 +69,7 @@ const hoverTextShadowColor =
class={clsx(
"card-date",
"text-center md:text-base text-gray-200 tracking-wider mt-8 sm:mt-4 md:mt-8",
"transition-all group-hover:opacity-0 group-hover:mt-0",
"transition-all group-hover:opacity-0 group-hover:mt-0"
)}
/>
</div>
Expand Down
41 changes: 25 additions & 16 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Image } from "astro:assets";
import { getRelativeLocaleUrl } from "astro:i18n";
import WsgHandsWhiteImage from "~/assets/img/wsg-hands-white.svg";
import { isRegistrationEnabled } from "~/config";
import { getLangFromUrl, getLocalePaths, useTranslations } from "~/i18n/utils";
import { LanguageDropdown } from "./dropdowns/LanguageDropdown";
import { SkillsDropdown } from "./dropdowns/SkillsDropdown";
Expand Down Expand Up @@ -52,14 +53,18 @@ const skills = [
{t({ de: "Startseite", en: "Home" })}
</a>
</div>
<div class="ml-10 hidden space-x-8 lg:block">
<a
href={getRelativeLocaleUrl(lang, "anmeldung")}
class="text-base font-medium text-white hover:text-gray-100"
>
{t({ de: "Anmeldung", en: "Registration" })}
</a>
</div>
{
isRegistrationEnabled && (
<div class="ml-10 hidden space-x-8 lg:block">
<a
href={getRelativeLocaleUrl(lang, "anmeldung")}
class="text-base font-medium text-white hover:text-gray-100"
>
{t({ de: "Anmeldung", en: "Registration" })}
</a>
</div>
)
}
<div class="ml-10 hidden lg:block">
<SkillsDropdown
client:load
Expand Down Expand Up @@ -91,14 +96,18 @@ const skills = [
{t({ de: "Startseite", en: "Home" })}
</a>
</div>
<div class="my-auto ml-10 space-x-8 lg:hidden">
<a
href={getRelativeLocaleUrl(lang, "anmeldung")}
class="text-base font-medium text-white hover:text-gray-100"
>
{t({ de: "Anmeldung", en: "Registration" })}
</a>
</div>
{
isRegistrationEnabled && (
<div class="my-auto ml-10 space-x-8 lg:hidden">
<a
href={getRelativeLocaleUrl(lang, "anmeldung")}
class="text-base font-medium text-white hover:text-gray-100"
>
{t({ de: "Anmeldung", en: "Registration" })}
</a>
</div>
)
}
<SkillsDropdown
client:load
title={t({ de: "Unsere Disziplinen", en: "Our Skills" })}
Expand Down
25 changes: 14 additions & 11 deletions src/components/skill/SkillInformation.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import { getRelativeLocaleUrl } from "astro:i18n";
import { isRegistrationEnabled } from "~/config";
import { getLangFromUrl, useTranslations } from "~/i18n";
import Link from "../Link.astro";
import Headline from "../typography/Headline.astro";
Expand Down Expand Up @@ -33,17 +34,19 @@ const t = useTranslations(lang);
}
</Headline>
<p set:html={requirements} />
<p class="mt-4">
{
t({
de: "Du bist interessiert?",
en: "You are interested?",
})
}
<Link href={getRelativeLocaleUrl(lang, "anmeldung")}>
{t({ de: "Jetzt anmelden!", en: "Register now!" })}
</Link>
</p>
{
isRegistrationEnabled && (
<p class="mt-4">
{t({
de: "Du bist interessiert?",
en: "You are interested?",
})}
<Link href={getRelativeLocaleUrl(lang, "anmeldung")}>
{t({ de: "Jetzt anmelden!", en: "Register now!" })}
</Link>
</p>
)
}
</div>
<div class="mt-20 flex-1 xl:mt-0 xl:pl-12">
<iframe
Expand Down
21 changes: 16 additions & 5 deletions src/components/skill/SkillRoadmap.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GermanChampionshipImage from "~/assets/img/german-championship.webp";
import OnlineCompetitionImage from "~/assets/img/online-competition.webp";
import RegistrationImage from "~/assets/img/registration.webp";
import WsgHandsImage from "~/assets/img/wsg-hands.svg";
import { isRegistrationEnabled } from "~/config";
import { getLangFromUrl, useTranslations } from "~/i18n";
import EventCard from "../EventCard.astro";
import Link from "../Link.astro";
Expand Down Expand Up @@ -43,7 +44,9 @@ const t = useTranslations(lang);
de: "1. November 2024 – 21. Februar 2025",
en: "1 November 2024 – 21 February 2025",
})}
link={getRelativeLocaleUrl(lang, "anmeldung")}
link={isRegistrationEnabled
? getRelativeLocaleUrl(lang, "anmeldung")
: undefined}
className="xl:mt-0"
hoverTextColor="white"
/>
Expand All @@ -54,7 +57,9 @@ const t = useTranslations(lang);
de: "28. Dezember 2024 – 28. Februar 2025",
en: "28 December 2024 – 28 February 2025",
})}
link={getRelativeLocaleUrl(lang, "anmeldung")}
link={isRegistrationEnabled
? getRelativeLocaleUrl(lang, "anmeldung")
: undefined}
className="md:float-right md:mt-[-4rem]"
hoverTextColor="white"
/>
Expand Down Expand Up @@ -86,9 +91,15 @@ const t = useTranslations(lang);

<ol class="list-decimal space-y-4 text-left sm:pt-8 md:pt-16">
<li>
<Link href={getRelativeLocaleUrl(lang, "anmeldung")}>
{t({ de: "Du meldest dich an", en: "You register yourself" })}
</Link>
{
isRegistrationEnabled ? (
<Link href={getRelativeLocaleUrl(lang, "anmeldung")}>
{t({ de: "Du meldest dich an", en: "You register yourself" })}
</Link>
) : (
t({ de: "Du meldest dich an", en: "You register yourself" })
)
}
{
t({
de: "und erhältst vor dem Start des Online-Vorausscheides deine Zugangsdaten.",
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isRegistrationEnabled = false;
25 changes: 15 additions & 10 deletions src/pages/en/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Link from "~/components/Link.astro";
import HeadedSection from "~/components/sections/HeadedSection.astro";
import WavedSection from "~/components/sections/WavedSection.astro";
import SkillCard from "~/components/skill/SkillCard.astro";
import { isRegistrationEnabled } from "~/config";
import { defaultLang, type Language } from "~/i18n";
import Layout from "~/layouts/Layout.astro";

Expand Down Expand Up @@ -82,14 +83,18 @@ const lang = (Astro.currentLocale || defaultLang) as Language;
/>
</div>
</WavedSection>
<WavedSection type="bottom">
<Cta
title="Become part of our national team"
subtitle="Have you always wanted to take part in a software development competition and compete with the best of the best?"
action={{
label: "Register now",
url: getRelativeLocaleUrl(lang, "anmeldung"),
}}
/>
</WavedSection>
{
isRegistrationEnabled && (
<WavedSection type="bottom">
<Cta
title="Become part of our national team"
subtitle="Have you always wanted to take part in a software development competition and compete with the best of the best?"
action={{
label: "Register now",
url: getRelativeLocaleUrl(lang, "anmeldung"),
}}
/>
</WavedSection>
)
}
</Layout>
25 changes: 15 additions & 10 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Link from "~/components/Link.astro";
import HeadedSection from "~/components/sections/HeadedSection.astro";
import WavedSection from "~/components/sections/WavedSection.astro";
import SkillCard from "~/components/skill/SkillCard.astro";
import { isRegistrationEnabled } from "~/config";
import { defaultLang, type Language } from "~/i18n";
import Layout from "~/layouts/Layout.astro";

Expand Down Expand Up @@ -83,14 +84,18 @@ const lang = (Astro.currentLocale || defaultLang) as Language;
/>
</div>
</WavedSection>
<WavedSection type="bottom">
<Cta
title="Werde Teil unseres Nationalteams"
subtitle="Du wolltest schon immer an einem Wettbewerb im Bereich der Softwareentwicklung teilnehmen und dich mit den Besten der Besten messen?"
action={{
label: "Melde dich jetzt an",
url: getRelativeLocaleUrl(lang, "anmeldung"),
}}
/>
</WavedSection>
{
isRegistrationEnabled && (
<WavedSection type="bottom">
<Cta
title="Werde Teil unseres Nationalteams"
subtitle="Du wolltest schon immer an einem Wettbewerb im Bereich der Softwareentwicklung teilnehmen und dich mit den Besten der Besten messen?"
action={{
label: "Melde dich jetzt an",
url: getRelativeLocaleUrl(lang, "anmeldung"),
}}
/>
</WavedSection>
)
}
</Layout>