Skip to content

added compatibility for sections to course search #17

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions class_registration_app/src/components/CourseSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface CourseInfo {
MaxStudents: number;
StudentsEnrolled: number;
Prerequisites: string;
Section: string; // added for section
}
function handleSearch() {
Expand Down Expand Up @@ -50,6 +51,7 @@ function handleSearch() {
let course_professor = document.createElement('h2');
let course_space = document.createElement('h2');
let course_prerequisites = document.createElement('h2');
let course_section = document.createElement('h2'); // for course sections
// Set class or any other attributes for the div
div.className = "course-list-item"; // You can set class name here
Expand Down Expand Up @@ -77,12 +79,16 @@ function handleSearch() {
course_prerequisites.className = "course-prerequisites";
course_prerequisites.textContent = "Prerequisites: " + Course.Prerequisites;
course_section.className = "course-section";
course_section.textContent = "Section: " + Course.Section;
// Append the div to the container
if (container != null){
container.appendChild(div);
div.appendChild(course_name);
div.appendChild(course_location);
div.appendChild(course_section);
div.appendChild(course_status);
div.appendChild(document.createElement('br'));
div.appendChild(course_professor);
Expand Down