MOBILE-3814 my: Add site name to my courses page
parent
86d4dd5afc
commit
07df82153a
|
@ -4,7 +4,10 @@
|
||||||
<ion-back-button [text]="'core.back' | translate"></ion-back-button>
|
<ion-back-button [text]="'core.back' | translate"></ion-back-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
<h1>{{ 'core.courses.mycourses' | translate }}</h1>
|
<h1>
|
||||||
|
<core-format-text [text]="siteName" contextLevel="system" [contextInstanceId]="0"></core-format-text>
|
||||||
|
<img src="assets/img/top_logo.png" class="core-header-logo" [alt]="siteName">
|
||||||
|
</h1>
|
||||||
</ion-title>
|
</ion-title>
|
||||||
<ion-buttons slot="end">
|
<ion-buttons slot="end">
|
||||||
<ion-button *ngIf="searchEnabled" (click)="openSearch()" [attr.aria-label]="'core.courses.searchcourses' | translate">
|
<ion-button *ngIf="searchEnabled" (click)="openSearch()" [attr.aria-label]="'core.courses.searchcourses' | translate">
|
||||||
|
@ -30,6 +33,9 @@
|
||||||
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
|
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
|
||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
<core-loading [hideUntil]="loaded">
|
<core-loading [hideUntil]="loaded">
|
||||||
|
<div class="ion-padding-horizontal">
|
||||||
|
<h2>{{ 'core.courses.mycourses' | translate }}</h2>
|
||||||
|
</div>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<core-block *ngIf="loadedBlock?.visible" [block]="loadedBlock" contextLevel="user" [instanceId]="userId"
|
<core-block *ngIf="loadedBlock?.visible" [block]="loadedBlock" contextLevel="user" [instanceId]="userId"
|
||||||
[extraData]="{'downloadEnabled': true}"></core-block>
|
[extraData]="{'downloadEnabled': true}"></core-block>
|
||||||
|
|
|
@ -36,6 +36,7 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
@ViewChild(CoreBlockComponent) block!: CoreBlockComponent;
|
@ViewChild(CoreBlockComponent) block!: CoreBlockComponent;
|
||||||
|
|
||||||
|
siteName = '';
|
||||||
searchEnabled = false;
|
searchEnabled = false;
|
||||||
downloadCoursesEnabled = false;
|
downloadCoursesEnabled = false;
|
||||||
userId: number;
|
userId: number;
|
||||||
|
@ -50,6 +51,8 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
|
||||||
this.updateSiteObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, () => {
|
this.updateSiteObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, () => {
|
||||||
this.searchEnabled = !CoreCourses.isSearchCoursesDisabledInSite();
|
this.searchEnabled = !CoreCourses.isSearchCoursesDisabledInSite();
|
||||||
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
|
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
|
||||||
|
this.loadSiteName();
|
||||||
|
|
||||||
}, CoreSites.getCurrentSiteId());
|
}, CoreSites.getCurrentSiteId());
|
||||||
|
|
||||||
this.userId = CoreSites.getCurrentSiteUserId();
|
this.userId = CoreSites.getCurrentSiteUserId();
|
||||||
|
@ -62,8 +65,9 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
|
||||||
this.searchEnabled = !CoreCourses.isSearchCoursesDisabledInSite();
|
this.searchEnabled = !CoreCourses.isSearchCoursesDisabledInSite();
|
||||||
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
|
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
|
||||||
|
|
||||||
this.loadContent();
|
this.loadSiteName();
|
||||||
|
|
||||||
|
this.loadContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,6 +101,13 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the site name.
|
||||||
|
*/
|
||||||
|
protected loadSiteName(): void {
|
||||||
|
this.siteName = CoreSites.getRequiredCurrentSite().getSiteName() || '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load fallback blocks.
|
* Load fallback blocks.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -55,7 +55,7 @@ export class CoreMainMenuHomePage implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the component.
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.route.queryParams.subscribe((params: Partial<CoreRedirectPayload> & { urlToOpen?: string }) => {
|
this.route.queryParams.subscribe((params: Partial<CoreRedirectPayload> & { urlToOpen?: string }) => {
|
||||||
|
@ -121,7 +121,7 @@ export class CoreMainMenuHomePage implements OnInit {
|
||||||
* Load the site name.
|
* Load the site name.
|
||||||
*/
|
*/
|
||||||
protected loadSiteName(): void {
|
protected loadSiteName(): void {
|
||||||
this.siteName = CoreSites.getCurrentSite()?.getSiteName() || '';
|
this.siteName = CoreSites.getRequiredCurrentSite().getSiteName() || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue