From 8a2160db17728734d73512ffc0a65aedfb47558e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 9 Aug 2018 15:49:06 +0200 Subject: [PATCH 1/2] MOBILE-2481 courses: Highlight section selector --- src/addon/files/pages/list/list.html | 2 +- src/app/app.scss | 42 ++++++++++++++++++- src/core/course/components/format/format.scss | 20 +++++++-- src/core/course/components/module/module.scss | 6 +-- .../pages/my-overview/my-overview.html | 8 ++-- 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/src/addon/files/pages/list/list.html b/src/addon/files/pages/list/list.html index 596171161..791a6d6db 100644 --- a/src/addon/files/pages/list/list.html +++ b/src/addon/files/pages/list/list.html @@ -10,7 +10,7 @@ -
+
{{ 'addon.files.privatefiles' | translate }} {{ 'addon.files.sitefiles' | translate }} diff --git a/src/app/app.scss b/src/app/app.scss index 921809f76..6f2aa9226 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -402,7 +402,7 @@ ion-card core-format-text img { // Ionic fix. Button can occupy all page if not. ion-select { - position: relative + position: relative; } ion-col ion-select { @@ -415,12 +415,52 @@ ion-col ion-select { } } + +:not(.item) ion-select, .core-button-select { + background-color: white; + color: $core-color; + white-space: normal; + align-self: start; + max-width: none; + + &.select-md, + &.button-md { + background: $card-md-background-color; + box-shadow: $card-md-box-shadow; + } + + &.select-ios, + &.button-ios { + background: $card-ios-background-color; + box-shadow: $card-ios-box-shadow; + } + + &.select-wp, + &.button-wp { + background: $card-wp-background-color; + box-shadow: $card-wp-box-shadow; + } + + .select-text { + white-space: normal; + } + + .button-inner { + justify-content: space-between; + } + + .select-icon .select-icon-inner { + color: $core-color; + } + ion-icon:last-child { @include margin(null, null, null, 5px); } } + + // File uploader. // ------------------------- diff --git a/src/core/course/components/format/format.scss b/src/core/course/components/format/format.scss index 9421b30a4..fd34053d6 100644 --- a/src/core/course/components/format/format.scss +++ b/src/core/course/components/format/format.scss @@ -9,6 +9,22 @@ core-course-format { .core-format-progress-list { margin-bottom: 0; + + .item { + background: transparent; + + .label { + margin-top: 0; + margin-bottom: 0; + } + + progress { + .progress-bar-fallback, + &[value]::-webkit-progress-bar { + background-color: $white; + } + } + } } .core-course-thumb { @@ -40,7 +56,3 @@ core-course-format { } } } - -.core-section-select { - width: 100%; -} diff --git a/src/core/course/components/module/module.scss b/src/core/course/components/module/module.scss index fcc1b07d7..9e1febfad 100644 --- a/src/core/course/components/module/module.scss +++ b/src/core/course/components/module/module.scss @@ -57,7 +57,7 @@ core-course-module { padding-right: $label-md-margin-end; margin-bottom: $label-md-margin-bottom; - .core-module-description .core-show-more { + .core-show-more { padding-right: $label-md-margin-end; } } @@ -87,7 +87,7 @@ core-course-module { padding-right: $label-ios-margin-end; margin-bottom: $label-md-margin-bottom; - .core-module-description .core-show-more { + .core-show-more { padding-right: $label-ios-margin-end; } } @@ -112,7 +112,7 @@ core-course-module { padding-right: ($item-wp-padding-end / 2); margin-bottom: $label-md-margin-bottom; - .core-module-description .core-show-more { + .core-show-more { padding-right: ($item-wp-padding-end / 2); } } diff --git a/src/core/courses/pages/my-overview/my-overview.html b/src/core/courses/pages/my-overview/my-overview.html index deea5afd9..0a9acea64 100644 --- a/src/core/courses/pages/my-overview/my-overview.html +++ b/src/core/courses/pages/my-overview/my-overview.html @@ -36,14 +36,14 @@ -
- +
+ {{ 'core.courses.inprogress' | translate }} {{ 'core.courses.future' | translate }} {{ 'core.courses.past' | translate }} -
+
@@ -81,7 +81,7 @@ -
+
{{ 'core.courses.sortbydates' | translate }} {{ 'core.courses.sortbycourses' | translate }} From 9b3bd3012e0ed37938d6199b0cc6663f4abec300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 9 Aug 2018 17:57:39 +0200 Subject: [PATCH 2/2] MOBILE-2481 course: Add section navigation --- src/addon/mod/quiz/pages/player/player.html | 2 +- src/app/app.scss | 6 +++-- src/components/tabs/core-tabs.html | 4 ++-- .../components/format/core-course-format.html | 18 ++++++++++++--- src/core/course/components/format/format.scss | 9 ++++++++ src/core/course/components/format/format.ts | 22 +++++++++++++++++++ .../section-selector/section-selector.html | 1 + .../login/pages/credentials/credentials.html | 2 +- src/core/login/pages/reconnect/reconnect.html | 2 +- 9 files changed, 56 insertions(+), 10 deletions(-) diff --git a/src/addon/mod/quiz/pages/player/player.html b/src/addon/mod/quiz/pages/player/player.html index d3d07b9be..253ea995b 100644 --- a/src/addon/mod/quiz/pages/player/player.html +++ b/src/addon/mod/quiz/pages/player/player.html @@ -67,7 +67,7 @@ - diff --git a/src/app/app.scss b/src/app/app.scss index 6f2aa9226..ebe16db2b 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -416,7 +416,7 @@ ion-col ion-select { } -:not(.item) ion-select, +:not(.item) > * > * > ion-select, .core-button-select { background-color: white; color: $core-color; @@ -447,7 +447,7 @@ ion-col ion-select { } .button-inner { - justify-content: space-between; + justify-content: start; } .select-icon .select-icon-inner { @@ -456,6 +456,8 @@ ion-col ion-select { ion-icon:last-child { @include margin(null, null, null, 5px); + text-align: right; + flex-grow: 2; } } diff --git a/src/components/tabs/core-tabs.html b/src/components/tabs/core-tabs.html index 4045a3264..4958a47b6 100644 --- a/src/components/tabs/core-tabs.html +++ b/src/components/tabs/core-tabs.html @@ -2,7 +2,7 @@
- + @@ -18,7 +18,7 @@ - +
diff --git a/src/core/course/components/format/core-course-format.html b/src/core/course/components/format/core-course-format.html index 304ae4ce1..56eedc8d8 100644 --- a/src/core/course/components/format/core-course-format.html +++ b/src/core/course/components/format/core-course-format.html @@ -13,7 +13,7 @@
- + @@ -22,8 +22,9 @@ -
- @@ -49,6 +50,17 @@
+ + + + + diff --git a/src/core/course/components/format/format.scss b/src/core/course/components/format/format.scss index fd34053d6..5596893e1 100644 --- a/src/core/course/components/format/format.scss +++ b/src/core/course/components/format/format.scss @@ -55,4 +55,13 @@ core-course-format { line-height: 44px; } } + + .core-course-section-nav-buttons { + .button-inner core-format-text { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + text-transform: none; + } + } } diff --git a/src/core/course/components/format/format.ts b/src/core/course/components/format/format.ts index 97e10bf48..c378fe847 100644 --- a/src/core/course/components/format/format.ts +++ b/src/core/course/components/format/format.ts @@ -63,6 +63,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { displaySectionSelector: boolean; selectedSection: any; + previousSection: any; + nextSection: any; allSectionsId: number = CoreCourseProvider.ALL_SECTIONS_ID; selectOptions: any = {}; loaded: boolean; @@ -248,6 +250,26 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { this.selectedSection = newSection; this.data.section = this.selectedSection; + // Select next and previous sections to show the arrows. + const i = this.sections.findIndex((value, index) => { + return this.compareSections(value, this.selectedSection); + }); + + let j; + for (j = i - 1; j >= 1; j--) { + if (!(this.sections[j].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { + break; + } + } + this.previousSection = j >= 1 ? this.sections[j] : null; + + for (j = i + 1; j < this.sections.length; j++) { + if (!(this.sections[j].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { + break; + } + } + this.nextSection = j < this.sections.length ? this.sections[j] : null; + if (this.moduleId && typeof previousValue == 'undefined') { setTimeout(() => { this.domUtils.scrollToElementBySelector(this.content, '#core-course-module-' + this.moduleId); diff --git a/src/core/course/pages/section-selector/section-selector.html b/src/core/course/pages/section-selector/section-selector.html index 3b1fec899..dcdd72a9c 100644 --- a/src/core/course/pages/section-selector/section-selector.html +++ b/src/core/course/pages/section-selector/section-selector.html @@ -11,6 +11,7 @@ +

{{ 'core.course.nocontentavailable' | translate }} diff --git a/src/core/login/pages/credentials/credentials.html b/src/core/login/pages/credentials/credentials.html index 9f6af1247..e7160fbc8 100644 --- a/src/core/login/pages/credentials/credentials.html +++ b/src/core/login/pages/credentials/credentials.html @@ -6,7 +6,7 @@
-
+
diff --git a/src/core/login/pages/reconnect/reconnect.html b/src/core/login/pages/reconnect/reconnect.html index e96b9846d..ca9d980b1 100644 --- a/src/core/login/pages/reconnect/reconnect.html +++ b/src/core/login/pages/reconnect/reconnect.html @@ -5,7 +5,7 @@
-
+
{{ 'core.pictureof' | translate:{$a: site.fullname} }}