Skip to content

Commit

Permalink
Merge pull request #17 from zjf19002/nic21003_experimental
Browse files Browse the repository at this point in the history
added compatibility for sections to course search
  • Loading branch information
nic21003 authored Nov 13, 2023
2 parents 5b6254c + 8770a4b commit cdbd45a
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit cdbd45a

Please sign in to comment.