From 331087fb61955c1d2dbbbbe1d69405885a325e4f Mon Sep 17 00:00:00 2001 From: taf <75897907+tashifkhan@users.noreply.github.com> Date: Sat, 4 Jan 2025 04:24:52 +0530 Subject: [PATCH 001/433] Update readme.md --- readme.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index a243177..ccea2d3 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,8 @@ # Time Table Python Creator +
+ try it out +
This is a Flask-based web application that simplifies the process of creating and managing time tables. The application allows users to upload their time table files in various formats (CSV, XLSX, XLS, PDF) and generates a simplified schedule (you can download it too). Additionally, it provides an option to select electives and integrates with Google Calendar to add events. ## Features @@ -14,8 +17,8 @@ This is a Flask-based web application that simplifies the process of creating an 1. Clone the repository: ```sh - git clone https://github.com/yourusername/time-table-python-creator.git - cd time-table-python-creator + git clone https://github.com/tashifkhan/JIIT-time-table-parser + cd JIIT-time-table-parser ``` 2. Create a virtual environment and activate it: @@ -65,3 +68,8 @@ This is a Flask-based web application that simplifies the process of creating an - [Flask](https://flask.palletsprojects.com/) - [Google Calendar API](https://developers.google.com/calendar) - [html2canvas](https://html2canvas.hertzen.com/) + + +## Work In Progress +- 4th year table not handelled yet (double entries beacuse of 2 slots availble) +- google calender integration in works From 56d22fb051d2bf19fc0925f9520fdcd32a4826ac Mon Sep 17 00:00:00 2001 From: taf <75897907+tashifkhan@users.noreply.github.com> Date: Sat, 4 Jan 2025 04:25:21 +0530 Subject: [PATCH 002/433] Update readme.md --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index ccea2d3..e8681f8 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,9 @@ # Time Table Python Creator
- try it out + hosted here
+ This is a Flask-based web application that simplifies the process of creating and managing time tables. The application allows users to upload their time table files in various formats (CSV, XLSX, XLS, PDF) and generates a simplified schedule (you can download it too). Additionally, it provides an option to select electives and integrates with Google Calendar to add events. ## Features From add6c5cae0c481662d7225713b0815e69652d479 Mon Sep 17 00:00:00 2001 From: taf <75897907+tashifkhan@users.noreply.github.com> Date: Sat, 4 Jan 2025 04:25:58 +0530 Subject: [PATCH 003/433] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e8681f8..8b959dd 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ # Time Table Python Creator
- hosted here + 🤡 hosted here 🤡
This is a Flask-based web application that simplifies the process of creating and managing time tables. The application allows users to upload their time table files in various formats (CSV, XLSX, XLS, PDF) and generates a simplified schedule (you can download it too). Additionally, it provides an option to select electives and integrates with Google Calendar to add events. From 929acae206e9261fe839296f6ef858360001a05e Mon Sep 17 00:00:00 2001 From: taf <75897907+tashifkhan@users.noreply.github.com> Date: Sat, 4 Jan 2025 04:26:20 +0530 Subject: [PATCH 004/433] Update readme.md --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 8b959dd..4cad14e 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ # Time Table Python Creator -
- 🤡 hosted here 🤡 +
+ hosted here 🤡
This is a Flask-based web application that simplifies the process of creating and managing time tables. The application allows users to upload their time table files in various formats (CSV, XLSX, XLS, PDF) and generates a simplified schedule (you can download it too). Additionally, it provides an option to select electives and integrates with Google Calendar to add events. From 7bd1a5214a7608398ca0e4d06ccaf5186fb754f8 Mon Sep 17 00:00:00 2001 From: taf <75897907+tashifkhan@users.noreply.github.com> Date: Sat, 4 Jan 2025 05:50:49 +0530 Subject: [PATCH 005/433] Update README.md --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1c05e65..b2ab5f5 100644 --- a/README.md +++ b/README.md @@ -57,22 +57,22 @@ Welcome to the JIIT Personalized Schedule Creator, a Next.js + Flask-based appli 1. Clone the repository and navigate: - ```bash - git clone https://github.com/your-username/jiit-schedule-creator.git - cd jiit-schedule-creator/backend - ``` + ```bash + git clone https://github.com/your-username/jiit-schedule-creator.git + cd jiit-schedule-creator/backend + ``` 2. Install dependencies: - ```bash - npm install - ``` + ```bash + npm install + ``` 3. Run the development server: - ```bash - npm run dev - ``` + ```bash + npm run dev + ``` Frontend runs at: `http://localhost:3000` @@ -94,9 +94,9 @@ We welcome contributions to enhance this project! 1. Fork the repository. 2. Create a new branch: - ```bash - git checkout -b feature-name - ``` +```bash +git checkout -b feature-name +``` 3. Commit changes and create a pull request. From 2f3fb7c1a0e4ce941cb4578a43afed4a28bd0213 Mon Sep 17 00:00:00 2001 From: taf <75897907+tashifkhan@users.noreply.github.com> Date: Sat, 4 Jan 2025 05:51:11 +0530 Subject: [PATCH 006/433] Update README.md --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b2ab5f5..6a06ee2 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,11 @@ Welcome to the JIIT Personalized Schedule Creator, a Next.js + Flask-based appli ## Installation 1. Clone the repository and navigate: - - ```bash - git clone https://github.com/your-username/jiit-schedule-creator.git - cd jiit-schedule-creator/backend - ``` + + ```bash + git clone https://github.com/your-username/jiit-schedule-creator.git + cd jiit-schedule-creator/backend + ``` 2. Install dependencies: @@ -70,9 +70,9 @@ Welcome to the JIIT Personalized Schedule Creator, a Next.js + Flask-based appli 3. Run the development server: - ```bash - npm run dev - ``` + ```bash + npm run dev + ``` Frontend runs at: `http://localhost:3000` @@ -94,9 +94,9 @@ We welcome contributions to enhance this project! 1. Fork the repository. 2. Create a new branch: -```bash -git checkout -b feature-name -``` + ```bash + git checkout -b feature-name + ``` 3. Commit changes and create a pull request. From 864db0fba936c7946ed475fa41fce552281259f1 Mon Sep 17 00:00:00 2001 From: Tashif Ahmad Khan Date: Sat, 4 Jan 2025 05:58:02 +0530 Subject: [PATCH 007/433] shadcn --- components.json | 20 ++ components/ui/form.tsx | 179 ++++++++++++++++++ components/ui/label.tsx | 26 +++ components/ui/toast.tsx | 129 +++++++++++++ hooks/use-toast.ts | 191 +++++++++++++++++++ lib/utils.ts | 6 + package-lock.json | 395 +++++++++++++++++++++++++++++++++++++++- package.json | 17 +- 8 files changed, 954 insertions(+), 9 deletions(-) create mode 100644 components.json create mode 100644 components/ui/form.tsx create mode 100644 components/ui/label.tsx create mode 100644 components/ui/toast.tsx create mode 100644 hooks/use-toast.ts create mode 100644 lib/utils.ts diff --git a/components.json b/components.json new file mode 100644 index 0000000..c597462 --- /dev/null +++ b/components.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + } +} diff --git a/components/ui/form.tsx b/components/ui/form.tsx new file mode 100644 index 0000000..b9fb860 --- /dev/null +++ b/components/ui/form.tsx @@ -0,0 +1,179 @@ +'use client'; + +import * as React from 'react'; +import * as LabelPrimitive from '@radix-ui/react-label'; +import { Slot } from '@radix-ui/react-slot'; +import { + Controller, + ControllerProps, + FieldPath, + FieldValues, + FormProvider, + useFormContext, +} from 'react-hook-form'; + +import { cn } from '@/lib/utils'; +import { Label } from '@/components/ui/label'; + +const Form = FormProvider; + +type FormFieldContextValue< + TFieldValues extends FieldValues = FieldValues, + TName extends FieldPath = FieldPath +> = { + name: TName; +}; + +const FormFieldContext = React.createContext( + {} as FormFieldContextValue +); + +const FormField = < + TFieldValues extends FieldValues = FieldValues, + TName extends FieldPath = FieldPath +>({ + ...props +}: ControllerProps) => { + return ( + + + + ); +}; + +const useFormField = () => { + const fieldContext = React.useContext(FormFieldContext); + const itemContext = React.useContext(FormItemContext); + const { getFieldState, formState } = useFormContext(); + + const fieldState = getFieldState(fieldContext.name, formState); + + if (!fieldContext) { + throw new Error('useFormField should be used within '); + } + + const { id } = itemContext; + + return { + id, + name: fieldContext.name, + formItemId: `${id}-form-item`, + formDescriptionId: `${id}-form-item-description`, + formMessageId: `${id}-form-item-message`, + ...fieldState, + }; +}; + +type FormItemContextValue = { + id: string; +}; + +const FormItemContext = React.createContext( + {} as FormItemContextValue +); + +const FormItem = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => { + const id = React.useId(); + + return ( + +
+ + ); +}); +FormItem.displayName = 'FormItem'; + +const FormLabel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => { + const { error, formItemId } = useFormField(); + + return ( +
) : ( -
-
- - - - - - - - - - - - {Object.entries(compareResult.classes_together).flatMap( - ([day, slots], dayIndex) => - Object.entries(slots as any).map(([time, info]: [string, any], timeIndex) => ( - - - - - - - - )) - )} - -
DayTime SlotSubjectTypeLocation
{day} +
+ {(() => { + // Define day order for proper sorting + const dayOrder = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; + + // Sort days according to the defined order + const sortedDays = Object.keys(compareResult.classes_together).sort((a, b) => { + const aIndex = dayOrder.indexOf(a); + const bIndex = dayOrder.indexOf(b); + return aIndex - bIndex; + }); + + return sortedDays.map((day) => { + const daySlots = compareResult.classes_together[day] as any; + // Sort time slots within each day + const sortedTimeSlots = Object.entries(daySlots).sort(([timeA], [timeB]) => { + // Extract start time (e.g., "09:00-09:50" -> "09:00") + const startTimeA = timeA.split('-')[0]; + const startTimeB = timeB.split('-')[0]; + return startTimeA.localeCompare(startTimeB); + }); + + return ( +
+
+

{day}

+
+
+ {sortedTimeSlots.map(([time, info]: [string, any]) => ( +
+
{time} -
{info.subject_name} + {info.subject_name} + +
{ }`}> {info.type === 'L' ? 'Lecture' : info.type === 'T' ? 'Tutorial' : info.type === 'P' ? 'Practical' : info.type} -
{info.location}
-
+ {info.location} +
+
+ ))} + + + ); + }); + })()} )} From cbcfe3e8a981d6c7ca6b37e5ad44b0f76dc18980 Mon Sep 17 00:00:00 2001 From: Tashif Ahmad Khan Date: Sat, 19 Jul 2025 23:47:19 +0530 Subject: [PATCH 209/433] shadcn selector --- src/components/compare-timetable.tsx | 87 +++++++++++++++++----------- 1 file changed, 53 insertions(+), 34 deletions(-) diff --git a/src/components/compare-timetable.tsx b/src/components/compare-timetable.tsx index 0d1ce81..bd026e3 100644 --- a/src/components/compare-timetable.tsx +++ b/src/components/compare-timetable.tsx @@ -8,6 +8,13 @@ import { usePyodideStatus, } from "../utils/pyodide"; import { Button } from "./ui/button"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "./ui/select"; import type { PyodideInterface } from "pyodide"; import { SubjectSelector, Subject } from "./schedule-form"; @@ -165,33 +172,39 @@ const CompareTimetablePage: React.FC = () => { - + + + + + Campus 62 + Campus 128 + +
- + + + + + 1st Year + 2nd Year + 3rd Year + 4th Year + +
- + + + + + 1st Year + 2nd Year + 3rd Year + 4th Year + +