diff --git a/src/core/features/course/lang/en.json b/src/core/features/course/lang/en.json
new file mode 100644
index 000000000..2a74a13a0
--- /dev/null
+++ b/src/core/features/course/lang/en.json
@@ -0,0 +1,36 @@
+{
+ "activitydisabled": "Your organisation has disabled this activity in the mobile app.",
+ "activitynotyetviewableremoteaddon": "Your organisation installed a plugin that is not yet supported.",
+ "activitynotyetviewablesiteupgradeneeded": "Your organisation's Moodle installation needs to be updated.",
+ "allsections": "All sections",
+ "askadmintosupport": "Contact the site administrator and tell them you want to use this activity with the Moodle Mobile app.",
+ "availablespace": " You currently have about {{available}} free space.",
+ "cannotdeletewhiledownloading": "Files cannot be deleted while the activity is being downloaded. Please wait for the download to finish.",
+ "confirmdeletemodulefiles": "Are you sure you want to delete these files?",
+ "confirmdeletestoreddata": "Are you sure you want to delete the stored data?",
+ "confirmdownload": "You are about to download {{size}}.{{availableSpace}} Are you sure you want to continue?",
+ "confirmdownloadunknownsize": "It was not possible to calculate the size of the download.{{availableSpace}} Are you sure you want to continue?",
+ "confirmdownloadzerosize": "You are about to start downloading.{{availableSpace}} Are you sure you want to continue?",
+ "confirmpartialdownloadsize": "You are about to download at least {{size}}.{{availableSpace}} Are you sure you want to continue?",
+ "confirmlimiteddownload": "You are not currently connected to Wi-Fi. ",
+ "contents": "Contents",
+ "couldnotloadsectioncontent": "Could not load the section content. Please try again later.",
+ "couldnotloadsections": "Could not load the sections. Please try again later.",
+ "coursesummary": "Course summary",
+ "downloadcourse": "Download course",
+ "errordownloadingcourse": "Error downloading course.",
+ "errordownloadingsection": "Error downloading section.",
+ "errorgetmodule": "Error getting activity data.",
+ "hiddenfromstudents": "Hidden from students",
+ "hiddenoncoursepage": "Available but not shown on course page",
+ "insufficientavailablespace": "You are trying to download {{size}}. This will leave your device with insufficient space to operate normally. Please clear some storage space first.",
+ "insufficientavailablequota": "Your device could not allocate space to save this download. It may be reserving space for app and system updates. Please clear some storage space first.",
+ "manualcompletionnotsynced": "Manual completion not synchronised.",
+ "nocontentavailable": "No content available at the moment.",
+ "overriddennotice": "Your final grade from this activity was manually adjusted.",
+ "refreshcourse": "Refresh course",
+ "sections": "Sections",
+ "useactivityonbrowser": "You can still use it using your device's web browser.",
+ "warningmanualcompletionmodified": "The manual completion of an activity was modified on the site.",
+ "warningofflinemanualcompletiondeleted": "Some offline manual completion of course '{{name}}' has been deleted. {{error}}"
+}
\ No newline at end of file
diff --git a/src/core/features/courses/components/components.module.ts b/src/core/features/courses/components/components.module.ts
index 6a74f8671..6b9eae348 100644
--- a/src/core/features/courses/components/components.module.ts
+++ b/src/core/features/courses/components/components.module.ts
@@ -16,6 +16,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
+import { FormsModule } from '@angular/forms';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
@@ -24,16 +25,19 @@ import { CorePipesModule } from '@pipes/pipes.module';
import { CoreCoursesCourseListItemComponent } from './course-list-item/course-list-item';
import { CoreCoursesCourseProgressComponent } from './course-progress/course-progress';
import { CoreCoursesCourseOptionsMenuComponent } from './course-options-menu/course-options-menu';
+import { CoreCoursesSelfEnrolPasswordComponent } from './self-enrol-password/self-enrol-password';
@NgModule({
declarations: [
CoreCoursesCourseListItemComponent,
CoreCoursesCourseProgressComponent,
CoreCoursesCourseOptionsMenuComponent,
+ CoreCoursesSelfEnrolPasswordComponent,
],
imports: [
CommonModule,
IonicModule,
+ FormsModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
@@ -43,6 +47,7 @@ import { CoreCoursesCourseOptionsMenuComponent } from './course-options-menu/cou
CoreCoursesCourseListItemComponent,
CoreCoursesCourseProgressComponent,
CoreCoursesCourseOptionsMenuComponent,
+ CoreCoursesSelfEnrolPasswordComponent,
],
entryComponents: [
CoreCoursesCourseOptionsMenuComponent,
diff --git a/src/core/features/courses/components/self-enrol-password/self-enrol-password.html b/src/core/features/courses/components/self-enrol-password/self-enrol-password.html
new file mode 100644
index 000000000..d3acbe66a
--- /dev/null
+++ b/src/core/features/courses/components/self-enrol-password/self-enrol-password.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ {{ 'core.courses.selfenrolment' | translate }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/core/features/courses/components/self-enrol-password/self-enrol-password.ts b/src/core/features/courses/components/self-enrol-password/self-enrol-password.ts
new file mode 100644
index 000000000..d44874761
--- /dev/null
+++ b/src/core/features/courses/components/self-enrol-password/self-enrol-password.ts
@@ -0,0 +1,63 @@
+// (C) Copyright 2015 Moodle Pty Ltd.
+//
+// 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, ViewChild, ElementRef } from '@angular/core';
+import { ModalController, NavParams } from '@ionic/angular';
+import { CoreSites } from '@services/sites';
+import { CoreDomUtils } from '@services/utils/dom';
+
+/**
+ * Modal that displays a form to enter a password to self enrol in a course.
+ */
+@Component({
+ selector: 'page-core-courses-self-enrol-password',
+ templateUrl: 'self-enrol-password.html',
+})
+export class CoreCoursesSelfEnrolPasswordComponent {
+
+ @ViewChild('enrolPasswordForm') formElement!: ElementRef;
+ password = '';
+
+ constructor(
+ protected modalCtrl: ModalController,
+ navParams: NavParams,
+ ) {
+ this.password = navParams.get('password') || '';
+ }
+
+ /**
+ * Close help modal.
+ */
+ close(): void {
+ CoreDomUtils.instance.triggerFormCancelledEvent(this.formElement, CoreSites.instance.getCurrentSiteId());
+
+ this.modalCtrl.dismiss();
+ }
+
+ /**
+ * Submit password.
+ *
+ * @param e Event.
+ * @param password Password to submit.
+ */
+ submitPassword(e: Event): void {
+ e.preventDefault();
+ e.stopPropagation();
+
+ CoreDomUtils.instance.triggerFormSubmittedEvent(this.formElement, false, CoreSites.instance.getCurrentSiteId());
+
+ this.modalCtrl.dismiss(this.password);
+ }
+
+}
diff --git a/src/core/features/courses/courses.module.ts b/src/core/features/courses/courses.module.ts
index 8845e88b5..81d147123 100644
--- a/src/core/features/courses/courses.module.ts
+++ b/src/core/features/courses/courses.module.ts
@@ -63,6 +63,12 @@ const routes: Routes = [
import('@features/courses/pages/my-courses/my-courses.page.module')
.then(m => m.CoreCoursesMyCoursesPageModule),
},
+ {
+ path: 'preview',
+ loadChildren: () =>
+ import('@features/courses/pages/course-preview/course-preview.page.module')
+ .then(m => m.CoreCoursesCoursePreviewPageModule),
+ },
],
},
];
diff --git a/src/core/features/courses/pages/course-preview/course-preview.html b/src/core/features/courses/pages/course-preview/course-preview.html
new file mode 100644
index 000000000..b11a999d8
--- /dev/null
+++ b/src/core/features/courses/pages/course-preview/course-preview.html
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+