π§ reorganize sidebar nav groups
Browse files at this commit6ecbb76ce6f56de43d8728306b9e2dc62680115eParent: 08a1204- feat
- π§ reorganize sidebar nav groups
4 changed files +18 -14
- docs/role-scope-matrix.md +5 -4
- src/components/layout/app-shell.tsx +5 -5
- src/components/layout/side-nav.tsx +5 -5
- src/pages/dashboard-page.tsx +3 -0
docs/role-scope-matrix.mdmodified+5 -4
| @@ -30,11 +30,11 @@ | ||
| 30 | 30 | |
| 31 | 31 | | Sidebar group / item | Student | Teacher | Manager | Admin | |
| 32 | 32 | |---|---|---|---|---| |
| 33 | -| **classes** β Courses / Exams / Events | β | β | β | β | | |
| 34 | -| **grades** β Report card (`/marks`) | β | β | β | β | | |
| 35 | -| **grades** β Notes | β | β | β | β | | |
| 33 | +| **classes** β Courses / Exams / Events / exam grades | β | β | β | β | | |
| 34 | +| **grades** β Defter (`/notes`) | β | β | β | β | | |
| 35 | +| **community** β Messages / Question pool | β | β | β | β | | |
| 36 | 36 | | **students** β My attendance (`/attendance`) | β | β | β | β | |
| 37 | -| **reports** β Student marks / attendance / work | β | β | β | β | | |
| 37 | +| **reports** β Student attendance / pomodoros / work | β | β | β | β | | |
| 38 | 38 | | **reports** β Staff work log | β | β | β | β | |
| 39 | 39 | | **settings** β Settings / Terms | β | β | β | β | |
| 40 | 40 | | **admin** β Users | β | β | β | β | |
| @@ -47,6 +47,7 @@ | ||
| 47 | 47 | | Exams | β (enrolled scope) | β | β | β | |
| 48 | 48 | | Events | β | β (teacher badge) | β | β | |
| 49 | 49 | | Report card | β | β | β | β | |
| 50 | +| Messages | β | β | β | β | | |
| 50 | 51 | | Notes | β | β | β | β | |
| 51 | 52 | | Student marks | β | β (teacher badge) | β (teacher badge) | β (teacher badge) | |
| 52 | 53 | | Student attendance | β | β (teacher badge) | β (teacher badge) | β (teacher badge) | |
src/components/layout/app-shell.tsxmodified+5 -5
| @@ -31,10 +31,10 @@ export function AppShell(props: ParentProps) { | ||
| 31 | 31 | const path = location().pathname; |
| 32 | 32 | if (path === "/") return t("nav.home"); |
| 33 | 33 | if (path === "/notes") return `${t("nav.group.grades")} / ${t("nav.notes")}`; |
| 34 | - if (path === "/messages") return `${t("nav.group.grades")} / ${t("nav.messages")}`; | |
| 35 | - if (path === "/marks") return `${t("nav.group.grades")} / ${t("nav.marks")}`; | |
| 36 | - if (path === "/attendance") return `${t("nav.group.grades")} / ${t("nav.attendance")}`; | |
| 37 | - if (path === "/pomodoro") return `${t("nav.group.grades")} / ${t("nav.pomodoro")}`; | |
| 34 | + if (path === "/messages") return `${t("nav.group.community")} / ${t("nav.messages")}`; | |
| 35 | + if (path === "/marks") return `${t("nav.group.classes")} / ${t("nav.marks")}`; | |
| 36 | + if (path === "/attendance") return `${t("nav.group.classes")} / ${t("nav.attendance")}`; | |
| 37 | + if (path === "/pomodoro") return `${t("nav.group.classes")} / ${t("nav.pomodoro")}`; | |
| 38 | 38 | if (path === "/courses" || path.startsWith("/courses/")) return `${t("nav.group.classes")} / ${t("nav.courses")}`; |
| 39 | 39 | if (path === "/studies") return `${t("nav.group.classes")} / ${t("nav.studies")}`; |
| 40 | 40 | if (path === "/clubs") return `${t("nav.group.classes")} / ${t("nav.clubs")}`; |
| @@ -45,7 +45,7 @@ export function AppShell(props: ParentProps) { | ||
| 45 | 45 | if (path === "/questions" || path.startsWith("/questions/")) return `${t("nav.group.community")} / ${t("pool.title")}`; |
| 46 | 46 | if (path.startsWith("/exam-room/")) return t("nav.exams"); |
| 47 | 47 | if (path === "/work") return `${t("nav.group.reports")} / ${t("nav.work")}`; |
| 48 | - if (path === "/management/student-marks") return `${t("nav.group.reports")} / ${t("nav.studentMarks")}`; | |
| 48 | + if (path === "/management/student-marks") return `${t("nav.group.classes")} / ${t("nav.studentMarks")}`; | |
| 49 | 49 | if (path === "/management/student-attendance") return `${t("nav.group.reports")} / ${t("nav.studentAttendance")}`; |
| 50 | 50 | if (path === "/management/pomodoros") return `${t("nav.group.reports")} / ${t("nav.studentPomodoro")}`; |
| 51 | 51 | if (path === "/management/staff-work") return `${t("nav.group.reports")} / ${t("nav.staffWork")}`; |
src/components/layout/side-nav.tsxmodified+5 -5
| @@ -67,6 +67,10 @@ const NAV_GROUPS: NavGroup[] = [ | ||
| 67 | 67 | { to: "/exams", labelKey: "nav.exams", Icon: IconExam }, |
| 68 | 68 | { to: "/events", labelKey: "nav.events", Icon: IconCalendar }, |
| 69 | 69 | { to: "/calendar", labelKey: "nav.calendar", Icon: IconCalendarDays }, |
| 70 | + { to: "/marks", labelKey: "nav.marks", Icon: IconChart, exactRole: "student" }, | |
| 71 | + { to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher" }, | |
| 72 | + { to: "/attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, exactRole: "student" }, | |
| 73 | + { to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student" }, | |
| 70 | 74 | ], |
| 71 | 75 | }, |
| 72 | 76 | { |
| @@ -83,10 +87,6 @@ const NAV_GROUPS: NavGroup[] = [ | ||
| 83 | 87 | labelKey: "nav.group.grades", |
| 84 | 88 | Icon: IconChart, |
| 85 | 89 | items: [ |
| 86 | - { to: "/marks", labelKey: "nav.marks", Icon: IconChart, exactRole: "student" }, | |
| 87 | - { to: "/attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, exactRole: "student" }, | |
| 88 | - { to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student" }, | |
| 89 | - { to: "/messages", labelKey: "nav.messages", Icon: IconMessage }, | |
| 90 | 90 | { to: "/notes", labelKey: "nav.notes", Icon: IconNote }, |
| 91 | 91 | ], |
| 92 | 92 | }, |
| @@ -96,7 +96,6 @@ const NAV_GROUPS: NavGroup[] = [ | ||
| 96 | 96 | Icon: IconReportAnalytics, |
| 97 | 97 | minRole: "teacher", |
| 98 | 98 | items: [ |
| 99 | - { to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher" }, | |
| 100 | 99 | { to: "/management/student-attendance", labelKey: "nav.studentAttendance", Icon: IconClipboardCheck, minRole: "teacher" }, |
| 101 | 100 | { to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher" }, |
| 102 | 101 | { to: "/work", labelKey: "nav.work", Icon: IconBriefcase, minRole: "teacher", maxRole: "manager" }, |
| @@ -108,6 +107,7 @@ const NAV_GROUPS: NavGroup[] = [ | ||
| 108 | 107 | labelKey: "nav.group.community", |
| 109 | 108 | Icon: IconGlobe, |
| 110 | 109 | items: [ |
| 110 | + { to: "/messages", labelKey: "nav.messages", Icon: IconMessage }, | |
| 111 | 111 | { to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle }, |
| 112 | 112 | ], |
| 113 | 113 | }, |
src/pages/dashboard-page.tsxmodified+3 -0
| @@ -231,6 +231,7 @@ function DashboardContent() { | ||
| 231 | 231 | { Icon: IconCalendar, titleKey: "nav.events", to: "/events", descKey: "dashboard.portal.eventsDesc", stat: evc }, |
| 232 | 232 | { Icon: IconChart, titleKey: "nav.marks", to: "/marks", descKey: "dashboard.portal.marksDesc", stat: avgLabel() }, |
| 233 | 233 | { Icon: IconClock, titleKey: "nav.pomodoro", to: "/pomodoro", descKey: "dashboard.portal.pomodoroDesc" }, |
| 234 | + { Icon: IconMessage, titleKey: "nav.messages", to: "/messages" }, | |
| 234 | 235 | { Icon: IconNote, titleKey: "nav.notes", to: "/notes", descKey: "dashboard.portal.notesDesc", stat: nc }, |
| 235 | 236 | ); |
| 236 | 237 | return list; |
| @@ -247,6 +248,7 @@ function DashboardContent() { | ||
| 247 | 248 | { Icon: IconClipboardCheck, titleKey: "nav.studentAttendance", to: "/management/student-attendance", descKey: "dashboard.portal.attendanceDesc", minRole: "teacher" }, |
| 248 | 249 | { Icon: IconClock, titleKey: "nav.studentPomodoro", to: "/management/pomodoros", descKey: "dashboard.portal.pomodoroDesc", minRole: "teacher" }, |
| 249 | 250 | { Icon: IconBriefcase, titleKey: "nav.work", to: "/work", descKey: "dashboard.portal.workDesc", minRole: "teacher" }, |
| 251 | + { Icon: IconMessage, titleKey: "nav.messages", to: "/messages" }, | |
| 250 | 252 | { Icon: IconNote, titleKey: "nav.notes", to: "/notes", descKey: "dashboard.portal.notesDesc", stat: nc }, |
| 251 | 253 | ); |
| 252 | 254 | return list; |
| @@ -262,6 +264,7 @@ function DashboardContent() { | ||
| 262 | 264 | { Icon: IconChart, titleKey: "nav.studentMarks", to: "/management/student-marks", descKey: "dashboard.portal.studentMarksDesc", minRole: "teacher" }, |
| 263 | 265 | { Icon: IconClipboardCheck, titleKey: "nav.studentAttendance", to: "/management/student-attendance", descKey: "dashboard.portal.attendanceDesc", minRole: "teacher" }, |
| 264 | 266 | { Icon: IconClock, titleKey: "nav.studentPomodoro", to: "/management/pomodoros", descKey: "dashboard.portal.pomodoroDesc", minRole: "teacher" }, |
| 267 | + { Icon: IconMessage, titleKey: "nav.messages", to: "/messages" }, | |
| 265 | 268 | { Icon: IconNote, titleKey: "nav.notes", to: "/notes", descKey: "dashboard.portal.notesDesc", stat: nc }, |
| 266 | 269 | { Icon: IconSettings, titleKey: "nav.settings", to: "/management/settings", descKey: "dashboard.portal.settingsDesc", minRole: "manager" }, |
| 267 | 270 | { Icon: IconCalendarDays, titleKey: "nav.terms", to: "/management/terms", descKey: "dashboard.portal.termsDesc", minRole: "manager" }, |