Skip to content

Commit

Permalink
clean up game preview display
Browse files Browse the repository at this point in the history
  • Loading branch information
mrosack committed Jan 4, 2024
1 parent abe4cd3 commit f1b4a84
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/game/open-games/open-games.component.html
Expand Up @@ -32,7 +32,7 @@ <h1>Open Games</h1>
<h1 *ngIf="!(filteredGames$ | async).length">No games found.</h1>
<div *ngFor="let game of filteredGames$ | async">
<div class="well">
<pydt-game-preview [game]="game"></pydt-game-preview>
<pydt-game-preview [game]="game" [hideNotStarted]="true"></pydt-game-preview>
<div class="row">
<div class="col-xs-12 text-center">
<button type="button" class="btn btn-primary" [routerLink]="['/game', game.gameId]">
Expand Down
4 changes: 3 additions & 1 deletion src/app/game/preview/preview.component.html
Expand Up @@ -23,7 +23,9 @@
>
Sort via Play Times
</button>
<p *ngIf="showLastTurn" class="pull-right ml">{{ lastTurnText$ | async }}</p>
<p *ngIf="showTurnInfo && game.gameTurnRangeKey > 1" class="pull-right ml">
Round {{ game.round }} - {{ lastTurnText$ | async }}
</p>
<h3 [class.yourTurn]="game.inProgress && activeProfile?.steamid === game.currentPlayerSteamId">
<img
src="/img/game_{{ game.gameType }}.png"
Expand Down
5 changes: 3 additions & 2 deletions src/app/game/preview/preview.component.ts
Expand Up @@ -29,7 +29,8 @@ export class GamePreviewComponent implements OnChanges {
@Input() game: Game;
@Input() editMode = false;
@Input() availableCivs: CivDef[];
@Input() showLastTurn = false;
@Input() showTurnInfo = false;
@Input() hideNotStarted = false;
@Output() gameUpdated = new EventEmitter<Game>();
@ViewChild("playerDetailModal", { static: true }) playerDetailModal: ModalDirective;
lastTurnText$: Observable<string>;
Expand Down Expand Up @@ -105,7 +106,7 @@ export class GamePreviewComponent implements OnChanges {
let result = this.game.displayName;
const addlData: string[] = [];

if (!this.game.inProgress) {
if (!this.hideNotStarted && !this.game.inProgress) {
addlData.push("Not Started");
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/user/games/games.component.html
Expand Up @@ -15,7 +15,7 @@ <h1>Your Games</h1>
<h3 *ngIf="!games.length">No games found.</h3>
<div *ngFor="let game of games">
<div class="well">
<pydt-game-preview [game]="game" [showLastTurn]="true"></pydt-game-preview>
<pydt-game-preview [game]="game" [showTurnInfo]="true"></pydt-game-preview>
<div class="row">
<div class="col-xs-12 text-center">
<button type="button" class="btn btn-primary" [routerLink]="['/game', game.gameId]">
Expand Down

0 comments on commit f1b4a84

Please sign in to comment.