fix(discover): Display 'partly available' status on TV show discover card

[no ci]
pull/4575/head
Jamie 3 years ago committed by GitHub
commit 9033f1d548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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