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>
</div>
</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">
<p><em>{{ 'addon.mod_glossary.entrypendingapproval' | translate }}</em></p>
</ion-item>

View File

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

View File

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