From 3ba447c794375e00fb916fb20133b046cca6b359 Mon Sep 17 00:00:00 2001 From: Sebastian Mayoral Date: Tue, 9 Jan 2018 00:21:27 +0100 Subject: [PATCH 1/2] Meta for sharing. --- .../src/app/components/course/course.component.html | 2 +- .../src/app/components/social/social.component.html | 1 + .../csyllabus/src/app/components/social/social.component.ts | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/csyllabus/src/app/components/course/course.component.html b/frontend/csyllabus/src/app/components/course/course.component.html index 958e6c4..9a4d49a 100644 --- a/frontend/csyllabus/src/app/components/course/course.component.html +++ b/frontend/csyllabus/src/app/components/course/course.component.html @@ -68,7 +68,7 @@ - + diff --git a/frontend/csyllabus/src/app/components/social/social.component.html b/frontend/csyllabus/src/app/components/social/social.component.html index ed828ad..f5adbfb 100644 --- a/frontend/csyllabus/src/app/components/social/social.component.html +++ b/frontend/csyllabus/src/app/components/social/social.component.html @@ -5,6 +5,7 @@

Share this Syllabus with your friends:

[stumbleUpOn]="false" [reddit]="false" [tumblr]="false" + [url]="https://csyllabus.com/demo/course/{{courseID}}" [title]="{{title}}" [description]="{{description}}" > diff --git a/frontend/csyllabus/src/app/components/social/social.component.ts b/frontend/csyllabus/src/app/components/social/social.component.ts index b70fbab..f92a27a 100644 --- a/frontend/csyllabus/src/app/components/social/social.component.ts +++ b/frontend/csyllabus/src/app/components/social/social.component.ts @@ -4,7 +4,6 @@ import {Component, OnInit, Input} from '@angular/core'; import {AuthService} from "angular4-social-login"; import {FacebookLoginProvider, GoogleLoginProvider} from "angular4-social-login"; import {SocialUser} from "angular4-social-login"; - @Component({ selector: 'app-social', templateUrl: './social.component.html', @@ -16,6 +15,10 @@ export class SocialComponent implements OnInit { private user: SocialUser; private loggedIn: boolean; @Input() courseId: number; + @Input() title: string; + @Input() university: string; + @Input() country: string; + @Input() description: string; constructor(private authService: AuthService, private coursesService: CoursesService) { From e2b5855ee597ca4da20c781b540575f4ca4586a9 Mon Sep 17 00:00:00 2001 From: Sebastian Mayoral Date: Tue, 9 Jan 2018 00:42:09 +0100 Subject: [PATCH 2/2] meta for sharing Corrected --- .../csyllabus/src/app/components/course/course.component.html | 2 +- .../csyllabus/src/app/components/social/social.component.html | 2 +- .../csyllabus/src/app/components/social/social.component.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/csyllabus/src/app/components/course/course.component.html b/frontend/csyllabus/src/app/components/course/course.component.html index 9a4d49a..bdeab20 100644 --- a/frontend/csyllabus/src/app/components/course/course.component.html +++ b/frontend/csyllabus/src/app/components/course/course.component.html @@ -68,7 +68,7 @@ - + diff --git a/frontend/csyllabus/src/app/components/social/social.component.html b/frontend/csyllabus/src/app/components/social/social.component.html index f5adbfb..d11b8cb 100644 --- a/frontend/csyllabus/src/app/components/social/social.component.html +++ b/frontend/csyllabus/src/app/components/social/social.component.html @@ -5,7 +5,7 @@

Share this Syllabus with your friends:

[stumbleUpOn]="false" [reddit]="false" [tumblr]="false" - [url]="https://csyllabus.com/demo/course/{{courseID}}" [title]="{{title}}" [description]="{{description}}" + [url]=url [title]=title [description]=description > diff --git a/frontend/csyllabus/src/app/components/social/social.component.ts b/frontend/csyllabus/src/app/components/social/social.component.ts index f92a27a..3f49256 100644 --- a/frontend/csyllabus/src/app/components/social/social.component.ts +++ b/frontend/csyllabus/src/app/components/social/social.component.ts @@ -19,6 +19,7 @@ export class SocialComponent implements OnInit { @Input() university: string; @Input() country: string; @Input() description: string; + private url: string; constructor(private authService: AuthService, private coursesService: CoursesService) { @@ -80,6 +81,7 @@ export class SocialComponent implements OnInit { this.user = user; this.loggedIn = (user != null); }) + this.url = "https://csyllabus.com/demo/course/"+this.courseId; this.coursesService.getAllCommentsByCourse(this.courseId).subscribe(res => { this.comments = res;