From e66d66fbf6ee3a37f01b1dff4f0942c2c140c87e Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 31 Mar 2024 23:15:28 +0200 Subject: [PATCH] feat(portals): show imdb rating in grid view --- .../category-content-view.component.html | 15 ++++++++++--- .../category-content-view.component.scss | 22 +++++++++++++++++++ .../category-content-view.component.ts | 6 ++++- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/app/xtream/category-content-view/category-content-view.component.html b/src/app/xtream/category-content-view/category-content-view.component.html index b6147cb98..dd952b132 100644 --- a/src/app/xtream/category-content-view/category-content-view.component.html +++ b/src/app/xtream/category-content-view/category-content-view.component.html @@ -1,7 +1,6 @@
+
+ star{{ item.rating || item.rating_imdb }} +
{{ item.name }}
@@ -31,13 +38,15 @@ *ngIf="!(items | filterBy: searchPhrase() : 'name')?.length" > search -
Nothing found, try to change you search request
+
+ {{ 'PORTALS.EMPTY_LIST_VIEW.NO_SEARCH_RESULTS' | translate }} +
list -
This category is empty, try another one
+
{{ 'PORTALS.EMPTY_LIST_VIEW.EMPTY_CATEGORY' | translate }}
diff --git a/src/app/xtream/category-content-view/category-content-view.component.scss b/src/app/xtream/category-content-view/category-content-view.component.scss index d0df179e6..e02301937 100644 --- a/src/app/xtream/category-content-view/category-content-view.component.scss +++ b/src/app/xtream/category-content-view/category-content-view.component.scss @@ -6,6 +6,7 @@ mat-card { overflow: hidden; transition: all 0.9s cubic-bezier(0.25, 0.8, 0.25, 1); + box-shadow: none; } mat-card:hover { @@ -49,10 +50,31 @@ mat-card:hover { .title { word-break: break-all; padding: 8px; + text-align: center; } } } +.rating { + position: absolute; + top: 5px; + right: 6px; + background-color: #3bb33b; + color: #fff; + font-size: 0.8em; + border-radius: 3px; + display: flex; + justify-content: center; + align-items: center; + padding: 0 5px; + + mat-icon { + font-size: 16px; + height: 18px; + width: 18px; + } +} + .no-content { text-align: center; diff --git a/src/app/xtream/category-content-view/category-content-view.component.ts b/src/app/xtream/category-content-view/category-content-view.component.ts index d5d31ecb8..3340c4a7f 100644 --- a/src/app/xtream/category-content-view/category-content-view.component.ts +++ b/src/app/xtream/category-content-view/category-content-view.component.ts @@ -3,6 +3,8 @@ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { XtreamItem } from '../../../../shared/xtream-item.interface'; import { FilterPipe } from '../../shared/pipes/filter.pipe'; import { PortalStore } from '../portal.store'; @@ -19,11 +21,13 @@ import { PortalStore } from '../portal.store'; NgIf, FilterPipe, FormsModule, + MatTooltipModule, + TranslateModule, ], }) export class CategoryContentViewComponent { @Input({ required: true }) items: XtreamItem[]; - @Output() itemClicked = new EventEmitter(); + @Output() itemClicked = new EventEmitter(); portalStore = inject(PortalStore);