From fab3fbe966016b403f4ee09cbfd39dccf011357f Mon Sep 17 00:00:00 2001 From: dianawieczorek Date: Wed, 26 Sep 2018 13:29:49 +0200 Subject: [PATCH 1/4] changed custom facebook metatags for organizations --- frontend/src/app/metatags.service.ts | 10 +++++----- .../organization-details.component.ts | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/metatags.service.ts b/frontend/src/app/metatags.service.ts index a9485a68..20796c40 100644 --- a/frontend/src/app/metatags.service.ts +++ b/frontend/src/app/metatags.service.ts @@ -22,11 +22,11 @@ export class MetatagsService { this.titleService.setTitle(title); // set default tags, that will be orverwritten below: - this.metaService.updateTag({ name: 'og:url', content: this.getCanonicalUrl(this.locationService.path()) }); - this.metaService.updateTag({ name: 'og:title', content: 'Volontulo. Portal dla wolontariuszy' }); - this.metaService.updateTag({ name: 'og:description', content: 'Volontulo. Portal dla wolontariuszy'}); - this.metaService.updateTag({ name: 'og:image', content: this.getCanonicalUrl('/assets/img/banner/volontulo_baner.png') }); - this.metaService.updateTag({ name: 'fb:app_id', content: environment.fbAppID }); + this.metaService.updateTag({ property: 'og:url', content: this.getCanonicalUrl(this.locationService.path()) }); + this.metaService.updateTag({ property: 'og:title', content: 'Volontulo. Portal dla wolontariuszy' }); + this.metaService.updateTag({ property: 'og:description', content: 'Volontulo. Portal dla wolontariuszy'}); + this.metaService.updateTag({ property: 'og:image', content: this.getCanonicalUrl('/assets/img/banner/volontulo_baner.png') }); + this.metaService.updateTag({ property: 'fb:app_id', content: environment.fbAppID }); Object.keys(metatags) .map((key) => ({name: key, content: metatags[key]})) diff --git a/frontend/src/app/organization/organization-details/organization-details.component.ts b/frontend/src/app/organization/organization-details/organization-details.component.ts index be3c53e3..9a5d7459 100644 --- a/frontend/src/app/organization/organization-details/organization-details.component.ts +++ b/frontend/src/app/organization/organization-details/organization-details.component.ts @@ -1,7 +1,8 @@ -import { Component, Input } from '@angular/core'; +import {Component, Inject, Input} from '@angular/core'; -import { Organization } from '../organization.model'; -import { environment } from '../../../environments/environment'; +import {Organization} from '../organization.model'; +import {environment} from '../../../environments/environment'; +import {Meta} from "@angular/platform-browser"; @Component({ selector: 'volontulo-organization-details', @@ -13,4 +14,14 @@ export class OrganizationDetailsComponent { @Input() isUserOrgMember: boolean; @Input() organization: Organization; djangoRoot: string = environment.djangoRoot; + + constructor(private metaService: Meta) + { + } + + ngOnInit() { + this.metaService.updateTag({ property: 'og:title', content: this.organization.name + '- Volontulo. Portal dla wolontariuszy' }); + this.metaService.updateTag({ property: 'og:description', content: this.organization.description}); + } + } From cf426b8ff967050eb3d31fba11d23357c747d57a Mon Sep 17 00:00:00 2001 From: dianawieczorek Date: Wed, 26 Sep 2018 17:38:24 +0200 Subject: [PATCH 2/4] revert unnecessary changes --- frontend/src/app/metatags.service.ts | 10 +++++----- .../organization-details.component.ts | 17 +++-------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/frontend/src/app/metatags.service.ts b/frontend/src/app/metatags.service.ts index 4eed83fe..6508d7b6 100644 --- a/frontend/src/app/metatags.service.ts +++ b/frontend/src/app/metatags.service.ts @@ -22,11 +22,11 @@ export class MetatagsService { this.titleService.setTitle(title); // set default tags, that will be orverwritten below: - this.metaService.updateTag({ property: 'og:url', content: this.getCanonicalUrl(this.locationService.path()) }); - this.metaService.updateTag({ property: 'og:title', content: 'Volontulo. Portal dla wolontariuszy' }); - this.metaService.updateTag({ property: 'og:description', content: 'Volontulo. Portal dla wolontariuszy'}); - this.metaService.updateTag({ property: 'og:image', content: this.getCanonicalUrl('/assets/img/banner/volontulo_baner.png') }); - this.metaService.updateTag({ property: 'fb:app_id', content: environment.fbAppID }); + this.metaService.updateTag({ name: 'og:url', content: this.getCanonicalUrl(this.locationService.path()) }); + this.metaService.updateTag({ name: 'og:title', content: 'Volontulo. Portal dla wolontariuszy' }); + this.metaService.updateTag({ name: 'og:description', content: 'Volontulo. Portal dla wolontariuszy'}); + this.metaService.updateTag({ name: 'og:image', content: this.getCanonicalUrl('/assets/img/banner/volontulo_baner.png') }); + this.metaService.updateTag({ name: 'fb:app_id', content: environment.fbAppID }); Object.keys(metatags) .map((key) => ({ property: key, content: metatags[key] })) diff --git a/frontend/src/app/organization/organization-details/organization-details.component.ts b/frontend/src/app/organization/organization-details/organization-details.component.ts index 9a5d7459..be3c53e3 100644 --- a/frontend/src/app/organization/organization-details/organization-details.component.ts +++ b/frontend/src/app/organization/organization-details/organization-details.component.ts @@ -1,8 +1,7 @@ -import {Component, Inject, Input} from '@angular/core'; +import { Component, Input } from '@angular/core'; -import {Organization} from '../organization.model'; -import {environment} from '../../../environments/environment'; -import {Meta} from "@angular/platform-browser"; +import { Organization } from '../organization.model'; +import { environment } from '../../../environments/environment'; @Component({ selector: 'volontulo-organization-details', @@ -14,14 +13,4 @@ export class OrganizationDetailsComponent { @Input() isUserOrgMember: boolean; @Input() organization: Organization; djangoRoot: string = environment.djangoRoot; - - constructor(private metaService: Meta) - { - } - - ngOnInit() { - this.metaService.updateTag({ property: 'og:title', content: this.organization.name + '- Volontulo. Portal dla wolontariuszy' }); - this.metaService.updateTag({ property: 'og:description', content: this.organization.description}); - } - } From 5cb3f22e6de7da2525cf241074d9f2b118529940 Mon Sep 17 00:00:00 2001 From: dianawieczorek Date: Wed, 26 Sep 2018 18:05:49 +0200 Subject: [PATCH 3/4] partially done, now waiting for backend part --- .../organization-details/organization-details.component.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/app/organization/organization-details/organization-details.component.html b/frontend/src/app/organization/organization-details/organization-details.component.html index b6f6538c..c5126b9a 100644 --- a/frontend/src/app/organization/organization-details/organization-details.component.html +++ b/frontend/src/app/organization/organization-details/organization-details.component.html @@ -1,4 +1,8 @@
+
+ + {{ organization.name }} +

Organizacja

Nazwa
From 0e88cb43592f2d00791c7ce4f7bb3eb30f83bf89 Mon Sep 17 00:00:00 2001 From: dianawieczorek Date: Thu, 18 Oct 2018 09:57:54 +0200 Subject: [PATCH 4/4] changed name to property --- frontend/src/app/metatags.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/metatags.service.ts b/frontend/src/app/metatags.service.ts index 6508d7b6..4eed83fe 100644 --- a/frontend/src/app/metatags.service.ts +++ b/frontend/src/app/metatags.service.ts @@ -22,11 +22,11 @@ export class MetatagsService { this.titleService.setTitle(title); // set default tags, that will be orverwritten below: - this.metaService.updateTag({ name: 'og:url', content: this.getCanonicalUrl(this.locationService.path()) }); - this.metaService.updateTag({ name: 'og:title', content: 'Volontulo. Portal dla wolontariuszy' }); - this.metaService.updateTag({ name: 'og:description', content: 'Volontulo. Portal dla wolontariuszy'}); - this.metaService.updateTag({ name: 'og:image', content: this.getCanonicalUrl('/assets/img/banner/volontulo_baner.png') }); - this.metaService.updateTag({ name: 'fb:app_id', content: environment.fbAppID }); + this.metaService.updateTag({ property: 'og:url', content: this.getCanonicalUrl(this.locationService.path()) }); + this.metaService.updateTag({ property: 'og:title', content: 'Volontulo. Portal dla wolontariuszy' }); + this.metaService.updateTag({ property: 'og:description', content: 'Volontulo. Portal dla wolontariuszy'}); + this.metaService.updateTag({ property: 'og:image', content: this.getCanonicalUrl('/assets/img/banner/volontulo_baner.png') }); + this.metaService.updateTag({ property: 'fb:app_id', content: environment.fbAppID }); Object.keys(metatags) .map((key) => ({ property: key, content: metatags[key] }))