From 2ea97b0840beb4b0d27304863e20f67829a2d002 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Mon, 8 Jul 2019 11:13:50 +0200 Subject: [PATCH] MOBILE-2201 blog: Display tags in blog posts --- src/addon/blog/components/components.module.ts | 4 +++- src/addon/blog/components/entries/addon-blog-entries.html | 4 ++++ src/addon/blog/components/entries/entries.ts | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/addon/blog/components/components.module.ts b/src/addon/blog/components/components.module.ts index 0e56fcc3f..efba08d7d 100644 --- a/src/addon/blog/components/components.module.ts +++ b/src/addon/blog/components/components.module.ts @@ -20,6 +20,7 @@ import { CoreComponentsModule } from '@components/components.module'; import { CoreDirectivesModule } from '@directives/directives.module'; import { CorePipesModule } from '@pipes/pipes.module'; import { CoreCommentsComponentsModule } from '@core/comments/components/components.module'; +import { CoreTagComponentsModule } from '@core/tag/components/components.module'; import { AddonBlogEntriesComponent } from './entries/entries'; @NgModule({ @@ -33,7 +34,8 @@ import { AddonBlogEntriesComponent } from './entries/entries'; CoreComponentsModule, CoreDirectivesModule, CorePipesModule, - CoreCommentsComponentsModule + CoreCommentsComponentsModule, + CoreTagComponentsModule ], providers: [ ], diff --git a/src/addon/blog/components/entries/addon-blog-entries.html b/src/addon/blog/components/entries/addon-blog-entries.html index 670e4d276..690930091 100644 --- a/src/addon/blog/components/entries/addon-blog-entries.html +++ b/src/addon/blog/components/entries/addon-blog-entries.html @@ -29,6 +29,10 @@ + +
{{ 'core.tag.tags' | translate }}:
+ +
diff --git a/src/addon/blog/components/entries/entries.ts b/src/addon/blog/components/entries/entries.ts index b66db02a3..a0e4bd3da 100644 --- a/src/addon/blog/components/entries/entries.ts +++ b/src/addon/blog/components/entries/entries.ts @@ -19,6 +19,7 @@ import { CoreSitesProvider } from '@providers/sites'; import { CoreUserProvider } from '@core/user/providers/user'; import { AddonBlogProvider } from '../../providers/blog'; import { CoreCommentsProvider } from '@core/comments/providers/comments'; +import { CoreTagProvider } from '@core/tag/providers/tag'; /** * Component that displays the blog entries. @@ -49,10 +50,11 @@ export class AddonBlogEntriesComponent implements OnInit { onlyMyEntries = false; component = AddonBlogProvider.COMPONENT; commentsEnabled: boolean; + tagsEnabled: boolean; constructor(protected blogProvider: AddonBlogProvider, protected domUtils: CoreDomUtilsProvider, protected userProvider: CoreUserProvider, sitesProvider: CoreSitesProvider, - protected commentsProvider: CoreCommentsProvider) { + protected commentsProvider: CoreCommentsProvider, private tagProvider: CoreTagProvider) { this.currentUserId = sitesProvider.getCurrentSiteUserId(); } @@ -85,6 +87,7 @@ export class AddonBlogEntriesComponent implements OnInit { } this.commentsEnabled = !this.commentsProvider.areCommentsDisabledInSite(); + this.tagsEnabled = this.tagProvider.areTagsAvailableInSite(); this.fetchEntries().then(() => { this.blogProvider.logView(this.filter).catch(() => {