From 1b573206541792d09168bc49177c734e053002f5 Mon Sep 17 00:00:00 2001 From: druid <druid@druids-MacBook-Pro-2.local> Date: Mon, 1 Feb 2021 10:45:46 +0200 Subject: [PATCH] Show the coordinating organisation in the realisation description (after the learning method) --- src/components.d.ts | 2 ++ .../hy-content-list-item.tsx | 18 +++++++++++++++--- .../courses/hy-content-list-item/readme.md | 1 + .../hy-content-list/hy-content-list.tsx | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/components.d.ts b/src/components.d.ts index ed8f66b6..a72989e4 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -254,6 +254,7 @@ export namespace Components { courseEnrollmentLink?: string; courseLinkLabel?: string; courseName?: string; + courseOrganisation?: string; courseStartDate?: string; courseStudyFormat?: string; courseTags: TagValue[] | string; @@ -1540,6 +1541,7 @@ declare namespace LocalJSX { courseEnrollmentLink?: string; courseLinkLabel?: string; courseName?: string; + courseOrganisation?: string; courseStartDate?: string; courseStudyFormat?: string; courseTags?: TagValue[] | string; diff --git a/src/components/courses/hy-content-list-item/hy-content-list-item.tsx b/src/components/courses/hy-content-list-item/hy-content-list-item.tsx index 3df481f1..5ccfb496 100644 --- a/src/components/courses/hy-content-list-item/hy-content-list-item.tsx +++ b/src/components/courses/hy-content-list-item/hy-content-list-item.tsx @@ -24,6 +24,7 @@ export class HyContentLstItem { @Prop() courseStartDate?: string; @Prop() courseEndDate?: string; @Prop() courseStudyFormat?: string; + @Prop() courseOrganisation?: string; @Prop() courseEnrollmentLink?: string; @Prop() courseTeachingLanguage?: string; @Prop() courseLinkLabel?: string; @@ -77,9 +78,20 @@ export class HyContentLstItem { <div class="hy-content-list-item--metadata--item hy-content-list-item--metadata--item--first"> <span>{this._dateValue}</span> </div> - <div class="hy-content-list-item--metadata--item hy-content-list-item--metadata--item--last"> - <span>{this.courseStudyFormat}</span> - </div> + {this.courseOrganisation + ? [ + <div class="hy-content-list-item--metadata--item"> + <span>{this.courseStudyFormat}</span> + </div>, + <div class="hy-content-list-item--metadata--item hy-content-list-item--metadata--item--last"> + <span>{this.courseOrganisation}</span> + </div>, + ] + : [ + <div class="hy-content-list-item--metadata--item hy-content-list-item--metadata--item--last"> + <span>{this.courseStudyFormat}</span> + </div>, + ]} </div> {this._courseTags && ( <div class="hy-content-list-item--tags"> diff --git a/src/components/courses/hy-content-list-item/readme.md b/src/components/courses/hy-content-list-item/readme.md index 18e03395..c9603f4a 100644 --- a/src/components/courses/hy-content-list-item/readme.md +++ b/src/components/courses/hy-content-list-item/readme.md @@ -12,6 +12,7 @@ | `courseEnrollmentLink` | `course-enrollment-link` | | `string` | `undefined` | | `courseLinkLabel` | `course-link-label` | | `string` | `undefined` | | `courseName` | `course-name` | | `string` | `undefined` | +| `courseOrganisation` | `course-organisation` | | `string` | `undefined` | | `courseStartDate` | `course-start-date` | | `string` | `undefined` | | `courseStudyFormat` | `course-study-format` | | `string` | `undefined` | | `courseTags` | `course-tags` | | `TagValue[] \| string` | `undefined` | diff --git a/src/components/courses/hy-content-list/hy-content-list.tsx b/src/components/courses/hy-content-list/hy-content-list.tsx index 10cf3f2a..c2f0551c 100644 --- a/src/components/courses/hy-content-list/hy-content-list.tsx +++ b/src/components/courses/hy-content-list/hy-content-list.tsx @@ -47,6 +47,7 @@ export class HyContentList implements ComponentInterface { } let courseTagsJSON = JSON.stringify(courseTags); + // Course realisations if (courseItem['realisations']) { let realisations = JSON.parse(JSON.stringify(courseItem['realisations'])); for (let realisationProperty in realisations) { @@ -59,6 +60,7 @@ export class HyContentList implements ComponentInterface { let courseEndDate = realizationItem['endDate']; let courseEnrollmentLink = realizationItem['enrolmentLink']; let courseTeachingLanguage = realizationItem['teachingLanguage']; + let courseOrganisation = realizationItem['organisation']; const contentListItemClassAttributes = ['item', this.variant].join(' '); @@ -74,6 +76,7 @@ export class HyContentList implements ComponentInterface { course-start-date={courseStartDate} course-end-date={courseEndDate} course-study-format={courseStudyFormat} + course-organisation={courseOrganisation} course-enrollment-link={courseEnrollmentLink} course-teaching-language={courseTeachingLanguage} course-link-label={this.linkLabel} -- GitLab