Skip to content

Commit

Permalink
Add courseName
Browse files Browse the repository at this point in the history
  • Loading branch information
erlhol committed Aug 26, 2023
1 parent f7543ce commit 7168f03
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions javascripts/data/course.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export class Course {
constructor(code, description, level= "", credits="", teaching="", examdate="", teachingLanguage = "",about="", courseActivities=null) {
constructor(code, name, level= "", credits="", teaching="", examdate="", teachingLanguage = "",description="", courseActivities=null) {
this.code = code;
this.description = description;
this.name = name;
this.level = level; // Bachelor or Master
this.credits = credits;
this.teaching = teaching; // Spring or Autumn
this.examdate = examdate;
this.teachingLanguage = teachingLanguage;
this.about = about;
this.description = description;
this.courseActivities = courseActivities;
}

Expand Down
6 changes: 5 additions & 1 deletion javascripts/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default class CourseView {
courseTitle.textContent = courseObject.code;
newCourseDiv.appendChild(courseTitle);

var courseName = document.createElement("h2");
courseName.textContent = courseObject.name;
newCourseDiv.appendChild(courseName);

// Create and append the first <p> element for the course details
var courseDetails = document.createElement("p");
courseDetails.innerHTML =
Expand All @@ -45,7 +49,7 @@ export default class CourseView {

// Create and append the second <p> element for the course description
var courseDescription = document.createElement("p");
courseDescription.textContent = courseObject.about;
courseDescription.textContent = courseObject.description;
newCourseDiv.appendChild(courseDescription);

// Append the new course <div> to the body of the document
Expand Down
6 changes: 3 additions & 3 deletions stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ th {
.course {
background-color: #ffffff;
border-radius: 8px;
padding: 40px;
padding: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 30px;
margin-bottom: 10px;
}

.course h1 {
Expand All @@ -88,7 +88,7 @@ th {
.course-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 50px;
gap: 20px;
}

.chosen {
Expand Down

0 comments on commit 7168f03

Please sign in to comment.