MOBILE-2201 glossary: Display tags in glossary entries

main
Albert Gasset 2019-07-08 11:28:04 +02:00
parent 1226a17d81
commit 4400d99638
3 changed files with 12 additions and 2 deletions

View File

@ -28,6 +28,10 @@
<core-file *ngFor="let file of entry.attachments" [file]="file" [component]="component" [componentId]="componentId"></core-file> <core-file *ngFor="let file of entry.attachments" [file]="file" [component]="component" [componentId]="componentId"></core-file>
</div> </div>
</ng-container> </ng-container>
<ion-item text-wrap *ngIf="tagsEnabled && entry && entry.tags && entry.tags.length > 0">
<div item-start>{{ 'core.tag.tags' | translate }}:</div>
<core-tag-list [tags]="entry.tags"></core-tag-list>
</ion-item>
<ion-item text-wrap *ngIf="entry.approved != 1"> <ion-item text-wrap *ngIf="entry.approved != 1">
<p><em>{{ 'addon.mod_glossary.entrypendingapproval' | translate }}</em></p> <p><em>{{ 'addon.mod_glossary.entrypendingapproval' | translate }}</em></p>
</ion-item> </ion-item>

View File

@ -19,6 +19,7 @@ import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreDirectivesModule } from '@directives/directives.module';
import { CorePipesModule } from '@pipes/pipes.module'; import { CorePipesModule } from '@pipes/pipes.module';
import { CoreRatingComponentsModule } from '@core/rating/components/components.module'; import { CoreRatingComponentsModule } from '@core/rating/components/components.module';
import { CoreTagComponentsModule } from '@core/tag/components/components.module';
import { AddonModGlossaryEntryPage } from './entry'; import { AddonModGlossaryEntryPage } from './entry';
@NgModule({ @NgModule({
@ -31,7 +32,8 @@ import { AddonModGlossaryEntryPage } from './entry';
CorePipesModule, CorePipesModule,
IonicPageModule.forChild(AddonModGlossaryEntryPage), IonicPageModule.forChild(AddonModGlossaryEntryPage),
TranslateModule.forChild(), TranslateModule.forChild(),
CoreRatingComponentsModule CoreRatingComponentsModule,
CoreTagComponentsModule
], ],
}) })
export class AddonModForumDiscussionPageModule {} export class AddonModForumDiscussionPageModule {}

View File

@ -16,6 +16,7 @@ import { Component } from '@angular/core';
import { IonicPage, NavParams } from 'ionic-angular'; import { IonicPage, NavParams } from 'ionic-angular';
import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreRatingInfo } from '@core/rating/providers/rating'; import { CoreRatingInfo } from '@core/rating/providers/rating';
import { CoreTagProvider } from '@core/tag/providers/tag';
import { AddonModGlossaryProvider } from '../../providers/glossary'; import { AddonModGlossaryProvider } from '../../providers/glossary';
/** /**
@ -35,15 +36,18 @@ export class AddonModGlossaryEntryPage {
showAuthor = false; showAuthor = false;
showDate = false; showDate = false;
ratingInfo: CoreRatingInfo; ratingInfo: CoreRatingInfo;
tagsEnabled: boolean;
protected courseId: number; protected courseId: number;
protected entryId: number; protected entryId: number;
constructor(navParams: NavParams, constructor(navParams: NavParams,
private domUtils: CoreDomUtilsProvider, private domUtils: CoreDomUtilsProvider,
private glossaryProvider: AddonModGlossaryProvider) { private glossaryProvider: AddonModGlossaryProvider,
private tagProvider: CoreTagProvider) {
this.courseId = navParams.get('courseId'); this.courseId = navParams.get('courseId');
this.entryId = navParams.get('entryId'); this.entryId = navParams.get('entryId');
this.tagsEnabled = this.tagProvider.areTagsAvailableInSite();
} }
/** /**