From d054b56bf78a13d816515eb4a8d85562a368fac1 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 19 Apr 2026 20:51:55 +0200 Subject: [PATCH] chore: remove participants and calendar pages and nav links --- src/layouts/AppLayout.astro | 14 +- src/pages/calendar.astro | 213 ----------------------- src/pages/calendar/[slug].astro | 300 -------------------------------- src/pages/participants.astro | 185 -------------------- 4 files changed, 6 insertions(+), 706 deletions(-) delete mode 100644 src/pages/calendar.astro delete mode 100644 src/pages/calendar/[slug].astro delete mode 100644 src/pages/participants.astro diff --git a/src/layouts/AppLayout.astro b/src/layouts/AppLayout.astro index 5233a55..01cd0eb 100644 --- a/src/layouts/AppLayout.astro +++ b/src/layouts/AppLayout.astro @@ -10,14 +10,12 @@ interface Props { const { title, user } = Astro.props; const navLinks = [ - { href: '/', label: 'Home' }, - { href: '/vision', label: 'Vision' }, - { href: '/product', label: 'Product' }, - { href: '/updates', label: 'Updates' }, - { href: '/roadmap', label: 'Roadmap' }, - { href: '/calendar', label: 'Calendar' }, - { href: '/contribute', label: 'Contribute' }, - { href: '/participants', label: 'Participants' }, + { href: '/', label: 'Home' }, + { href: '/vision', label: 'Vision' }, + { href: '/product', label: 'Product' }, + { href: '/updates', label: 'Updates' }, + { href: '/roadmap', label: 'Roadmap' }, + { href: '/contribute', label: 'Contribute'}, ]; const currentPath = Astro.url.pathname; diff --git a/src/pages/calendar.astro b/src/pages/calendar.astro deleted file mode 100644 index ff2a405..0000000 --- a/src/pages/calendar.astro +++ /dev/null @@ -1,213 +0,0 @@ ---- -import { getCollection } from 'astro:content'; -import AppLayout from '../layouts/AppLayout.astro'; -import { fmtDate } from '../lib/markdown'; - -const user = Astro.locals.user; - -const allMeetings = await getCollection('meetings'); -const meetings = allMeetings.sort( - (a, b) => new Date(a.data.date).getTime() - new Date(b.data.date).getTime() -); - -const now = new Date(); -const upcoming = meetings.filter((m) => new Date(m.data.date) >= now); -const past = meetings.filter((m) => new Date(m.data.date) < now).reverse(); ---- - -
- - - -
- {upcoming.length > 0 && ( -
-

Upcoming

- -
- )} - - {past.length > 0 && ( -
-

Past

- -
- )} -
- -
-
- - diff --git a/src/pages/calendar/[slug].astro b/src/pages/calendar/[slug].astro deleted file mode 100644 index 7cb4baf..0000000 --- a/src/pages/calendar/[slug].astro +++ /dev/null @@ -1,300 +0,0 @@ ---- -import { getCollection, getEntry } from 'astro:content'; -import AppLayout from '../../layouts/AppLayout.astro'; -import { fmtDate, renderMd } from '../../lib/markdown'; -import { getAttendanceSummary, getUserAttendance, setAttendance } from '../../lib/db'; - -const user = Astro.locals.user; -const { slug } = Astro.params; - -const meeting = await getEntry('meetings', slug as string); -if (!meeting) return Astro.redirect('/calendar'); - -const isPast = new Date(meeting.data.date) < new Date(); - -// Handle attendance POST -if (Astro.request.method === 'POST') { - const data = await Astro.request.formData(); - const status = data.get('status') as 'yes' | 'no' | null; - if (status === 'yes' || status === 'no') { - setAttendance(user.id, meeting.slug, status); - } - return Astro.redirect(`/calendar/${slug}`); -} - -const { Content } = await meeting.render(); -const attendance = getAttendanceSummary(meeting.slug); -const myStatus = getUserAttendance(user.id, meeting.slug); ---- - -
- - - -
-
-
- -

{meeting.data.title}

-
-
-
Time
-
{meeting.data.time}
-
-
-
Location
-
{meeting.data.location}
-
- {meeting.data.attendees && ( -
-
Attendees
-
{meeting.data.attendees}
-
- )} -
-
- -
- -
-
- - {!isPast && ( - - )} -
- -
-
- - diff --git a/src/pages/participants.astro b/src/pages/participants.astro deleted file mode 100644 index 0942f45..0000000 --- a/src/pages/participants.astro +++ /dev/null @@ -1,185 +0,0 @@ ---- -import AppLayout from '../layouts/AppLayout.astro'; -import { getAllUsersPublic } from '../lib/db'; -import type { UserPublic, Role } from '../lib/db'; - -const user = Astro.locals.user; - -const allUsers = getAllUsersPublic().filter((u) => u.active); - -// Group by organisation -const orgs = new Map(); -for (const u of allUsers) { - if (!orgs.has(u.organisation)) orgs.set(u.organisation, []); - orgs.get(u.organisation)!.push(u); -} - -const roleLabels: Record = { - pilot: 'Pilot', - cab: 'CAB', - fenja: 'Fenja', -}; - -const roleColors: Record = { - pilot: 'var(--pigment-copper)', - cab: 'var(--pigment-indigo)', - fenja: 'var(--secondary)', -}; ---- - -
- - - -
- {[...orgs.entries()].map(([orgName, members]) => ( -
-

{orgName}

-
    - {members.map((member) => ( -
  • -
    - {member.name} - - {roleLabels[member.role]} - -
    - {member.bio && ( -

    {member.bio}

    - )} - {member.id === user.id && ( - - Edit your bio - - )} -
  • - ))} -
-
- ))} -
- -
-
- -