MOBILE-3814 mod: Add module name to module info box

main
Pau Ferrer Ocaña 2022-01-19 14:54:43 +01:00
parent 46dada14cb
commit 4a83b2b29f
7 changed files with 12 additions and 20 deletions

View File

@ -41,7 +41,7 @@
<core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()"
[description]="forum && forum.type != 'single' && description" [component]="component" [componentId]="componentId" [description]="forum && forum.type != 'single' && description" [component]="component" [componentId]="componentId"
[courseId]="courseId" [hasDataToSync]="hasOffline || hasOfflineRatings"> [courseId]="courseId" [hasDataToSync]="hasOffline || hasOfflineRatings">
<ion-item> <ion-item lines="none" class="ion-text-wrap">
<ion-label> <ion-label>
{{descriptionNote}} {{descriptionNote}}
</ion-label> </ion-label>

View File

@ -50,7 +50,6 @@
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
[component]="component" [componentId]="componentId" [courseId]="courseId"> [component]="component" [componentId]="componentId" [courseId]="courseId">
<h2 *ngIf="pageTitle" title>{{pageTitle}}</h2>
</core-course-module-info> </core-course-module-info>
<div *ngIf="pageIsOffline || hasOffline || pageWarning"> <div *ngIf="pageIsOffline || hasOffline || pageWarning">
@ -74,6 +73,7 @@
</ion-card> </ion-card>
</div> </div>
<div class="ion-padding addon-mod_wiki-page-content"> <div class="ion-padding addon-mod_wiki-page-content">
<h2 *ngIf="pageTitle">{{pageTitle}}</h2>
<article [ngClass]="{'addon-mod_wiki-noedit': !canEdit}"> <article [ngClass]="{'addon-mod_wiki-noedit': !canEdit}">
<core-format-text *ngIf="pageContent" [component]="component" [componentId]="componentId" [text]="pageContent" <core-format-text *ngIf="pageContent" [component]="component" [componentId]="componentId" [text]="pageContent"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"> contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">

View File

@ -427,7 +427,6 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
const pageContents = await this.fetchPageContents(this.currentPage); const pageContents = await this.fetchPageContents(this.currentPage);
if (pageContents) { if (pageContents) {
this.dataRetrieved.emit(pageContents.title);
this.setSelectedWiki(pageContents.subwikiid, pageContents.userid, pageContents.groupid); this.setSelectedWiki(pageContents.subwikiid, pageContents.userid, pageContents.groupid);
this.pageTitle = pageContents.title; this.pageTitle = pageContents.title;

View File

@ -8,10 +8,6 @@
<core-format-text [text]="title" contextLevel="module" [contextInstanceId]="module?.id" [courseId]="courseId"> <core-format-text [text]="title" contextLevel="module" [contextInstanceId]="module?.id" [courseId]="courseId">
</core-format-text> </core-format-text>
</h1> </h1>
<h2>
<core-format-text [text]="pageTitle" contextLevel="module" [contextInstanceId]="module?.id" [courseId]="courseId">
</core-format-text>
</h2>
</ion-title> </ion-title>
<ion-buttons slot="end"> <ion-buttons slot="end">

View File

@ -49,18 +49,6 @@ export class AddonModWikiIndexPage extends CoreCourseModuleMainActivityPage<Addo
this.groupId = CoreNavigator.getRouteNumberParam('groupId'); this.groupId = CoreNavigator.getRouteNumberParam('groupId');
} }
/**
* @inheritdoc
*/
updateData(data: { name: string } | string): void {
if (typeof data == 'string') {
// We received the title to display.
this.pageTitle = data;
} else {
super.updateData(data);
}
}
/** /**
* User entered the page. * User entered the page.
*/ */

View File

@ -2,6 +2,7 @@
<core-mod-icon slot="start" [modicon]="modicon" [modname]="module.modname" [componentId]="module.instance"> <core-mod-icon slot="start" [modicon]="modicon" [modname]="module.modname" [componentId]="module.instance">
</core-mod-icon> </core-mod-icon>
<ion-label> <ion-label>
<p class="core-modulename" *ngIf="moduleNameTranslated">{{moduleNameTranslated}}</p>
<h1> <h1>
<core-format-text [text]="module.name" contextLevel="module" [component]="component" [componentId]="componentId" <core-format-text [text]="module.name" contextLevel="module" [component]="component" [componentId]="componentId"
[contextInstanceId]="module.id" [courseId]="courseId"> [contextInstanceId]="module.id" [courseId]="courseId">

View File

@ -8,4 +8,12 @@
background-color: var(--contrast-background); background-color: var(--contrast-background);
@include padding-horizontal(var(--ion-safe-area-left), var(--ion-safe-area-right)); @include padding-horizontal(var(--ion-safe-area-left), var(--ion-safe-area-right));
.core-modulename {
text-transform: uppercase;
}
core-mod-icon {
align-self: flex-start;
}
} }