Merge branch 'max_dev' of Software_Engineering_I/greenvironment-frontend into master

master
Trivernis 5 years ago committed by Gitea
commit d9a4aa7637

@ -21,6 +21,9 @@
<mat-card class="post" *ngFor = "let post of childPostList" [class.selected]="post === selectedPost" tabindex="0"> <mat-card class="post" *ngFor = "let post of childPostList" [class.selected]="post === selectedPost" tabindex="0">
<mat-card-header> <mat-card-header>
<div mat-card-avatar>
<img class="profile-picture" [src]="post.author.profilePicture"/>
</div>
<div id="button-box"> <div id="button-box">
<button mat-icon-button [matMenuTriggerFor]="menu" id="menu-button" *ngIf="post.deletable"> <button mat-icon-button [matMenuTriggerFor]="menu" id="menu-button" *ngIf="post.deletable">
<mat-icon>more_vert</mat-icon> <mat-icon>more_vert</mat-icon>

@ -8,7 +8,7 @@
outline: none outline: none
user-select: none user-select: none
::ng-deep .mat-card-header-text ::ng-deep .mat-card-header-text
margin: 0px margin-top: 10px
.mat-card-subtitle .mat-card-subtitle
display: contents display: contents
a:hover a:hover
@ -31,4 +31,13 @@
.span .span
margin-left: 32px margin-left: 32px
$mat-card-header-size: 100px !default
.profile-picture
height: $mat-card-header-size
width: $mat-card-header-size
border-radius: 50%
flex-shrink: 0
background-size: cover
transition-duration: 0.5s
z-index: 10
object-fit: cover

@ -2,10 +2,12 @@ export class Author {
id: number; id: number;
name: string; name: string;
handle: string; handle: string;
profilePicture: string;
constructor(pId: number, pName: string, pHandle: string) { constructor(pId: number, pName: string, pHandle: string, pic: string) {
this.id = pId; this.id = pId;
this.name = pName; this.name = pName;
this.handle = pHandle; this.handle = pHandle;
this.profilePicture = pic;
} }
} }

@ -45,6 +45,7 @@ export class FeedService {
author{ author{
name, name,
handle, handle,
profilePicture,
id}, id},
createdAt} createdAt}
}`, variables: { }`, variables: {
@ -80,6 +81,7 @@ export class FeedService {
author{ author{
name, name,
handle, handle,
profilePicture,
id}, id},
createdAt} createdAt}
}`, variables: { }`, variables: {
@ -214,6 +216,7 @@ export class FeedService {
author{ author{
name, name,
handle, handle,
profilePicture,
id}, id},
createdAt} createdAt}
}`, variables: { }`, variables: {
@ -232,7 +235,13 @@ export class FeedService {
const downvotes: number = post.downvotes; const downvotes: number = post.downvotes;
const userVote: string = post.userVote; const userVote: string = post.userVote;
const deletable: boolean = post.deletable; const deletable: boolean = post.deletable;
const author = new Author(post.author.id, post.author.name, post.author.handle); let profilePicture: string;
if (post.author.profilePicture) {
profilePicture = environment.greenvironmentUrl + post.author.profilePicture;
} else {
profilePicture = 'assets/images/account_circle-24px.svg';
}
const author = new Author(post.author.id, post.author.name, post.author.handle, profilePicture);
const temp = new Date(Number(post.createdAt)); const temp = new Date(Number(post.createdAt));
const date = temp.toLocaleString('en-GB'); const date = temp.toLocaleString('en-GB');
let activity: Activity; let activity: Activity;
@ -258,7 +267,13 @@ export class FeedService {
const downvotes: number = post.downvotes; const downvotes: number = post.downvotes;
const userVote: string = post.userVote; const userVote: string = post.userVote;
const deletable: boolean = post.deletable; const deletable: boolean = post.deletable;
const author = new Author(post.author.id, post.author.name, post.author.handle); let profilePicture: string;
if (post.author.profilePicture) {
profilePicture = environment.greenvironmentUrl + post.author.profilePicture;
} else {
profilePicture = 'assets/images/account_circle-24px.svg';
}
const author = new Author(post.author.id, post.author.name, post.author.handle, profilePicture);
const temp = new Date(Number(post.createdAt)); const temp = new Date(Number(post.createdAt));
const date = temp.toLocaleString('en-GB'); const date = temp.toLocaleString('en-GB');
let activity: Activity; let activity: Activity;

@ -59,6 +59,7 @@ export class ProfileService {
author{ author{
name, name,
handle, handle,
profilePicture
id}, id},
createdAt createdAt
} }
@ -97,7 +98,13 @@ export class ProfileService {
const downvotes: number = post.downvotes; const downvotes: number = post.downvotes;
const userVote: string = post.userVote; const userVote: string = post.userVote;
const deletable: boolean = post.deletable; const deletable: boolean = post.deletable;
const author = new Author(post.author.id, post.author.name, post.author.handle); let profilePicture: string;
if (post.author.profilePicture) {
profilePicture = environment.greenvironmentUrl + post.author.profilePicture;
} else {
profilePicture = 'assets/images/account_circle-24px.svg';
}
const author = new Author(post.author.id, post.author.name, post.author.handle, profilePicture);
const ptemp = new Date(Number(post.createdAt)); const ptemp = new Date(Number(post.createdAt));
const pdate = ptemp.toLocaleString('en-GB'); const pdate = ptemp.toLocaleString('en-GB');
let activity: Activity; let activity: Activity;

Loading…
Cancel
Save