From 3e1255745165a4c9d11cfb807a59a34e10a1bc94 Mon Sep 17 00:00:00 2001 From: dpalou Date: Mon, 8 Oct 2018 12:21:16 +0200 Subject: [PATCH 1/2] MOBILE-2661 course: Display empty sections --- src/core/course/components/format/core-course-format.html | 2 +- src/core/course/components/format/format.ts | 4 ++-- src/core/course/pages/section-selector/section-selector.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/course/components/format/core-course-format.html b/src/core/course/components/format/core-course-format.html index 4b244729d..0094c019a 100644 --- a/src/core/course/components/format/core-course-format.html +++ b/src/core/course/components/format/core-course-format.html @@ -69,7 +69,7 @@ -
+
diff --git a/src/core/course/components/format/format.ts b/src/core/course/components/format/format.ts index 87f516cd1..57e16e51a 100644 --- a/src/core/course/components/format/format.ts +++ b/src/core/course/components/format/format.ts @@ -262,14 +262,14 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { let j; for (j = i - 1; j >= 1; j--) { - if (this.sections[j].uservisible !== false && this.sections[j].hasContent) { + if (this.sections[j].uservisible !== false && !this.sections[j].hiddenbynumsections) { break; } } this.previousSection = j >= 1 ? this.sections[j] : null; for (j = i + 1; j < this.sections.length; j++) { - if (this.sections[j].uservisible !== false && this.sections[j].hasContent) { + if (this.sections[j].uservisible !== false && !this.sections[j].hiddenbynumsections) { break; } } diff --git a/src/core/course/pages/section-selector/section-selector.html b/src/core/course/pages/section-selector/section-selector.html index a1d6acde4..a3076b1a1 100644 --- a/src/core/course/pages/section-selector/section-selector.html +++ b/src/core/course/pages/section-selector/section-selector.html @@ -10,7 +10,7 @@ - +

{{ 'core.course.hiddenfromstudents' | translate }} From 2135cdee7b73dbca75da4f7da56df999886fcb0d Mon Sep 17 00:00:00 2001 From: dpalou Date: Mon, 8 Oct 2018 13:18:40 +0200 Subject: [PATCH 2/2] MOBILE-2661 course: Don't display hidden warnings if not needed --- src/core/course/components/format/core-course-format.html | 2 +- src/core/course/components/module/core-course-module.html | 4 ++-- src/core/course/components/module/module.ts | 1 + src/core/sitehome/components/index/core-sitehome-index.html | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/course/components/format/core-course-format.html b/src/core/course/components/format/core-course-format.html index 0094c019a..c70ec5eb3 100644 --- a/src/core/course/components/format/core-course-format.html +++ b/src/core/course/components/format/core-course-format.html @@ -82,7 +82,7 @@ - +
diff --git a/src/core/course/components/module/core-course-module.html b/src/core/course/components/module/core-course-module.html index 1f815d2ed..9ab0f394b 100644 --- a/src/core/course/components/module/core-course-module.html +++ b/src/core/course/components/module/core-course-module.html @@ -30,11 +30,11 @@ -
+
- {{ 'core.course.hiddenfromstudents' | translate }} + {{ 'core.course.hiddenfromstudents' | translate }} {{ 'core.course.hiddenoncoursepage' | translate }} {{ 'core.course.manualcompletionnotsynced' | translate }} diff --git a/src/core/course/components/module/module.ts b/src/core/course/components/module/module.ts index 1690ed303..c534cd380 100644 --- a/src/core/course/components/module/module.ts +++ b/src/core/course/components/module/module.ts @@ -36,6 +36,7 @@ import { CoreConstants } from '../../../constants'; export class CoreCourseModuleComponent implements OnInit, OnDestroy { @Input() module: any; // The module to render. @Input() courseId: number; // The course the module belongs to. + @Input() section: any; // The section the module belongs to. @Input('downloadEnabled') set enabled(value: boolean) { this.downloadEnabled = value; diff --git a/src/core/sitehome/components/index/core-sitehome-index.html b/src/core/sitehome/components/index/core-sitehome-index.html index 5b3bfe753..80850db1f 100644 --- a/src/core/sitehome/components/index/core-sitehome-index.html +++ b/src/core/sitehome/components/index/core-sitehome-index.html @@ -7,7 +7,7 @@ - + @@ -29,7 +29,7 @@ - +