added old label (> 3 months)
This commit is contained in:
parent
8d5d6ae5d1
commit
0e214f1204
|
@ -63,6 +63,9 @@
|
||||||
*ngIf="hasReply">
|
*ngIf="hasReply">
|
||||||
replies
|
replies
|
||||||
</div>
|
</div>
|
||||||
|
<div class="status__labels--label status__labels--old" title="this status is old" *ngIf="isOld">
|
||||||
|
old
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div #content class="status__content" innerHTML="{{displayedStatus.content}}"></div> -->
|
<!-- <div #content class="status__content" innerHTML="{{displayedStatus.content}}"></div> -->
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,9 @@
|
||||||
&--discuss {
|
&--discuss {
|
||||||
background-color: rgb(90, 0, 143);
|
background-color: rgb(90, 0, 143);
|
||||||
}
|
}
|
||||||
|
&--old {
|
||||||
|
background-color: rgb(150, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&__name {
|
&__name {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
|
@ -30,6 +30,7 @@ export class StatusComponent implements OnInit {
|
||||||
replyingToStatus: boolean;
|
replyingToStatus: boolean;
|
||||||
isCrossPoster: boolean;
|
isCrossPoster: boolean;
|
||||||
isThread: boolean;
|
isThread: boolean;
|
||||||
|
isOld: boolean;
|
||||||
isContentWarned: boolean;
|
isContentWarned: boolean;
|
||||||
hasReply: boolean;
|
hasReply: boolean;
|
||||||
contentWarningText: string;
|
contentWarningText: string;
|
||||||
|
@ -121,6 +122,13 @@ export class StatusComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hasReply = status.replies_count > 0;
|
this.hasReply = status.replies_count > 0;
|
||||||
|
|
||||||
|
let createdAt = new Date(status.created_at);
|
||||||
|
let now = new Date();
|
||||||
|
now.setMonth(now.getMonth() - 3);
|
||||||
|
if (now > createdAt) {
|
||||||
|
this.isOld = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openAccount(account: Account): boolean {
|
openAccount(account: Account): boolean {
|
||||||
|
|
Loading…
Reference in New Issue