-
{data.chapters.filter((ch) => ch.acceptsSignups).length}
+
{data.chapters.filter((ch) => ch.status == `active`).length}
{$microcopy?.indexPage?.boxes?.locationsName} {
let chapters = await fetch_chapters()
- chapters = chapters.filter((chap) => chap.acceptsSignups)
+ chapters = chapters.filter((chap) => chap.signup == `everyone`)
const form = parse_form_data({ ...raw_form, ...messages })
diff --git a/src/routes/signup-student/+page.server.ts b/src/routes/signup-student/+page.server.ts
index 15daa211..c7b29a03 100644
--- a/src/routes/signup-student/+page.server.ts
+++ b/src/routes/signup-student/+page.server.ts
@@ -6,7 +6,9 @@ import raw_form from '../../signup-form/de/student.yml'
export const load = async () => {
let chapters = await fetch_chapters()
- chapters = chapters.filter((chap) => chap.acceptsSignups)
+ chapters = chapters.filter(
+ (chap) => chap.signup == `everyone` || chap.signup == `onlyStudents`
+ )
const form = parse_form_data({ ...raw_form, ...messages })
diff --git a/src/routes/standorte/+page.svelte b/src/routes/standorte/+page.svelte
index dae76fc1..a5bd1831 100644
--- a/src/routes/standorte/+page.svelte
+++ b/src/routes/standorte/+page.svelte
@@ -8,6 +8,4 @@
-
- 🤗 Wir brauchen dich! 🤗
-
+
diff --git a/src/routes/standorte/[slug]/+page.server.ts b/src/routes/standorte/[slug]/+page.server.ts
index f278c59a..7a12e9ba 100644
--- a/src/routes/standorte/[slug]/+page.server.ts
+++ b/src/routes/standorte/[slug]/+page.server.ts
@@ -1,12 +1,17 @@
import { fetch_page } from '$lib/fetch'
import { error } from '@sveltejs/kit'
+import { fetch_chapters } from '$lib/fetch'
export const load = async ({ params }) => {
const { slug } = params
const page = await fetch_page(`standorte/${slug}`)
+ const chapters = await fetch_chapters()
+
+ const selectedChapter = chapters.find((ch) => ch.slug == `/standorte/${slug}`)
+
if (!page) throw error(404)
- return { page, slug }
+ return { page, slug, selectedChapter }
}
diff --git a/src/routes/standorte/[slug]/+page.svelte b/src/routes/standorte/[slug]/+page.svelte
index ce2580b0..614bdec6 100644
--- a/src/routes/standorte/[slug]/+page.svelte
+++ b/src/routes/standorte/[slug]/+page.svelte
@@ -4,15 +4,14 @@
import Icon from '@iconify/svelte'
export let data
- $: ({ page, slug } = data)
-
+ $: ({ page, slug, selectedChapter } = data)
const style = `margin-right: 3pt;`
- {#if page?.yaml?.showSignupButtons !== false}
+ when selectedChapter is not defined show all buttons as default -->
+ {#if !selectedChapter?.signup || selectedChapter?.signup == `everyone`}
{$microcopy?.location?.register}
+ {:else if selectedChapter?.signup == `onlyStudents`}
+ {$microcopy?.location?.register}
+
{/if}
- {#if page?.yaml?.showSignupButtons !== false}
+ {#if selectedChapter?.signup !== `nobody`}
{$microcopy?.location?.contact}
{$microcopy?.location?.questions}