Skip to content

Commit

Permalink
fix(discover): Display 'partly available' status on TV show discover …
Browse files Browse the repository at this point in the history
…card

[no ci]
  • Loading branch information
tidusjar authored Mar 29, 2022
2 parents 776f5ea + e625090 commit 9033f1d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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");
}
Expand Down

0 comments on commit 9033f1d

Please sign in to comment.