MOBILE-3833 forum: Display word count below post text
parent
41680adf33
commit
50322300ac
|
@ -12,11 +12,6 @@
|
|||
<p class="item-heading" *ngIf="offlinePost">{{ 'core.discard' | translate }}</p>
|
||||
</ion-label>
|
||||
</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-icon name="fas-external-link-alt" slot="start" aria-hidden="true"></ion-icon>
|
||||
<ion-label>
|
||||
|
|
|
@ -34,7 +34,6 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit, OnDestroy
|
|||
@Input() cmId!: number;
|
||||
@Input() forumId!: number; // The forum Id.
|
||||
|
||||
wordCount?: number | null; // Number of words when available.
|
||||
canEdit = false;
|
||||
canDelete = false;
|
||||
loaded = false;
|
||||
|
@ -89,7 +88,6 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit, OnDestroy
|
|||
|
||||
this.canDelete = !!this.post.capabilities.delete && AddonModForum.isDeletePostAvailable();
|
||||
this.canEdit = !!this.post.capabilities.edit && AddonModForum.isUpdatePostAvailable();
|
||||
this.wordCount = (this.post.haswordcount && this.post.wordcount) || null;
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,9 @@
|
|||
<core-format-text [component]="component" [componentId]="componentId" [text]="post.message" contextLevel="module"
|
||||
[contextInstanceId]="forum && forum.cmid" [courseId]="courseId">
|
||||
</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">
|
||||
<core-files [files]="post.attachments" [component]="component" [componentId]="componentId" showInline="true">
|
||||
</core-files>
|
||||
|
|
Loading…
Reference in New Issue