+
+
+
diff --git a/src/core/courses/pages/available-courses/available-courses.module.ts b/src/core/courses/pages/available-courses/available-courses.module.ts
new file mode 100644
index 000000000..5fb00ab0a
--- /dev/null
+++ b/src/core/courses/pages/available-courses/available-courses.module.ts
@@ -0,0 +1,33 @@
+// (C) Copyright 2015 Martin Dougiamas
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import { NgModule } from '@angular/core';
+import { IonicPageModule } from 'ionic-angular';
+import { TranslateModule } from '@ngx-translate/core';
+import { CoreCoursesAvailableCoursesPage } from './available-courses';
+import { CoreComponentsModule } from '../../../../components/components.module';
+import { CoreCoursesComponentsModule } from '../../components/components.module';
+
+@NgModule({
+ declarations: [
+ CoreCoursesAvailableCoursesPage,
+ ],
+ imports: [
+ CoreComponentsModule,
+ CoreCoursesComponentsModule,
+ IonicPageModule.forChild(CoreCoursesAvailableCoursesPage),
+ TranslateModule.forChild()
+ ],
+})
+export class CoreCoursesAvailableCoursesPageModule {}
diff --git a/src/core/courses/pages/available-courses/available-courses.ts b/src/core/courses/pages/available-courses/available-courses.ts
new file mode 100644
index 000000000..47d71babf
--- /dev/null
+++ b/src/core/courses/pages/available-courses/available-courses.ts
@@ -0,0 +1,76 @@
+// (C) Copyright 2015 Martin Dougiamas
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import { Component } from '@angular/core';
+import { IonicPage } from 'ionic-angular';
+import { CoreSitesProvider } from '../../../../providers/sites';
+import { CoreDomUtilsProvider } from '../../../../providers/utils/dom';
+import { CoreCoursesProvider } from '../../providers/courses';
+
+/**
+ * Page that displays available courses in current site.
+ */
+@IonicPage()
+@Component({
+ selector: 'page-core-courses-available-courses',
+ templateUrl: 'available-courses.html',
+})
+export class CoreCoursesAvailableCoursesPage {
+ courses: any[] = [];
+ coursesLoaded: boolean;
+
+ constructor(private coursesProvider: CoreCoursesProvider, private domUtils: CoreDomUtilsProvider,
+ private sitesProvider: CoreSitesProvider) {}
+
+ /**
+ * View loaded.
+ */
+ ionViewDidLoad() {
+ this.loadCourses().finally(() => {
+ this.coursesLoaded = true;
+ });
+ }
+
+ /**
+ * Load the courses.
+ */
+ protected loadCourses() {
+ const frontpageCourseId = this.sitesProvider.getCurrentSite().getSiteHomeId();
+ return this.coursesProvider.getCoursesByField().then((courses) => {
+ this.courses = courses.filter((course) => {
+ return course.id != frontpageCourseId;
+ });
+ }).catch((error) => {
+ this.domUtils.showErrorModalDefault(error, 'core.courses.errorloadcourses', true);
+ });
+ }
+
+ /**
+ * Refresh the courses.
+ *
+ * @param {any} refresher Refresher.
+ */
+ refreshCourses(refresher: any) {
+ let promises = [];
+
+ promises.push(this.coursesProvider.invalidateUserCourses());
+ promises.push(this.coursesProvider.invalidateCoursesByField());
+
+ Promise.all(promises).finally(() => {
+ this.loadCourses().finally(() => {
+ refresher.complete();
+ });
+ });
+ };
+}
diff --git a/src/core/courses/pages/categories/categories.html b/src/core/courses/pages/categories/categories.html
new file mode 100644
index 000000000..c22dfe194
--- /dev/null
+++ b/src/core/courses/pages/categories/categories.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+