diff --git a/scripts/langindex.json b/scripts/langindex.json
index 9ff84ef4b..fbe4bd714 100644
--- a/scripts/langindex.json
+++ b/scripts/langindex.json
@@ -12,13 +12,13 @@
"addon.badges.recipientdetails": "badges",
"addon.block_activitymodules.pluginname": "block_activity_modules",
"addon.block_myoverview.all": "block_myoverview",
+ "addon.block_myoverview.favourites": "block_myoverview",
"addon.block_myoverview.future": "block_myoverview",
+ "addon.block_myoverview.hiddencourses": "block_myoverview",
"addon.block_myoverview.inprogress": "block_myoverview",
"addon.block_myoverview.lastaccessed": "block_myoverview",
"addon.block_myoverview.morecourses": "block_myoverview",
- "addon.block_myoverview.nocoursesfuture": "block_myoverview",
- "addon.block_myoverview.nocoursesinprogress": "block_myoverview",
- "addon.block_myoverview.nocoursespast": "block_myoverview",
+ "addon.block_myoverview.nocourses": "block_myoverview",
"addon.block_myoverview.past": "block_myoverview",
"addon.block_myoverview.pluginname": "block_myoverview",
"addon.block_myoverview.title": "block_myoverview",
diff --git a/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html b/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html
index aad7b8ca0..40e1441c6 100644
--- a/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html
+++ b/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html
@@ -17,6 +17,8 @@
{{ 'addon.block_myoverview.inprogress' | translate }}
{{ 'addon.block_myoverview.future' | translate }}
{{ 'addon.block_myoverview.past' | translate }}
+ {{ 'addon.block_myoverview.favourites' | translate }}
+ {{ 'addon.block_myoverview.hiddencourses' | translate }}
@@ -35,11 +37,7 @@
-
-
-
-
-
+
diff --git a/src/addon/block/myoverview/components/myoverview/myoverview.ts b/src/addon/block/myoverview/components/myoverview/myoverview.ts
index 244a72117..47bee2553 100644
--- a/src/addon/block/myoverview/components/myoverview/myoverview.ts
+++ b/src/addon/block/myoverview/components/myoverview/myoverview.ts
@@ -40,7 +40,9 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
all: [],
past: [],
inprogress: [],
- future: []
+ future: [],
+ favourite: [],
+ hidden: []
};
selectedFilter = 'inprogress';
sort = 'title';
@@ -51,9 +53,13 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
all: {},
inprogress: {},
past: {},
- future: {}
+ future: {},
+ favourite: {},
+ hidden: {}
};
showFilter = false;
+ showFavourite = false;
+ showHidden = false;
showSelectorFilter = false;
showSortFilter = false;
@@ -162,8 +168,10 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
this.courses.filter = '';
this.showFilter = false;
- this.showSelectorFilter = this.courses.past.length > 0 || this.courses.future.length > 0 || (courses.length > 0 &&
+ this.showSelectorFilter = courses.length > 0 && (this.courses.past.length > 0 || this.courses.future.length > 0 ||
typeof courses[0].enddate != 'undefined');
+ this.showHidden = this.showSelectorFilter && typeof courses[0].hidden != 'undefined';
+ this.showFavourite = this.showSelectorFilter && typeof courses[0].isfavourite != 'undefined';
if (!this.showSelectorFilter) {
// No selector, show all.
this.selectedFilter = 'all';
@@ -276,22 +284,34 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
}
}
- this.courses.all = courses;
+ this.courses.all = [];
this.courses.past = [];
this.courses.inprogress = [];
this.courses.future = [];
+ this.courses.favourite = [];
+ this.courses.hidden = [];
const today = moment().unix();
courses.forEach((course) => {
- if ((course.enddate && course.enddate < today) || course.completed) {
- // Courses that have already ended.
- this.courses.past.push(course);
- } else if (course.startdate > today) {
- // Courses that have not started yet.
- this.courses.future.push(course);
- } else {
- // Courses still in progress.
- this.courses.inprogress.push(course);
+ if (course.hidden) {
+ this.courses.hidden.push(course);
+ } else {
+ this.courses.all.push(course);
+
+ if ((course.enddate && course.enddate < today) || course.completed) {
+ // Courses that have already ended.
+ this.courses.past.push(course);
+ } else if (course.startdate > today) {
+ // Courses that have not started yet.
+ this.courses.future.push(course);
+ } else {
+ // Courses still in progress.
+ this.courses.inprogress.push(course);
+ }
+
+ if (course.isfavourite) {
+ this.courses.favourite.push(course);
+ }
}
});
}
diff --git a/src/addon/block/myoverview/lang/en.json b/src/addon/block/myoverview/lang/en.json
index 64d436ecd..7b670bf03 100644
--- a/src/addon/block/myoverview/lang/en.json
+++ b/src/addon/block/myoverview/lang/en.json
@@ -2,11 +2,11 @@
"all": "All",
"future": "Future",
"inprogress": "In progress",
+ "favourites" : "Starred",
+ "hiddencourses": "Hidden",
"lastaccessed": "Last accessed",
"morecourses": "More courses",
- "nocoursesfuture": "No future courses",
- "nocoursesinprogress": "No in progress courses",
- "nocoursespast": "No past courses",
+ "nocourses": "No courses",
"past": "Past",
"pluginname": "Course Overview",
"title": "Title"
diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json
index 9f4093645..d5a2e6427 100644
--- a/src/assets/lang/en.json
+++ b/src/assets/lang/en.json
@@ -12,13 +12,13 @@
"addon.badges.recipientdetails": "Recipient details",
"addon.block_activitymodules.pluginname": "Activities",
"addon.block_myoverview.all": "All",
+ "addon.block_myoverview.favourites": "Starred",
"addon.block_myoverview.future": "Future",
+ "addon.block_myoverview.hiddencourses": "Hidden",
"addon.block_myoverview.inprogress": "In progress",
"addon.block_myoverview.lastaccessed": "Last accessed",
"addon.block_myoverview.morecourses": "More courses",
- "addon.block_myoverview.nocoursesfuture": "No future courses",
- "addon.block_myoverview.nocoursesinprogress": "No in progress courses",
- "addon.block_myoverview.nocoursespast": "No past courses",
+ "addon.block_myoverview.nocourses": "No courses",
"addon.block_myoverview.past": "Past",
"addon.block_myoverview.pluginname": "Course Overview",
"addon.block_myoverview.title": "Title",
diff --git a/src/core/block/components/block/block.scss b/src/core/block/components/block/block.scss
new file mode 100644
index 000000000..5a4b20515
--- /dev/null
+++ b/src/core/block/components/block/block.scss
@@ -0,0 +1,19 @@
+ion-app.app-root core-block {
+ position: relative;
+
+ core-loading.core-loading-center {
+ display: block;
+
+ .core-loading-container {
+ margin-top: 10px;
+ position: relative;
+ }
+ }
+
+ core-empty-box .core-empty-box {
+ position: relative;
+ z-index: initial;
+ @include position(initial, initial, null, initial);
+ height: auto;
+ }
+}
\ No newline at end of file
diff --git a/src/core/courses/components/course-progress/core-courses-course-progress.html b/src/core/courses/components/course-progress/core-courses-course-progress.html
index ca7d88f2a..01db00893 100644
--- a/src/core/courses/components/course-progress/core-courses-course-progress.html
+++ b/src/core/courses/components/course-progress/core-courses-course-progress.html
@@ -1,6 +1,7 @@
+
diff --git a/src/core/courses/components/course-progress/course-progress.scss b/src/core/courses/components/course-progress/course-progress.scss
index ce16ecd9b..e99d46143 100644
--- a/src/core/courses/components/course-progress/course-progress.scss
+++ b/src/core/courses/components/course-progress/course-progress.scss
@@ -29,6 +29,16 @@ ion-app.app-root core-courses-course-progress {
bottom: 0;
margin: auto;
}
+
+ ion-icon {
+ position: absolute;
+ @include position(0, null, null, 0);
+ padding: 16px;
+ color: $gray-darker;
+ -webkit-text-stroke-width: 0.5px;
+ -webkit-text-stroke-color: $gray-lighter;
+ font-size: 16px;
+ }
}
.core-course-link {