Display 'partly available' status on TV show discover card

pull/4565/head
Florian Dupret 3 years ago
parent 4a18d66164
commit e62509093e

@ -6,7 +6,7 @@
{{ 'Common.' + RequestType[result.type] | translate }}
</div>
<div class="{{getStatusClass()}} top-right" id="status{{result.id}}">
<span class="indicator"></span><span class="indicator-text" id="availabilityStatus{{result.id}}">{{getAvailbilityStatus()}}</span>
<span class="indicator"></span><span class="indicator-text" id="availabilityStatus{{result.id}}">{{getAvailabilityStatus()}}</span>
</div>
</div>
<img [routerLink]="generateDetailsLink()" id="cardImage" src="{{result.posterPath}}" class="image"

@ -201,30 +201,26 @@ small {
margin-right:5px;
}
.top-right.available span.indicator, span.indicator-text{
.top-right span.indicator, span.indicator-text{
display:block;
}
.top-right.available span.indicator:before{
.top-right span.indicator:before{
display: inline-block;
background-color: #1DE9B6;
}
.top-right.approved span.indicator, span.indicator-text {
display: block;
.top-right.available span.indicator:before{
background-color: #1DE9B6;
}
.top-right.approved span.indicator:before{
display: inline-block;
background-color: #ff5722;
}
.top-right.requested span.indicator, span.indicator-text {
display: block;
.top-right.partly-available span.indicator:before{
background-color: #ffd740;
}
.top-right.requested span.indicator:before{
display: inline-block;
background-color: #ffd740;
}

@ -92,6 +92,9 @@ export class DiscoverCardComponent implements OnInit {
if (this.result.available) {
return "available";
}
if (this.tvSearchResult?.partlyAvailable) {
return "partly-available";
}
if (this.result.approved) {
return "approved";
}
@ -101,10 +104,13 @@ export class DiscoverCardComponent implements OnInit {
return "";
}
public getAvailbilityStatus(): string {
public getAvailabilityStatus(): string {
if (this.result.available) {
return this.translate.instant("Common.Available");
}
if (this.tvSearchResult?.partlyAvailable) {
return this.translate.instant("Common.PartlyAvailable");
}
if (this.result.approved) {
return this.translate.instant("Common.Approved");
}

Loading…
Cancel
Save