diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 1d0af0b..482a547 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -94,14 +94,15 @@ export default function AdminPage() { return cellValue; } }, []); - + console.log(status); + console.log(session?.user); if (status === "authenticated") { if (session.user?.role === "admin") { return ( -
+
diff --git a/app/calendar/page.tsx b/app/calendar/page.tsx index 8c04e77..46bc057 100644 --- a/app/calendar/page.tsx +++ b/app/calendar/page.tsx @@ -18,7 +18,11 @@ export default async function CalendarPage() { id: parseInt(planCookie), }, include: { - courses: true, + courses: { + include: { + instructor: true, + }, + }, }, }); @@ -42,6 +46,8 @@ export default async function CalendarPage() { title: courses[i]?.courseTitle, daColor: color, subject: courses[i]?.subject, + courseNumber: courses[i]?.courseNumber, + instructor: courses[i]?.instructor.displayName, color: "rgba(0,0,0,0)", borderWidth: "0px", @@ -104,11 +110,11 @@ export default async function CalendarPage() { //let times = await getUniqueStartEndTimes(); return ( -
-
+
+
-
+
diff --git a/app/layout.tsx b/app/layout.tsx index fd0fe63..72cafba 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -8,6 +8,7 @@ import { NextAuthProvider } from "../components/providers/NextAuthProvider"; import { siteConfig } from "../config/site"; import { fontSans } from "../config/fonts"; import { Navbar } from "../components/navbar"; +import FooterInfo from "../components/FooterInfo"; import { Providers } from "./providers"; @@ -54,35 +55,10 @@ export default function RootLayout({ >
-
+
{children}
-
-
- - The Course Planner is a student-run service, and displays - classes from the Tri-College course database. We recommend - confirming your schedule with the official course listings - just in case. If there are any issues, email us. - -
- -
- - - Usage & Data Policy - - - - © 2024 Swarthmore College Computer Society | v2.0.0 - -
-
-
+
diff --git a/app/page.tsx b/app/page.tsx index 1a79d07..744fbb1 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -100,7 +100,7 @@ export default async function Page(props: { homePageProps["createPlan"] = ( + } > @@ -125,7 +125,7 @@ async function Home(props: any) {
-
+
diff --git a/components/Calendar.tsx b/components/Calendar.tsx index dd8b159..9e3c35a 100644 --- a/components/Calendar.tsx +++ b/components/Calendar.tsx @@ -32,9 +32,16 @@ export default function Calendar(props: any) { */} {eventInfo.timeText} -
+
+ {eventInfo.event.extendedProps.subject} {""} + {eventInfo.event.extendedProps.courseNumber} +
+
{eventInfo.event.title}
+
+ {eventInfo.event.extendedProps.instructor.replace("'", "'")} +
); } diff --git a/components/CreatePlan.tsx b/components/CreatePlan.tsx index 9705eb7..e23bfc0 100644 --- a/components/CreatePlan.tsx +++ b/components/CreatePlan.tsx @@ -145,9 +145,13 @@ export default function CreatePlan(props: any) { /> -
- {course.courseTitle.replace(/&/g, "&")} +
+ {course.subject} {""} {course.courseNumber} +
+ {course.courseTitle.replace(/&/g, "&")} +
+
diff --git a/components/FooterInfo.tsx b/components/FooterInfo.tsx new file mode 100644 index 0000000..afa804b --- /dev/null +++ b/components/FooterInfo.tsx @@ -0,0 +1,88 @@ +"use client"; + +import FullCalendar from "@fullcalendar/react"; +import timeGridPlugin from "@fullcalendar/timegrid"; // a plugin! +import InfoIcon from "@mui/icons-material/Info"; +import { + Button, + Card, + Link, + Modal, + ModalBody, + ModalContent, + ModalFooter, + ModalHeader, + useDisclosure, +} from "@nextui-org/react"; +import moment from "moment"; + +export default function FooterInfo(props: any) { + const { isOpen, onOpen, onClose } = useDisclosure(); + + const handleOpen = () => { + onOpen(); + }; + return ( + <> +
handleOpen()} + > + +
+ + + {(onClose) => ( + <> + + Usage & Data Policy + + +
+ + The Course Planner is a student-run service, and displays + classes from the Tri-College course database. We recommend + confirming your schedule with the official course listings + just in case. If there are any issues, + + + {" "} + + email us. + + +
+
+ +
+ + Usage & Data Policy + +
+
+ + © 2024 Swarthmore College Computer Society | v2.0.0 + +
+
+ + + + + )} +
+
+ + ); +} diff --git a/lib/auth.ts b/lib/auth.ts index d71addb..36790cd 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -76,7 +76,7 @@ export const config = { return token; }, async session({ session, token }) { - session.role = token.role; + session.user.role = token.role; session.user.id = token.sub || ""; return session; },