diff --git a/scripts/langindex.json b/scripts/langindex.json index 0b8edb055..4edb31980 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1549,6 +1549,7 @@ "core.course.downloadcourse": "tool_mobile", "core.course.downloadcoursesprogressdescription": "local_moodlemobileapp", "core.course.downloadsectionprogressdescription": "local_moodlemobileapp", + "core.course.enddate": "moodle", "core.course.errordownloadingcourse": "local_moodlemobileapp", "core.course.errordownloadingsection": "local_moodlemobileapp", "core.course.errorgetmodule": "local_moodlemobileapp", @@ -1568,6 +1569,7 @@ "core.course.overriddennotice": "grades", "core.course.refreshcourse": "local_moodlemobileapp", "core.course.section": "moodle", + "core.course.startdate": "moodle", "core.course.thisweek": "format_weeks/currentsection", "core.course.todo": "completion", "core.course.useactivityonbrowser": "local_moodlemobileapp", diff --git a/src/core/features/course/lang.json b/src/core/features/course/lang.json index 4fddbfd81..36f792de9 100644 --- a/src/core/features/course/lang.json +++ b/src/core/features/course/lang.json @@ -32,6 +32,7 @@ "downloadcourse": "Download course", "downloadcoursesprogressdescription": "Downloading courses: downloaded {{count}} out of {{total}}.", "downloadsectionprogressdescription": "Downloading section: downloaded {{count}} out of {{total}}.", + "enddate": "Course end date", "errordownloadingcourse": "Error downloading course.", "errordownloadingsection": "Error downloading section.", "errorgetmodule": "Error getting activity data.", @@ -51,6 +52,7 @@ "overriddennotice": "Your final grade from this activity was manually adjusted.", "refreshcourse": "Refresh course", "section": "Section", + "startdate": "Course start date", "thisweek": "This week", "todo": "To do", "useactivityonbrowser": "You can still use it using your device's web browser.", diff --git a/src/core/features/course/pages/preview/preview.html b/src/core/features/course/pages/preview/preview.html index 2bb64554c..56baec734 100644 --- a/src/core/features/course/pages/preview/preview.html +++ b/src/core/features/course/pages/preview/preview.html @@ -8,7 +8,7 @@ {{'core.course.coursesummary' | translate}} - + @@ -34,18 +34,27 @@ -

- {{course.startdate * 1000 | coreFormatDate:"strftimedatefullshort" }} - - {{course.enddate * 1000 | coreFormatDate:"strftimedatefullshort" }} -

+
+
+

+ + {{ 'core.course.startdate' | translate }}: {{ course.startdate * 1000 | + coreFormatDate:'strftimedatefullshort' }} +

+

+ + {{ 'core.course.enddate' | translate }}: {{ course.enddate * 1000 | + coreFormatDate:'strftimedatefullshort' }} +

+
- + @@ -62,7 +71,7 @@ -

{{ 'core.teachers' | translate }}

+

{{ 'core.teachers' | translate }}

- +

{{ 'core.courses.otherenrolments' | translate }}

@@ -132,7 +141,7 @@ - + {{ 'core.course' | translate }} diff --git a/src/core/features/course/pages/preview/preview.page.ts b/src/core/features/course/pages/preview/preview.page.ts index f269e84c3..e53981367 100644 --- a/src/core/features/course/pages/preview/preview.page.ts +++ b/src/core/features/course/pages/preview/preview.page.ts @@ -56,7 +56,7 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy { selfEnrolInstances: CoreCourseEnrolmentMethod[] = []; paypalEnabled = false; dataLoaded = false; - avoidOpenCourse = false; + isModal = false; courseUrl = ''; courseImageUrl?: string; @@ -110,7 +110,7 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy { this.course = CoreNavigator.getRouteParam('course'); } else { // Opened as a modal. - this.avoidOpenCourse = true; + this.isModal = true; } const currentSiteUrl = CoreSites.getRequiredCurrentSite().getURL(); @@ -256,7 +256,7 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy { * @param replaceCurrentPage If current place should be replaced in the navigation stack. */ openCourse(replaceCurrentPage = false): void { - if (!this.canAccessCourse || !this.course || this.avoidOpenCourse) { + if (!this.canAccessCourse || !this.course || this.isModal) { return; } diff --git a/src/core/features/course/pages/preview/preview.scss b/src/core/features/course/pages/preview/preview.scss index ae3a0347f..0386bcac6 100644 --- a/src/core/features/course/pages/preview/preview.scss +++ b/src/core/features/course/pages/preview/preview.scss @@ -1,8 +1,9 @@ +@import '~theme/globals.scss'; + :host { .core-course-thumb { overflow: hidden; text-align: center; - height: 40vw; max-height: 35vh; z-index: -1; overflow: hidden; @@ -13,4 +14,15 @@ .core-customfieldvalue core-format-text { display: inline; } + + .core-course-dates { + background: var(--light); + border-radius: var(--small-radius); + padding: 8px; + + ion-icon { + @include margin-horizontal(null, 8px); + } + } + }