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

adds partner organizations to map and list #99

Merged
merged 6 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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: 1 addition & 1 deletion src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 15 additions & 1 deletion src/lib/ChapterList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
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)
</script>

<h1>
Expand All @@ -29,6 +32,17 @@
{/each}
</ol>
{/if}
{#if partnerChapters.length > 2}
<h1>
<Icon icon="ic:place" inline />
{$microcopy?.chapterList?.partner}
</h1>
<ol>
{#each partnerChapters as { title, slug }}
<li><a href={slug}>{title}</a></li>
{/each}
</ol>
{/if}

<style>
h1 {
Expand Down
15 changes: 14 additions & 1 deletion src/lib/ChapterMap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
<Map
markers={chapters.map((chap) => ({
...chap.coords, // contains { lng, lat }
classes: [`chapter`, chap.acceptsSignups ? `active` : `starting`],
classes: [
`chapter`,
chap.acceptsSignups ? `active` : chap.partnerAssociation ? `partner` : `starting`,
],
title: chap.token,
url: chap.slug,
}))}
Expand All @@ -39,6 +42,10 @@
<span style="background: var(--dark-green)" />
{$microcopy?.map?.text?.inSetup}
</div>
<div>
<span style="background: var(--grey)" />
{$microcopy?.map?.text?.partner}
</div>
</legend>
</div>

Expand Down Expand Up @@ -78,6 +85,9 @@
:global(a.chapter.starting) {
background-color: var(--dark-green);
}
:global(a.chapter.partner) {
background-color: var(--gray);
}
:global(a.chapter:hover) {
background-color: var(--blue);
}
Expand All @@ -97,4 +107,7 @@
:global(a.chapter.starting::after) {
border-color: var(--dark-green) transparent transparent transparent;
}
:global(a.chapter.partner::after) {
border-color: var(--gray) transparent transparent transparent;
}
</style>
1 change: 1 addition & 0 deletions src/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const chapters_query = `{
}
baseId
acceptsSignups
partnerAssociation
token
}
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Chapter = {
}
baseId: string
acceptsSignups: boolean
partnerAssociation: boolean
token: string
}

Expand Down
5 changes: 4 additions & 1 deletion src/routes/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ 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()
// 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)

Expand Down
1 change: 1 addition & 0 deletions src/signup-form/de/smallTexts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down