From 288ba091155a88d77325646d63e3704998371ced Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 24 Mar 2023 19:07:57 +0100 Subject: [PATCH 01/11] deactivates the pupil signup for selected chapters --- src/lib/fetch.ts | 1 + src/lib/types.ts | 3 +- src/routes/signup-pupil/+page.server.ts | 1 + src/routes/standorte/[slug]/+page.svelte | 51 +++++++++++++++++++++++- 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 007c39a5..7faae917 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -68,6 +68,7 @@ const chapters_query = `{ } baseId acceptsSignups + deactivatePupils token } } diff --git a/src/lib/types.ts b/src/lib/types.ts index 9ef55688..3f1aaadf 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -7,6 +7,7 @@ export type Chapter = { } baseId: string acceptsSignups: boolean + deactivatePupils: boolean token: string } @@ -62,7 +63,7 @@ export const BlogTags = [ `Auszeichnung`, ] as const // use const assertion to turn BlogTags into readonly tuple -export type BlogTag = (typeof BlogTags)[number] +export type BlogTag = typeof BlogTags[number] export type Post = Page & { author: Author diff --git a/src/routes/signup-pupil/+page.server.ts b/src/routes/signup-pupil/+page.server.ts index 859da66f..0cd01cdf 100644 --- a/src/routes/signup-pupil/+page.server.ts +++ b/src/routes/signup-pupil/+page.server.ts @@ -10,6 +10,7 @@ import raw_form from '../../signup-form/de/pupil.yml' export const load: PageServerLoad = async () => { let chapters = await fetch_chapters() chapters = chapters.filter((chap) => chap.acceptsSignups) + chapters = chapters.filter((chap) => !chap.deactivatePupils) const form = parse_form_data({ ...raw_form, ...messages }) diff --git a/src/routes/standorte/[slug]/+page.svelte b/src/routes/standorte/[slug]/+page.svelte index 33c21aef..0ffe45ce 100644 --- a/src/routes/standorte/[slug]/+page.svelte +++ b/src/routes/standorte/[slug]/+page.svelte @@ -13,7 +13,7 @@ - {#if page?.yaml?.showSignupButtons !== false} + {#if page?.yaml?.showSignupButtons !== false && page?.yaml?.allowPupils !== false}

{$microcopy?.location?.register}

@@ -61,8 +61,57 @@ >
+ {:else if page?.yaml?.allowPupils == false} +

{$microcopy?.location?.register}

+
+ + {$microcopy?.location?.joinStudent} + + {$microcopy?.location + ?.registerStudent} + + + {$microcopy?.location?.infoStudentButton} + + + + {$microcopy?.location?.joinPupil} + + {$microcopy?.location + ?.declinePupil} + + + {$microcopy?.location?.infoPupilButton} + + + {$microcopy?.location?.locationManagement} + + {$microcopy?.location?.writeMailButton} + + + {$microcopy?.location?.infoLeadingButton} + +
{/if} + {#if page?.yaml?.showSignupButtons !== false}

{$microcopy?.location?.contact}

From f880486fea0f66152978eb700229f7420d06da0d Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 24 Mar 2023 20:22:03 +0100 Subject: [PATCH 02/11] adds partner organizations to map and list --- src/lib/ChapterList.svelte | 14 +++++++++++++- src/lib/ChapterMap.svelte | 12 +++++++++++- src/lib/fetch.ts | 1 + src/lib/types.ts | 3 ++- src/routes/+layout.ts | 5 ++++- src/signup-form/de/smallTexts.yml | 1 + 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/lib/ChapterList.svelte b/src/lib/ChapterList.svelte index 8f4d42f5..4fb52da3 100644 --- a/src/lib/ChapterList.svelte +++ b/src/lib/ChapterList.svelte @@ -6,7 +6,8 @@ export let chapters: Chapter[] const openChapters = chapters.filter((ch) => ch.acceptsSignups) - const startingChapters = chapters.filter((ch) => !ch.acceptsSignups) + const startingChapters = chapters.filter((ch) => !ch.acceptsSignups && !ch.partnerAssociation) + const partnerChapters = chapters.filter((ch) => ch.partnerAssociation)

@@ -29,6 +30,17 @@ {/each} {/if} +{#if partnerChapters.length > 2} +

+ + {$microcopy?.chapterList?.partner} +

+
    + {#each partnerChapters as { title, slug }} +
  1. {title}
  2. + {/each} +
+{/if} diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 007c39a5..8af65988 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -68,6 +68,7 @@ const chapters_query = `{ } baseId acceptsSignups + partnerAssociation token } } diff --git a/src/lib/types.ts b/src/lib/types.ts index 9ef55688..d26cb50f 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -7,6 +7,7 @@ export type Chapter = { } baseId: string acceptsSignups: boolean + partnerAssociation: boolean token: string } @@ -62,7 +63,7 @@ export const BlogTags = [ `Auszeichnung`, ] as const // use const assertion to turn BlogTags into readonly tuple -export type BlogTag = (typeof BlogTags)[number] +export type BlogTag = typeof BlogTags[number] export type Post = Page & { author: Author diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 8109b6b5..b85ea6bd 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -7,13 +7,16 @@ export const load: LayoutLoad = async () => { const nav = await fetch_yaml(`Nav`) const footer = await fetch_yaml(`Footer`) const social = await fetch_yaml(`Social`) - const chapters = await fetch_chapters() + var chapters = await fetch_chapters() const smallTexts = await fetch_yaml(`smallTexts`) microcopy.set(smallTexts) // ensure the non-chapter link spans all chapter subnav columns nav.find((el: NavLink) => el.url === `/standorte`).subNav[0].spanCols = true + // filter out partner organizations from the menu + chapters = chapters.filter((chap) => !chap.partnerAssociation) + // create { title, url } array containing all chapters const chapterLinks = chapters.map((chapter: Chapter) => { const { title, slug, acceptsSignups } = chapter diff --git a/src/signup-form/de/smallTexts.yml b/src/signup-form/de/smallTexts.yml index 4969c41d..a12e78e3 100644 --- a/src/signup-form/de/smallTexts.yml +++ b/src/signup-form/de/smallTexts.yml @@ -46,6 +46,7 @@ location: linkStudentInfo: '/mitmachen/nachhilfelehrer' infoStudentButton: 'Infos für Studierende' joinPupil: 'Suchst du Nachhilfe?' + declinePupil: 'Leider ist die Warteliste voll' registerPupil: 'Als Schüler:in anmelden' linkPupilInfo: '/mitmachen/schueler' infoPupilButton: 'Infos für Schüler:innen' From 8b82776f3824fcca531fe95b98a76744935e65fa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 19:24:41 +0000 Subject: [PATCH 03/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/lib/types.ts | 2 +- src/routes/standorte/[slug]/+page.svelte | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/types.ts b/src/lib/types.ts index 3f1aaadf..0d81ddd1 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -63,7 +63,7 @@ export const BlogTags = [ `Auszeichnung`, ] as const // use const assertion to turn BlogTags into readonly tuple -export type BlogTag = typeof BlogTags[number] +export type BlogTag = (typeof BlogTags)[number] export type Post = Page & { author: Author diff --git a/src/routes/standorte/[slug]/+page.svelte b/src/routes/standorte/[slug]/+page.svelte index 0ffe45ce..93b8e10c 100644 --- a/src/routes/standorte/[slug]/+page.svelte +++ b/src/routes/standorte/[slug]/+page.svelte @@ -111,7 +111,6 @@ {/if} - {#if page?.yaml?.showSignupButtons !== false}

