diff --git a/src/app/components/feed/postlist/postlist.component.html b/src/app/components/feed/postlist/postlist.component.html
index f07a137..f74d789 100644
--- a/src/app/components/feed/postlist/postlist.component.html
+++ b/src/app/components/feed/postlist/postlist.component.html
@@ -1,16 +1,23 @@
-
+
-
@@ -22,10 +29,11 @@
-
+
-
+
{{post.upvotes}}
{{post.downvotes}}
@@ -57,4 +69,4 @@
-
+
\ No newline at end of file
diff --git a/src/app/components/feed/postlist/postlist.component.ts b/src/app/components/feed/postlist/postlist.component.ts
index 84e2044..fee24fa 100644
--- a/src/app/components/feed/postlist/postlist.component.ts
+++ b/src/app/components/feed/postlist/postlist.component.ts
@@ -1,7 +1,10 @@
-import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {Post} from 'src/app/models/post';
-import {FeedService} from 'src/app/services/feed/feed.service';
-import {Router} from '@angular/router';
+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
+import { Post } from 'src/app/models/post';
+import { FeedService } from 'src/app/services/feed/feed.service';
+import { Router } from '@angular/router';
+import { DatasharingService } from 'src/app/services/datasharing.service';
+import { ActivityService } from 'src/app/services/activity/activity.service';
+import { ReportReason } from 'src/app/models/reportReason';
@Component({
selector: 'feed-postlist',
@@ -13,11 +16,23 @@ export class PostlistComponent implements OnInit {
@Input() childPostList: Post[];
@Output() voteEvent = new EventEmitter();
selectedPost: Post;
+ loggedIn = false;
+ reportReasons: ReportReason[] = new Array();
- constructor(private feedService: FeedService, private router: Router) {
+ constructor(private feedService: FeedService,
+ private data: DatasharingService,
+ private router: Router,
+ private activityService: ActivityService) {
}
ngOnInit() {
+ this.data.currentUser.subscribe(user => {
+ this.loggedIn = user.loggedIn;
+ });
+ this.activityService.getReportReasons();
+ this.activityService.reportReasonList.subscribe(response => {
+ this.reportReasons = response;
+ });
}
voteUp(pPost: Post) {
@@ -49,6 +64,10 @@ export class PostlistComponent implements OnInit {
});
}
+ reportPost(reason: ReportReason, post: Post) {
+ this.feedService.reportPost(reason.id, post.id).subscribe();
+ }
+
onLoad(post: Post) {
post.mediaLoading = false;
}
diff --git a/src/app/components/group/group.component.html b/src/app/components/group/group.component.html
index 132e5b1..5b80133 100644
--- a/src/app/components/group/group.component.html
+++ b/src/app/components/group/group.component.html
@@ -134,7 +134,7 @@
{{user.username}}
{{user.handle}}
- [admin]
+ [admin]