Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d8bd7ff
Course page merged with main
LSKpr Apr 9, 2025
05b055d
merge
LSKpr Apr 9, 2025
7aea6a5
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course
LSKpr Apr 9, 2025
1959be8
some styling changes
LSKpr Apr 9, 2025
f1419cb
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course
LSKpr Apr 9, 2025
c3bb2f3
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course
LSKpr Apr 10, 2025
9fdcd04
merge continued
LSKpr Apr 10, 2025
91a8d59
fixed fav item reviews
LSKpr Apr 10, 2025
c6e5aac
working fav drop-down list
LSKpr Apr 11, 2025
d8e4ccb
small fix
LSKpr Apr 11, 2025
53836c4
small fix: clicking the searchbar does close the fav list
LSKpr Apr 11, 2025
63f8ce0
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course in…
LSKpr Apr 11, 2025
d53dfac
crated fav button
LSKpr Apr 11, 2025
9946c23
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course in…
LSKpr Apr 11, 2025
4c9a1f7
small fix
LSKpr Apr 11, 2025
1dade47
before merge with main
LSKpr Apr 16, 2025
80b4da6
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course in…
LSKpr Apr 16, 2025
562c217
added Found courses {num of courses} in the listview
LSKpr Apr 16, 2025
ccfdb06
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course in…
LSKpr Apr 16, 2025
6a17eba
different "Found courses"
LSKpr Apr 16, 2025
0ab7cb2
git aMerge branch 'main' of github.com:InferenceKTH/Find-My-Next-Cour…
LSKpr Apr 16, 2025
2a23b3e
small fixes: prereq tree edges, now you have to click the tree to int…
LSKpr Apr 16, 2025
929ee93
fixed fav list course popup
LSKpr Apr 16, 2025
1705ca4
quick save
LSKpr Apr 16, 2025
037dd0a
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course in…
LSKpr Apr 16, 2025
78c8ca7
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course in…
LSKpr Apr 16, 2025
682d510
small fixes/features
LSKpr Apr 16, 2025
dc4e519
before merge
LSKpr Apr 17, 2025
e817940
Merge branch 'main' of github.com:InferenceKTH/Find-My-Next-Course in…
LSKpr Apr 17, 2025
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
76 changes: 62 additions & 14 deletions my-app/src/views/Components/CoursePagePopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ function CoursePagePopup({

if (!isOpen || !course) return null;

console.log(course); ``
return (
<div

className="fixed backdrop-blur-sm inset-0 bg-transparent flex justify-end z-50"
onClick={onClose}
>
Expand All @@ -71,7 +73,16 @@ function CoursePagePopup({
{/* Course Title Section */}
<div>
<h2 className="text-5xl font-extrabold text-[#2e2e4f]">
<span className="text-violet-700">{course.code}</span> - {course.name}
<a
href={`https://www.kth.se/student/kurser/kurs/${course.code}`}
target="_blank"
rel="noopener noreferrer"
className="hover:text-violet-600 transition-colors duration-300"
>
<span className="text-violet-700 ">{course.code}</span>
{' '}- {' '}
{course.name}
</a>
<span className="ml-4 text-lg text-violet-700 whitespace-nowrap">
({course.credits} Credits)
</span>
Expand All @@ -81,13 +92,12 @@ function CoursePagePopup({
<div className="flex justify-between items-center">
<button
className={`inline-flex items-center px-4 py-2 gap-2 rounded-lg
transition-all duration-300 ease-in-out
font-semibold text-sm shadow-sm
${
favouriteCourses.some((fav) => fav.code === course.code)
? 'bg-yellow-400/90 hover:bg-yellow-500/90 border-2 border-yellow-600 hover:border-yellow-700 text-yellow-900'
transition-all duration-300 ease-in-out
font-semibold text-sm shadow-sm
${favouriteCourses.some((fav) => fav.code === course.code)
? 'bg-yellow-400 /90 hover:bg-yellow-500/90 border-2 border-yellow-600 hover:border-yellow-700 text-yellow-900'
: 'bg-yellow-200/90 hover:bg-yellow-300 border-2 border-yellow-400 hover:border-yellow-500 text-yellow-600 hover:text-yellow-700'
}`}
}`}
onClick={(e) => {
e.stopPropagation();
handleFavouriteClick(course);
Expand Down Expand Up @@ -142,13 +152,34 @@ function CoursePagePopup({
</div>

{/* Description Section */}
{course.description &&
course.description.trim() &&
course.description.trim() !== "null" && (
<div>
<h3 className="text-2xl font-bold text-[#2e2e4f] mb-0.5">Course Description</h3>
<div className="mb-3 h-0.5 w-full bg-violet-500"></div>
<div
className="text-lg leading-8 text-[#2e2e4f] font-semibold tracking-wide prose prose-slate max-w-full"
dangerouslySetInnerHTML={{ __html: course.description }}
/>
</div>
)}

{/* Learning outcomes */}
<div>
<h3 className="text-2xl font-bold text-[#2e2e4f] mb-0.5">Course Description</h3>
<h3 className="text-2xl font-bold text-[#2e2e4f] mb-0.5">Learning Outcomes:</h3>
<div className="mb-3 h-0.5 w-full bg-violet-500"></div>
<div
className="text-lg leading-8 text-[#2e2e4f] font-semibold tracking-wide prose prose-slate max-w-full"
dangerouslySetInnerHTML={{ __html: course.description }}
/>
{course.learning_outcomes && course.learning_outcomes.trim() &&
course.description.trim() !== "null" ? (
<div
className="text-lg leading-8 text-[#2e2e4f] font-semibold tracking-wide prose prose-slate max-w-full"
dangerouslySetInnerHTML={{ __html: course.learning_outcomes }}
/>
) : (
<p className="text-lg text-[#2e2e4f] font-semibold italic">
No learning outcomes information available
</p>
)}
</div>
{/* Prerequisite Graph Tree Section */}
<div>
Expand All @@ -157,12 +188,13 @@ function CoursePagePopup({
<div className="relative rounded-lg">
{showOverlay && (
<div
className="absolute inset-0 z-10 bg-indigo-200/10 rounded-lg cursor-pointer flex items-center justify-center z-51"
className="absolute inset-0 z-10 bg-indigo-200/10 rounded-lg cursor-pointer flex items-center justify-center z-51"
onClick={(e) => {
e.stopPropagation();
setShowOverlay(false);
}}
></div>
>
</div>
)}
<div
className="bg-indigo-300/50 outline-none focus:outline-none focus:ring-2 focus:ring-violet-600 rounded-lg transition-shadow"
Expand All @@ -174,6 +206,22 @@ function CoursePagePopup({
</div>
</div>
</div>
{/* Prereq Section */}
<div>
<h3 className="text-2xl font-bold text-[#2e2e4f] mb-0.5">Prerequisites:</h3>
<div className="mb-3 h-0.5 w-full bg-violet-500"></div>
{course.prerequisites_text && course.prerequisites_text.trim() &&
course.description.trim() !== "null" ? (
<div
className="text-lg leading-8 text-[#2e2e4f] font-semibold tracking-wide prose prose-slate max-w-full"
dangerouslySetInnerHTML={{ __html: course.prerequisites_text }}
/>
) : (
<p className="text-lg text-[#2e2e4f] font-semibold italic">
Prerequisites information not available
</p>
)}
</div>
{/* Reviews Section (optional) */}
{reviewPresenter && (
<div>
Expand Down
2 changes: 1 addition & 1 deletion my-app/src/views/ListView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function ListView(props) {
dangerouslySetInnerHTML={{
__html: readMore[course.code]
? course.description
: course.description.slice(0, 150),
: (course.description.slice(0, 200)+"..."),
}}
/>
{course.description.length > 150 && (
Expand Down
Loading