{$microcopy?.location?.contact}

From 244d6f22620098702a3dabfe5cfb04993b2c8ee7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 19:26:36 +0000 Subject: [PATCH 04/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/lib/ChapterList.svelte | 4 +++- src/lib/ChapterMap.svelte | 5 ++++- src/lib/types.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/ChapterList.svelte b/src/lib/ChapterList.svelte index 4fb52da3..e9b0b6bc 100644 --- a/src/lib/ChapterList.svelte +++ b/src/lib/ChapterList.svelte @@ -6,7 +6,9 @@ export let chapters: Chapter[] const openChapters = chapters.filter((ch) => ch.acceptsSignups) - const startingChapters = chapters.filter((ch) => !ch.acceptsSignups && !ch.partnerAssociation) + const startingChapters = chapters.filter( + (ch) => !ch.acceptsSignups && !ch.partnerAssociation + ) const partnerChapters = chapters.filter((ch) => ch.partnerAssociation) diff --git a/src/lib/ChapterMap.svelte b/src/lib/ChapterMap.svelte index db9c8200..81d37810 100644 --- a/src/lib/ChapterMap.svelte +++ b/src/lib/ChapterMap.svelte @@ -19,7 +19,10 @@ ({ ...chap.coords, // contains { lng, lat } - classes: [`chapter`, chap.acceptsSignups ? `active` : chap.partnerAssociation? 'partner': `starting`], + classes: [ + `chapter`, + chap.acceptsSignups ? `active` : chap.partnerAssociation ? 'partner' : `starting`, + ], title: chap.token, url: chap.slug, }))} diff --git a/src/lib/types.ts b/src/lib/types.ts index d26cb50f..ab0de409 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -63,7 +63,7 @@ export const BlogTags = [ `Auszeichnung`, ] as const // use const assertion to turn BlogTags into readonly tuple -export type BlogTag = typeof BlogTags[number] +export type BlogTag = (typeof BlogTags)[number] export type Post = Page & { author: Author From 68711e983d7accbce887c2090a491245199b6b42 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 24 Mar 2023 13:23:44 -0700 Subject: [PATCH 05/11] refactor src/routes/+layout.ts --- src/app.css | 2 +- src/lib/ChapterMap.svelte | 2 +- src/routes/+layout.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app.css b/src/app.css index 37371dfc..406273b8 100644 --- a/src/app.css +++ b/src/app.css @@ -34,7 +34,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif; line-height: 1.5; /* https://modern-fluid-typography.vercel.app */ - font-size: clamp(1rem, 0.5vw + 1rem, 1.4rem); + font-size: clamp(1rem, 0.5vw + 1rem, 1.2rem); transition: 0.3s; background: var(--body-bg); color: var(--text-color); diff --git a/src/lib/ChapterMap.svelte b/src/lib/ChapterMap.svelte index 81d37810..a864e58d 100644 --- a/src/lib/ChapterMap.svelte +++ b/src/lib/ChapterMap.svelte @@ -21,7 +21,7 @@ ...chap.coords, // contains { lng, lat } classes: [ `chapter`, - chap.acceptsSignups ? `active` : chap.partnerAssociation ? 'partner' : `starting`, + chap.acceptsSignups ? `active` : chap.partnerAssociation ? `partner` : `starting`, ], title: chap.token, url: chap.slug, diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index b85ea6bd..a2147e86 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -7,16 +7,16 @@ export const load: LayoutLoad = async () => { const nav = await fetch_yaml(`Nav`) const footer = await fetch_yaml(`Footer`) const social = await fetch_yaml(`Social`) - var chapters = await fetch_chapters() + // don't show partner orgs in nav + const chapters = (await fetch_chapters()).filter( + (chap) => !chap.partnerAssociation + ) const smallTexts = await fetch_yaml(`smallTexts`) microcopy.set(smallTexts) // ensure the non-chapter link spans all chapter subnav columns nav.find((el: NavLink) => el.url === `/standorte`).subNav[0].spanCols = true - // filter out partner organizations from the menu - chapters = chapters.filter((chap) => !chap.partnerAssociation) - // create { title, url } array containing all chapters const chapterLinks = chapters.map((chapter: Chapter) => { const { title, slug, acceptsSignups } = chapter From 8caa1ed5b8514c1f69f3a704fd1e0494c2987c74 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 7 Jun 2023 23:48:14 +0200 Subject: [PATCH 06/11] uses single select status instead of boolean values --- src/lib/ChapterList.svelte | 6 ++---- src/lib/ChapterMap.svelte | 2 +- src/lib/fetch.ts | 2 +- src/lib/types.ts | 2 +- src/routes/+layout.ts | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/ChapterList.svelte b/src/lib/ChapterList.svelte index e9b0b6bc..9a3f27b2 100644 --- a/src/lib/ChapterList.svelte +++ b/src/lib/ChapterList.svelte @@ -6,10 +6,8 @@ export let chapters: Chapter[] const openChapters = chapters.filter((ch) => ch.acceptsSignups) - const startingChapters = chapters.filter( - (ch) => !ch.acceptsSignups && !ch.partnerAssociation - ) - const partnerChapters = chapters.filter((ch) => ch.partnerAssociation) + const startingChapters = chapters.filter((ch) => ch.status == 'starting') + const partnerChapters = chapters.filter((ch) => ch.status == 'partner')

diff --git a/src/lib/ChapterMap.svelte b/src/lib/ChapterMap.svelte index a864e58d..b81fcee7 100644 --- a/src/lib/ChapterMap.svelte +++ b/src/lib/ChapterMap.svelte @@ -21,7 +21,7 @@ ...chap.coords, // contains { lng, lat } classes: [ `chapter`, - chap.acceptsSignups ? `active` : chap.partnerAssociation ? `partner` : `starting`, + chap.status, ], title: chap.token, url: chap.slug, diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 8af65988..2878d001 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -68,7 +68,7 @@ const chapters_query = `{ } baseId acceptsSignups - partnerAssociation + status token } } diff --git a/src/lib/types.ts b/src/lib/types.ts index ab0de409..dcb1e186 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -7,7 +7,7 @@ export type Chapter = { } baseId: string acceptsSignups: boolean - partnerAssociation: boolean + status: 'active' | 'starting' | 'partner' | null token: string } diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 8e5dbd47..20c87690 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -8,7 +8,7 @@ export const load = async () => { const social = await fetch_yaml(`Social`) // don't show partner orgs in nav const chapters = (await fetch_chapters()).filter( - (chap) => !chap.partnerAssociation + (chap) => chap.status != 'partner' ) const smallTexts = await fetch_yaml(`smallTexts`) microcopy.set(smallTexts) From 29af13467b56828692265913c9e9203810f4238d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 21:48:40 +0000 Subject: [PATCH 07/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/lib/ChapterList.svelte | 4 ++-- src/lib/ChapterMap.svelte | 5 +---- src/routes/+layout.ts | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib/ChapterList.svelte b/src/lib/ChapterList.svelte index 9a3f27b2..5cb498e1 100644 --- a/src/lib/ChapterList.svelte +++ b/src/lib/ChapterList.svelte @@ -6,8 +6,8 @@ export let chapters: Chapter[] const openChapters = chapters.filter((ch) => ch.acceptsSignups) - const startingChapters = chapters.filter((ch) => ch.status == 'starting') - const partnerChapters = chapters.filter((ch) => ch.status == 'partner') + const startingChapters = chapters.filter((ch) => ch.status == `starting`) + const partnerChapters = chapters.filter((ch) => ch.status == `partner`)

diff --git a/src/lib/ChapterMap.svelte b/src/lib/ChapterMap.svelte index b81fcee7..08fa83fd 100644 --- a/src/lib/ChapterMap.svelte +++ b/src/lib/ChapterMap.svelte @@ -19,10 +19,7 @@ ({ ...chap.coords, // contains { lng, lat } - classes: [ - `chapter`, - chap.status, - ], + classes: [`chapter`, chap.status], title: chap.token, url: chap.slug, }))} diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 20c87690..76d75e7c 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -8,7 +8,7 @@ export const load = async () => { const social = await fetch_yaml(`Social`) // don't show partner orgs in nav const chapters = (await fetch_chapters()).filter( - (chap) => chap.status != 'partner' + (chap) => chap.status != `partner` ) const smallTexts = await fetch_yaml(`smallTexts`) microcopy.set(smallTexts) From 2731f79c73a0ef1d2f770053f16d88c47e26a9f1 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 9 Jun 2023 17:44:21 +0200 Subject: [PATCH 08/11] adds minor visualization improvements using the new chapter status --- src/lib/ChapterList.svelte | 7 +- src/routes/+layout.ts | 4 +- src/routes/+page.svelte | 2 +- src/signup-form/at/smallTexts.yml | 94 +++++++++++++++ src/signup-form/de/smallTexts.yml | 187 +++++++++++++++++++++++------- 5 files changed, 249 insertions(+), 45 deletions(-) create mode 100644 src/signup-form/at/smallTexts.yml diff --git a/src/lib/ChapterList.svelte b/src/lib/ChapterList.svelte index 5cb498e1..7c519a2a 100644 --- a/src/lib/ChapterList.svelte +++ b/src/lib/ChapterList.svelte @@ -5,7 +5,8 @@ export let chapters: Chapter[] - const openChapters = chapters.filter((ch) => ch.acceptsSignups) + // const openChapters = chapters.filter((ch) => ch.acceptsSignups) + const openChapters = chapters.filter((ch) => ch.status == `active`) const startingChapters = chapters.filter((ch) => ch.status == `starting`) const partnerChapters = chapters.filter((ch) => ch.status == `partner`) @@ -19,7 +20,7 @@
  • {title}
  • {/each} -{#if startingChapters.length > 2} +{#if startingChapters.length > 0}

    {$microcopy?.chapterList?.inSetup} @@ -30,7 +31,7 @@ {/each} {/if} -{#if partnerChapters.length > 2} +{#if partnerChapters.length > 0}

    {$microcopy?.chapterList?.partner} diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 76d75e7c..f214e439 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -18,8 +18,8 @@ export const load = async () => { // create { title, url } array containing all chapters const chapterLinks = chapters.map((chapter: Chapter) => { - const { title, slug, acceptsSignups } = chapter - return { title, url: slug, lightFont: !acceptsSignups } + const { title, slug, status } = chapter + return { title, url: slug, lightFont: status == `starting` } }) // prepend chapter links into chapter subnav diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 71565517..06bf91f4 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -34,7 +34,7 @@
    - {data.chapters.filter((ch) => ch.acceptsSignups).length} + {data.chapters.filter((ch) => ch.status == `active`).length} {$microcopy?.indexPage?.boxes?.locationsName}Standort auf der Karte!' + + register: + 'Oder melde dich direkt + bei uns an. + ' + boxes: + locationsName: Standorte + studentsName: Studierende + studentsNumber: 3 + pupilsName: Schüler:innen + pupilsNumber: 5 + scholarshipName: Gründung + scholarshipNumber: 2023 + organizationMemberName: Vereinsmitglieder + organizationMemberNumber: 10 + +footer: + name: 'Studenten bilden Schüler e.V.' + siteInfos: 'Diese Seite ist + + open source + + und verwendet keine + + use + + cookies. + ' + site: 'Diese Seite ist' + uses: 'und verwendet keine' + +map: + location: + lng: 13.55 + lat: 47.71 + zoom: 6.00 + minZoom: 4 + maxZoom: 10 + text: + active: 'aktiver Standort' + inSetup: 'in Gründung' + partner: 'Partner' + + +chapterList: + locations: 'Unsere Standorte' + inSetup: 'Standorte in Gründung' + partner: "Partner Standorte" + +location: + register: 'Anmeldungen' + joinStudent: 'Willst du bei uns mitmachen?' + registerStudent: 'Als Student:in anmelden' + linkStudentInfo: '/mitmachen/nachhilfelehrer' + infoStudentButton: 'Infos für Studierende' + joinPupil: 'Suchst du Nachhilfe?' + registerPupil: 'Als Schüler:in anmelden' + linkPupilInfo: '/mitmachen/schueler' + infoPupilButton: 'Infos für Schüler:innen' + locationManagement: 'Interesse an Standortleitung?' + mailTo: 'mailto:info.{slug}@studenten-bilden-schueler.de?subject=Interesse an Standortleitung in {page.title}' + writeMailButton: 'Schreib uns' + linkLeadingInfo: '/mitmachen/standortleiter' + infoLeadingButton: 'Infos für Standortleitende' + contact: 'Kontakt' + questions: 'Noch Fragen? Schreib uns eine Mail!' + url: 'studenten-bilden-schueler.de' + student: 'studenten' + forStudents: 'für Studierende' + pupil: 'schueler' + info: 'info' + forPartner: 'für Soziale Einrichtungen und Nachhilfeanfragen' + generalRequests: 'für Allgemeine Anfragen' + +basepage: + last: 'Zuletzt bearbeitet:' + feedback: 'Feedback zu dieser Seite?' + email: 'it@studenten-bilden-schueler.de?subject=Feedback zu Seite:' + +meta: + name: 'Studenten bilden Schüler e.V.' + description: 'Ehrenamtliche Nachhilfe von Studierenden für Schüler:innen in deutschlandweit über 50 Unistädten.' + url: studenten-bilden-schueler.de diff --git a/src/signup-form/de/smallTexts.yml b/src/signup-form/de/smallTexts.yml index a12e78e3..b7940580 100644 --- a/src/signup-form/de/smallTexts.yml +++ b/src/signup-form/de/smallTexts.yml @@ -13,16 +13,18 @@ indexPage: boxes: locationsName: Standorte studentsName: Studierende - studentsNumber: 2872 + studentsNumber: 3228 pupilsName: Schüler:innen - pupilsNumber: 3186 + pupilsNumber: 3231 scholarshipName: 'Stipendien' - scholarshipNumber: 9 + scholarshipNumber: 12 + organizationMemberName: Vereinsmitglieder + organizationMemberNumber: 350 footer: - name: 'Studenten bilden Schüler e.V.' - site: 'Diese Seite ist' - uses: 'und verwendet keine' + name: "Studenten bilden Schüler e.V." + site: "Diese Seite ist" + uses: "und verwendet keine" map: location: @@ -32,45 +34,152 @@ map: minZoom: 4 maxZoom: 10 text: - active: 'aktiver Standort' - inSetup: 'in Gründung' + active: "aktiver Standort" + inSetup: "in Gründung" + partner: "Partner" chapterList: - locations: 'Unsere Standorte' - inSetup: 'Standorte in Gründung' + locations: "Unsere Standorte" + inSetup: "Standorte in Gründung" + partner: "Partner Standorte" location: - register: 'Anmeldungen' - joinStudent: 'Willst du bei uns mitmachen?' - registerStudent: 'Als Student:in anmelden' - linkStudentInfo: '/mitmachen/nachhilfelehrer' - infoStudentButton: 'Infos für Studierende' - joinPupil: 'Suchst du Nachhilfe?' - declinePupil: 'Leider ist die Warteliste voll' - registerPupil: 'Als Schüler:in anmelden' - linkPupilInfo: '/mitmachen/schueler' - infoPupilButton: 'Infos für Schüler:innen' - locationManagement: 'Interesse an Standortleitung?' - mailTo: '@studenten-bilden-schueler.de?subject=Interesse an Standortleitung in' - writeMailButton: 'Schreib uns' - linkLeadingInfo: '/mitmachen/standortleiter' - infoLeadingButton: 'Infos für Standortleitende' - contact: 'Kontakt' - questions: 'Noch Fragen? Schreib uns eine Mail!' - url: 'studenten-bilden-schueler.de' - student: 'studenten' - forStudents: 'für Studierende' - pupil: 'schueler' - info: 'info' - forPartner: 'für Soziale Einrichtungen und Nachhilfeanfragen' - generalRequests: 'für Allgemeine Anfragen' + register: "Anmeldungen" + joinStudent: "Willst du bei uns mitmachen?" + registerStudent: "Als Student:in anmelden" + linkStudentInfo: "/mitmachen/nachhilfelehrer" + infoStudentButton: "Infos für Studierende" + joinPupil: "Suchst du Nachhilfe?" + declinePupil: "Warteliste voll :(" + registerPupil: "Als Schüler:in anmelden" + linkPupilInfo: "/mitmachen/schueler" + infoPupilButton: "Infos für Schüler:innen" + locationManagement: "Interesse an Standortleitung?" + mailTo: "@studenten-bilden-schueler.de?subject=Interesse an Standortleitung in" + writeMailButton: "Schreib uns" + linkLeadingInfo: "/mitmachen/standortleiter" + infoLeadingButton: "Infos für Standortleitende" + contact: "Kontakt" + questions: "Noch Fragen? Schreib uns eine Mail!" + url: "studenten-bilden-schueler.de" + student: "studenten" + forStudents: "für Studierende" + pupil: "schueler" + info: "info" + forPartner: "für Soziale Einrichtungen und Nachhilfeanfragen" + generalRequests: "für Allgemeine Anfragen" basepage: - lastUpdated: 'Zuletzt bearbeitet:' - feedback: 'Feedback zu dieser Seite?' - email: 'it@studenten-bilden-schueler.de?subject=Feedback zu Seite:' + lastUpdated: "Zuletzt bearbeitet:" + feedback: "Feedback zu dieser Seite?" + email: "it@studenten-bilden-schueler.de?subject=Feedback zu Seite:" meta: - name: 'Studenten bilden Schüler e.V.' - description: 'Ehrenamtliche Nachhilfe von Studierenden für Schüler:innen in deutschlandweit über 50 Unistädten.' + name: "Studenten bilden Schüler e.V." + description: "Ehrenamtliche Nachhilfe von Studierenden für Schüler:innen in deutschlandweit über 50 Unistädten." url: studenten-bilden-schueler.de + +icons: + global: + award: &AWARD "fa-solid:award" + calendar: &CALENDAR "oction:calendar" + child: &CHILD "fa-solid:child" + close: &CLOSE "ic:round-close" + currency: &CURRENCY "ic:round-euro" + email: &EMAIL "ic:email" + expand: &EXPAND "bi:chevron-expand" + graduate: &GRADUATE "fa-solid:user-graduate" + graduationCap: &GRADUATION_CAP "fa-solid:graduation-cap" + group: &GROUP "fa6-solid:user-group" + hands: &HANDS_HELPING "fa-solid:hands-helping" + information: &INFORMATION "bi:info-circle-fill" + link: &LINK "bx:link" + newspaper: &NEWSPAPER "ion:newspaper" + place: &PLACE "ic:place" + plant: &PLANT "ri:plant-fill" + selectAll: &SELECT_ALL "ic:select-all" + socials: + facebook: &FACEBOOK "fa-brands:facebook" + instagram: &INSTAGRAM "fa-brands:instagram" + linkedin: &LINKEDIN "fa-brands:linkedin" + twitter: &TWITTER "fa-brands:twitter" + youtube: &YOUTUBE "fa-brands:youtube" + tags: &TAGS "fa-solid:tags" + teacher: &TEACHER "fa-solid:chalkboard-teacher" + theme: + dark: &THEME_DARK "octicon:moon-16" + light: &THEME_LIGHT "ic:round-wb-sunny" + system: &THEME_SYSTEM "bi:laptop" + + pages: + article: + history: "ic:round-history-edu" + person: "bi:person-circle" + blog: + eye: "ic:round-remove-red-eye" + chapterList: + construction: "ic:round-construction" + footer: + Datenschutz: "ic:round-privacy-tip" + Impressum: "octicon:law" + Satzung: "ion:document-text" + Spenden: *CURRENCY + cookie: "bxs:cookie" + opensource: "ri:open-source-fill" + index: + update: "ic:update" + nav: + Anmeldung: "ic:round-assignment-ind" + Blog: "fa-solid:rss-square" + Internes: *HANDS_HELPING + Kontakt: "ic:round-alternate-email" + Mitmachen: "ion:people-circle" + Standorte: *PLACE + expand: *EXPAND + menu: "heroicons-solid:menu" + Über Uns: *PLANT + placeSelect: + delete: "ic:delete" + + tags: + blog: + Alle: *SELECT_ALL + Auszeichnung: *AWARD + Bundesvorstand: "ion:stats-chart" + Erfahrungsberichte: "ic:rate-review" + Events: "ic:event-available" + Freizeit: "ic:beach-access" + IT: "bx:git-branch" + Interview: "ic:question-answer" + Mentoring: *TEACHER + Nachhilfelehrer: *TEACHER + Sonstiges: "fa6-solid:earth-europe" + "Soziale Partner": "fa-solid:handshake" + Spenden: *CURRENCY + Standorte: "fa6-solid:map-location-dot" + Standortleiter: *GRADUATION_CAP + Stipendium: "fa-solid:donate" + Werbung: "ic:public" + faq: + Alle: *SELECT_ALL + Datenschutz: "ic:round-privacy-tip" + Führungszeugnis: "ic:round-assignment-ind" + Mitgliederversammlung: "ic:round-group" + Nachhilfe: *TEACHER + Rahmenbedingungen: "ic:filter-frames" + "Rund ums Engagement": *HANDS_HELPING + Sonstiges: "ic:round-miscellaneous-services" + "Tipps für Standorte": "ic:round-storefront" + Vereinsaustritt: "ic:exit-to-app" + Vermittlung: "ic:round-support-agent" + Versicherung: "map:insurance-agency" + learningMaterial: + Alle: *SELECT_ALL + "Deutsche Sprache": "ic:language" + Deutschunterricht: "simple-icons:disqus" + Englisch: "fa-brands:erlang" + "Lernen mit Karteikarten": "bi:card-text" + Mathe: "ic:functions" + Physik: "simple-icons:atom" + "Viele Fächer": "ic:group-work" + Wissenschaft: "ic:round-science" From 7e383c785ce14f05a4b24618547477ba9ce58c17 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 21:53:18 +0000 Subject: [PATCH 09/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/signup-form/at/smallTexts.yml | 3 +- src/signup-form/de/smallTexts.yml | 220 +++++++++++++++--------------- 2 files changed, 111 insertions(+), 112 deletions(-) diff --git a/src/signup-form/at/smallTexts.yml b/src/signup-form/at/smallTexts.yml index 72474524..4de28653 100644 --- a/src/signup-form/at/smallTexts.yml +++ b/src/signup-form/at/smallTexts.yml @@ -52,11 +52,10 @@ map: inSetup: 'in Gründung' partner: 'Partner' - chapterList: locations: 'Unsere Standorte' inSetup: 'Standorte in Gründung' - partner: "Partner Standorte" + partner: 'Partner Standorte' location: register: 'Anmeldungen' diff --git a/src/signup-form/de/smallTexts.yml b/src/signup-form/de/smallTexts.yml index b7940580..e24939cc 100644 --- a/src/signup-form/de/smallTexts.yml +++ b/src/signup-form/de/smallTexts.yml @@ -22,9 +22,9 @@ indexPage: organizationMemberNumber: 350 footer: - name: "Studenten bilden Schüler e.V." - site: "Diese Seite ist" - uses: "und verwendet keine" + name: 'Studenten bilden Schüler e.V.' + site: 'Diese Seite ist' + uses: 'und verwendet keine' map: location: @@ -34,152 +34,152 @@ map: minZoom: 4 maxZoom: 10 text: - active: "aktiver Standort" - inSetup: "in Gründung" - partner: "Partner" + active: 'aktiver Standort' + inSetup: 'in Gründung' + partner: 'Partner' chapterList: - locations: "Unsere Standorte" - inSetup: "Standorte in Gründung" - partner: "Partner Standorte" + locations: 'Unsere Standorte' + inSetup: 'Standorte in Gründung' + partner: 'Partner Standorte' location: - register: "Anmeldungen" - joinStudent: "Willst du bei uns mitmachen?" - registerStudent: "Als Student:in anmelden" - linkStudentInfo: "/mitmachen/nachhilfelehrer" - infoStudentButton: "Infos für Studierende" - joinPupil: "Suchst du Nachhilfe?" - declinePupil: "Warteliste voll :(" - registerPupil: "Als Schüler:in anmelden" - linkPupilInfo: "/mitmachen/schueler" - infoPupilButton: "Infos für Schüler:innen" - locationManagement: "Interesse an Standortleitung?" - mailTo: "@studenten-bilden-schueler.de?subject=Interesse an Standortleitung in" - writeMailButton: "Schreib uns" - linkLeadingInfo: "/mitmachen/standortleiter" - infoLeadingButton: "Infos für Standortleitende" - contact: "Kontakt" - questions: "Noch Fragen? Schreib uns eine Mail!" - url: "studenten-bilden-schueler.de" - student: "studenten" - forStudents: "für Studierende" - pupil: "schueler" - info: "info" - forPartner: "für Soziale Einrichtungen und Nachhilfeanfragen" - generalRequests: "für Allgemeine Anfragen" + register: 'Anmeldungen' + joinStudent: 'Willst du bei uns mitmachen?' + registerStudent: 'Als Student:in anmelden' + linkStudentInfo: '/mitmachen/nachhilfelehrer' + infoStudentButton: 'Infos für Studierende' + joinPupil: 'Suchst du Nachhilfe?' + declinePupil: 'Warteliste voll :(' + registerPupil: 'Als Schüler:in anmelden' + linkPupilInfo: '/mitmachen/schueler' + infoPupilButton: 'Infos für Schüler:innen' + locationManagement: 'Interesse an Standortleitung?' + mailTo: '@studenten-bilden-schueler.de?subject=Interesse an Standortleitung in' + writeMailButton: 'Schreib uns' + linkLeadingInfo: '/mitmachen/standortleiter' + infoLeadingButton: 'Infos für Standortleitende' + contact: 'Kontakt' + questions: 'Noch Fragen? Schreib uns eine Mail!' + url: 'studenten-bilden-schueler.de' + student: 'studenten' + forStudents: 'für Studierende' + pupil: 'schueler' + info: 'info' + forPartner: 'für Soziale Einrichtungen und Nachhilfeanfragen' + generalRequests: 'für Allgemeine Anfragen' basepage: - lastUpdated: "Zuletzt bearbeitet:" - feedback: "Feedback zu dieser Seite?" - email: "it@studenten-bilden-schueler.de?subject=Feedback zu Seite:" + lastUpdated: 'Zuletzt bearbeitet:' + feedback: 'Feedback zu dieser Seite?' + email: 'it@studenten-bilden-schueler.de?subject=Feedback zu Seite:' meta: - name: "Studenten bilden Schüler e.V." - description: "Ehrenamtliche Nachhilfe von Studierenden für Schüler:innen in deutschlandweit über 50 Unistädten." + name: 'Studenten bilden Schüler e.V.' + description: 'Ehrenamtliche Nachhilfe von Studierenden für Schüler:innen in deutschlandweit über 50 Unistädten.' url: studenten-bilden-schueler.de icons: global: - award: &AWARD "fa-solid:award" - calendar: &CALENDAR "oction:calendar" - child: &CHILD "fa-solid:child" - close: &CLOSE "ic:round-close" - currency: &CURRENCY "ic:round-euro" - email: &EMAIL "ic:email" - expand: &EXPAND "bi:chevron-expand" - graduate: &GRADUATE "fa-solid:user-graduate" - graduationCap: &GRADUATION_CAP "fa-solid:graduation-cap" - group: &GROUP "fa6-solid:user-group" - hands: &HANDS_HELPING "fa-solid:hands-helping" - information: &INFORMATION "bi:info-circle-fill" - link: &LINK "bx:link" - newspaper: &NEWSPAPER "ion:newspaper" - place: &PLACE "ic:place" - plant: &PLANT "ri:plant-fill" - selectAll: &SELECT_ALL "ic:select-all" + award: &AWARD 'fa-solid:award' + calendar: &CALENDAR 'oction:calendar' + child: &CHILD 'fa-solid:child' + close: &CLOSE 'ic:round-close' + currency: &CURRENCY 'ic:round-euro' + email: &EMAIL 'ic:email' + expand: &EXPAND 'bi:chevron-expand' + graduate: &GRADUATE 'fa-solid:user-graduate' + graduationCap: &GRADUATION_CAP 'fa-solid:graduation-cap' + group: &GROUP 'fa6-solid:user-group' + hands: &HANDS_HELPING 'fa-solid:hands-helping' + information: &INFORMATION 'bi:info-circle-fill' + link: &LINK 'bx:link' + newspaper: &NEWSPAPER 'ion:newspaper' + place: &PLACE 'ic:place' + plant: &PLANT 'ri:plant-fill' + selectAll: &SELECT_ALL 'ic:select-all' socials: - facebook: &FACEBOOK "fa-brands:facebook" - instagram: &INSTAGRAM "fa-brands:instagram" - linkedin: &LINKEDIN "fa-brands:linkedin" - twitter: &TWITTER "fa-brands:twitter" - youtube: &YOUTUBE "fa-brands:youtube" - tags: &TAGS "fa-solid:tags" - teacher: &TEACHER "fa-solid:chalkboard-teacher" + facebook: &FACEBOOK 'fa-brands:facebook' + instagram: &INSTAGRAM 'fa-brands:instagram' + linkedin: &LINKEDIN 'fa-brands:linkedin' + twitter: &TWITTER 'fa-brands:twitter' + youtube: &YOUTUBE 'fa-brands:youtube' + tags: &TAGS 'fa-solid:tags' + teacher: &TEACHER 'fa-solid:chalkboard-teacher' theme: - dark: &THEME_DARK "octicon:moon-16" - light: &THEME_LIGHT "ic:round-wb-sunny" - system: &THEME_SYSTEM "bi:laptop" + dark: &THEME_DARK 'octicon:moon-16' + light: &THEME_LIGHT 'ic:round-wb-sunny' + system: &THEME_SYSTEM 'bi:laptop' pages: article: - history: "ic:round-history-edu" - person: "bi:person-circle" + history: 'ic:round-history-edu' + person: 'bi:person-circle' blog: - eye: "ic:round-remove-red-eye" + eye: 'ic:round-remove-red-eye' chapterList: - construction: "ic:round-construction" + construction: 'ic:round-construction' footer: - Datenschutz: "ic:round-privacy-tip" - Impressum: "octicon:law" - Satzung: "ion:document-text" + Datenschutz: 'ic:round-privacy-tip' + Impressum: 'octicon:law' + Satzung: 'ion:document-text' Spenden: *CURRENCY - cookie: "bxs:cookie" - opensource: "ri:open-source-fill" + cookie: 'bxs:cookie' + opensource: 'ri:open-source-fill' index: - update: "ic:update" + update: 'ic:update' nav: - Anmeldung: "ic:round-assignment-ind" - Blog: "fa-solid:rss-square" + Anmeldung: 'ic:round-assignment-ind' + Blog: 'fa-solid:rss-square' Internes: *HANDS_HELPING - Kontakt: "ic:round-alternate-email" - Mitmachen: "ion:people-circle" + Kontakt: 'ic:round-alternate-email' + Mitmachen: 'ion:people-circle' Standorte: *PLACE expand: *EXPAND - menu: "heroicons-solid:menu" + menu: 'heroicons-solid:menu' Über Uns: *PLANT placeSelect: - delete: "ic:delete" + delete: 'ic:delete' tags: blog: Alle: *SELECT_ALL Auszeichnung: *AWARD - Bundesvorstand: "ion:stats-chart" - Erfahrungsberichte: "ic:rate-review" - Events: "ic:event-available" - Freizeit: "ic:beach-access" - IT: "bx:git-branch" - Interview: "ic:question-answer" + Bundesvorstand: 'ion:stats-chart' + Erfahrungsberichte: 'ic:rate-review' + Events: 'ic:event-available' + Freizeit: 'ic:beach-access' + IT: 'bx:git-branch' + Interview: 'ic:question-answer' Mentoring: *TEACHER Nachhilfelehrer: *TEACHER - Sonstiges: "fa6-solid:earth-europe" - "Soziale Partner": "fa-solid:handshake" + Sonstiges: 'fa6-solid:earth-europe' + 'Soziale Partner': 'fa-solid:handshake' Spenden: *CURRENCY - Standorte: "fa6-solid:map-location-dot" + Standorte: 'fa6-solid:map-location-dot' Standortleiter: *GRADUATION_CAP - Stipendium: "fa-solid:donate" - Werbung: "ic:public" + Stipendium: 'fa-solid:donate' + Werbung: 'ic:public' faq: Alle: *SELECT_ALL - Datenschutz: "ic:round-privacy-tip" - Führungszeugnis: "ic:round-assignment-ind" - Mitgliederversammlung: "ic:round-group" + Datenschutz: 'ic:round-privacy-tip' + Führungszeugnis: 'ic:round-assignment-ind' + Mitgliederversammlung: 'ic:round-group' Nachhilfe: *TEACHER - Rahmenbedingungen: "ic:filter-frames" - "Rund ums Engagement": *HANDS_HELPING - Sonstiges: "ic:round-miscellaneous-services" - "Tipps für Standorte": "ic:round-storefront" - Vereinsaustritt: "ic:exit-to-app" - Vermittlung: "ic:round-support-agent" - Versicherung: "map:insurance-agency" + Rahmenbedingungen: 'ic:filter-frames' + 'Rund ums Engagement': *HANDS_HELPING + Sonstiges: 'ic:round-miscellaneous-services' + 'Tipps für Standorte': 'ic:round-storefront' + Vereinsaustritt: 'ic:exit-to-app' + Vermittlung: 'ic:round-support-agent' + Versicherung: 'map:insurance-agency' learningMaterial: Alle: *SELECT_ALL - "Deutsche Sprache": "ic:language" - Deutschunterricht: "simple-icons:disqus" - Englisch: "fa-brands:erlang" - "Lernen mit Karteikarten": "bi:card-text" - Mathe: "ic:functions" - Physik: "simple-icons:atom" - "Viele Fächer": "ic:group-work" - Wissenschaft: "ic:round-science" + 'Deutsche Sprache': 'ic:language' + Deutschunterricht: 'simple-icons:disqus' + Englisch: 'fa-brands:erlang' + 'Lernen mit Karteikarten': 'bi:card-text' + Mathe: 'ic:functions' + Physik: 'simple-icons:atom' + 'Viele Fächer': 'ic:group-work' + Wissenschaft: 'ic:round-science' From 5c4f712f319b780a211978361475f9bae13f3418 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 10 Jun 2023 01:46:43 +0200 Subject: [PATCH 10/11] added option for signups at chapter view. These are used for visualization and for the signup forms --- src/lib/ChapterMap.svelte | 1 + src/lib/fetch.ts | 1 + src/lib/types.ts | 1 + src/routes/signup-pupil/+page.server.ts | 3 +-- src/routes/signup-student/+page.server.ts | 2 +- src/routes/standorte/+page.svelte | 4 +--- src/routes/standorte/[slug]/+page.server.ts | 8 +++++++- src/routes/standorte/[slug]/+page.svelte | 11 +++++------ 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/lib/ChapterMap.svelte b/src/lib/ChapterMap.svelte index 08fa83fd..aec2c6ac 100644 --- a/src/lib/ChapterMap.svelte +++ b/src/lib/ChapterMap.svelte @@ -5,6 +5,7 @@ import { microcopy } from './stores' import type { Chapter } from './types' + // why do we fetch chapters here? They were already passed to the function export const load: Load = () => { return { props: { chapters: fetch_chapters() } } } diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 8745722f..f78560fa 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -70,6 +70,7 @@ const chapters_query = `{ acceptsSignups deactivatePupils status + signup token } } diff --git a/src/lib/types.ts b/src/lib/types.ts index 56eab1f7..be9a4d90 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -9,6 +9,7 @@ export type Chapter = { acceptsSignups: boolean deactivatePupils: boolean status: 'active' | 'starting' | 'partner' | null + signup: 'everyone' | 'onlyStudents' | 'nobody' | null token: string } diff --git a/src/routes/signup-pupil/+page.server.ts b/src/routes/signup-pupil/+page.server.ts index fb1cd1dc..748c7268 100644 --- a/src/routes/signup-pupil/+page.server.ts +++ b/src/routes/signup-pupil/+page.server.ts @@ -8,8 +8,7 @@ import raw_form from '../../signup-form/de/pupil.yml' export const load = async () => { let chapters = await fetch_chapters() - chapters = chapters.filter((chap) => chap.acceptsSignups) - chapters = chapters.filter((chap) => !chap.deactivatePupils) + 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..0fdb86c2 100644 --- a/src/routes/signup-student/+page.server.ts +++ b/src/routes/signup-student/+page.server.ts @@ -6,7 +6,7 @@ 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..67de3e5d 100644 --- a/src/routes/standorte/[slug]/+page.server.ts +++ b/src/routes/standorte/[slug]/+page.server.ts @@ -1,12 +1,18 @@ 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 eb012231..df5f2b9e 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 && page?.yaml?.allowPupils !== false} + when selectedChapter is not defined show all buttons as default --> + {#if !selectedChapter?.signup || selectedChapter?.signup == 'everyone'}

    {$microcopy?.location?.register}

    @@ -57,7 +56,7 @@ >
    - {:else if page?.yaml?.allowPupils == false} + {:else if selectedChapter?.signup == 'onlyStudents'}

    {$microcopy?.location?.register}

    @@ -108,7 +107,7 @@ {/if} - {#if page?.yaml?.showSignupButtons !== false} + {#if selectedChapter?.signup !== 'nobody'}

    {$microcopy?.location?.contact}

    {$microcopy?.location?.questions}

      From ae997a36925d0b23890f871600e15abfdf0ffd34 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 23:47:02 +0000 Subject: [PATCH 11/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/routes/signup-pupil/+page.server.ts | 2 +- src/routes/signup-student/+page.server.ts | 4 +++- src/routes/standorte/[slug]/+page.server.ts | 3 +-- src/routes/standorte/[slug]/+page.svelte | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/routes/signup-pupil/+page.server.ts b/src/routes/signup-pupil/+page.server.ts index 748c7268..b7bf4d84 100644 --- a/src/routes/signup-pupil/+page.server.ts +++ b/src/routes/signup-pupil/+page.server.ts @@ -8,7 +8,7 @@ import raw_form from '../../signup-form/de/pupil.yml' export const load = async () => { let chapters = await fetch_chapters() - chapters = chapters.filter((chap) => chap.signup == 'everyone') + 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 0fdb86c2..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.signup == 'everyone' || chap.signup == 'onlyStudents') + chapters = chapters.filter( + (chap) => chap.signup == `everyone` || chap.signup == `onlyStudents` + ) const form = parse_form_data({ ...raw_form, ...messages }) diff --git a/src/routes/standorte/[slug]/+page.server.ts b/src/routes/standorte/[slug]/+page.server.ts index 67de3e5d..7a12e9ba 100644 --- a/src/routes/standorte/[slug]/+page.server.ts +++ b/src/routes/standorte/[slug]/+page.server.ts @@ -2,7 +2,6 @@ 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 @@ -14,5 +13,5 @@ export const load = async ({ params }) => { if (!page) throw error(404) - return { page, slug , selectedChapter } + return { page, slug, selectedChapter } } diff --git a/src/routes/standorte/[slug]/+page.svelte b/src/routes/standorte/[slug]/+page.svelte index df5f2b9e..614bdec6 100644 --- a/src/routes/standorte/[slug]/+page.svelte +++ b/src/routes/standorte/[slug]/+page.svelte @@ -11,7 +11,7 @@ - {#if !selectedChapter?.signup || selectedChapter?.signup == 'everyone'} + {#if !selectedChapter?.signup || selectedChapter?.signup == `everyone`}

      {$microcopy?.location?.register}

      @@ -56,7 +56,7 @@ >
      - {:else if selectedChapter?.signup == 'onlyStudents'} + {:else if selectedChapter?.signup == `onlyStudents`}

      {$microcopy?.location?.register}

      @@ -107,7 +107,7 @@ {/if} - {#if selectedChapter?.signup !== 'nobody'} + {#if selectedChapter?.signup !== `nobody`}

      {$microcopy?.location?.contact}

      {$microcopy?.location?.questions}