MOBILE-3833 forum: Display word count below post text

main
Dani Palou 2022-04-11 12:50:33 +02:00
parent 41680adf33
commit 50322300ac
3 changed files with 3 additions and 7 deletions

View File

@ -12,11 +12,6 @@
<p class="item-heading" *ngIf="offlinePost">{{ 'core.discard' | translate }}</p> <p class="item-heading" *ngIf="offlinePost">{{ 'core.discard' | translate }}</p>
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap" *ngIf="wordCount">
<ion-label>
<p class="item-heading">{{ 'core.numwords' | translate: {'$a': wordCount} }}</p>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap" [href]="url" *ngIf="url" core-link capture="false" button detail="false" [showBrowserWarning]="false"> <ion-item class="ion-text-wrap" [href]="url" *ngIf="url" core-link capture="false" button detail="false" [showBrowserWarning]="false">
<ion-icon name="fas-external-link-alt" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-external-link-alt" slot="start" aria-hidden="true"></ion-icon>
<ion-label> <ion-label>

View File

@ -34,7 +34,6 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit, OnDestroy
@Input() cmId!: number; @Input() cmId!: number;
@Input() forumId!: number; // The forum Id. @Input() forumId!: number; // The forum Id.
wordCount?: number | null; // Number of words when available.
canEdit = false; canEdit = false;
canDelete = false; canDelete = false;
loaded = false; loaded = false;
@ -89,7 +88,6 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit, OnDestroy
this.canDelete = !!this.post.capabilities.delete && AddonModForum.isDeletePostAvailable(); this.canDelete = !!this.post.capabilities.delete && AddonModForum.isDeletePostAvailable();
this.canEdit = !!this.post.capabilities.edit && AddonModForum.isUpdatePostAvailable(); this.canEdit = !!this.post.capabilities.edit && AddonModForum.isUpdatePostAvailable();
this.wordCount = (this.post.haswordcount && this.post.wordcount) || null;
this.loaded = true; this.loaded = true;
} }

View File

@ -63,6 +63,9 @@
<core-format-text [component]="component" [componentId]="componentId" [text]="post.message" contextLevel="module" <core-format-text [component]="component" [componentId]="componentId" [text]="post.message" contextLevel="module"
[contextInstanceId]="forum && forum.cmid" [courseId]="courseId"> [contextInstanceId]="forum && forum.cmid" [courseId]="courseId">
</core-format-text> </core-format-text>
<p *ngIf="post.haswordcount && post.wordcount">
<em>{{ 'core.numwords' | translate: {'$a': post.wordcount} }}</em>
</p>
<div *ngIf="post.attachments && post.attachments.length > 0"> <div *ngIf="post.attachments && post.attachments.length > 0">
<core-files [files]="post.attachments" [component]="component" [componentId]="componentId" showInline="true"> <core-files [files]="post.attachments" [component]="component" [componentId]="componentId" showInline="true">
</core-files> </core-files>