From 0d3a9be9f13c2642cb6cf26fdebc5edf5217bbbc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Dec 2019 16:28:05 +0100 Subject: Add likes/dislikes counts in the buttons --- .../app/videos/+video-watch/video-watch.component.html | 6 ++++-- .../app/videos/+video-watch/video-watch.component.scss | 15 +++++++++++++++ .../src/app/videos/+video-watch/video-watch.component.ts | 6 ++++++ 3 files changed, 25 insertions(+), 2 deletions(-) (limited to 'client/src/app/videos/+video-watch') diff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/videos/+video-watch/video-watch.component.html index 5b2e91bc5..58b2382f0 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.html +++ b/client/src/app/videos/+video-watch/video-watch.component.html @@ -58,19 +58,21 @@
+ {{ video.likes }}
+ {{ video.dislikes }}
diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/videos/+video-watch/video-watch.component.scss index 80d01b7ce..86b44d5da 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.scss +++ b/client/src/app/videos/+video-watch/video-watch.component.scss @@ -239,9 +239,20 @@ $player-factor: 1.7; // 16/9 display: none; } + .action-button-like, + .action-button-dislike { + .count { + margin-right: 5px; + } + } + &.action-button-like.activated { background-color: $green; + .count { + color: #fff; + } + my-global-icon { @include apply-svg-color(#fff); } @@ -250,6 +261,10 @@ $player-factor: 1.7; // 16/9 &.action-button-dislike.activated { background-color: $red; + .count { + color: #fff; + } + my-global-icon { @include apply-svg-color(#fff); } diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 0007331f8..aacd697cf 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -166,6 +166,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy { else this.setRating('dislike') } + getRatePopoverText () { + if (this.isUserLoggedIn()) return undefined + + return this.i18n('You need to be connected to rate this content.') + } + showMoreDescription () { if (this.completeVideoDescription === undefined) { return this.loadCompleteDescription() -- cgit v1.2.3