Skip to content

Commit

Permalink
some client flags fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ezraroi committed Sep 12, 2024
1 parent d5686d6 commit 2068a31
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
17 changes: 9 additions & 8 deletions Mundialito/Client/src/Games/Game.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input id="GameHomeScore" name="GameHomeScore" type="number" ng-model="game.HomeScore"
class="form-control" placeholder="Home Team Score" required min="0">
class="form-control" placeholder="{{game.HomeTeam.Name}} Score" required min="0">
</div>
</div>
<div class="form-group" ng-if="!game.IsOpen">
Expand All @@ -74,7 +74,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input id="GameAwayScore" name="GameAwayScore" type="number" ng-model="game.AwayScore"
class="form-control" placeholder="Away Team Score" required min="0">
class="form-control" placeholder="{{game.AwayTeam.Name}} Score" required min="0">
</div>
</div>
<div class="form-group" ng-if="!game.IsOpen">
Expand Down Expand Up @@ -211,11 +211,11 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
class="fa-solid pull-right"> </i>
</div>
<div class="panel-body" cg-busy="updateBetPromise">
<div ng-if="!game.IsOpen && userBet.BetId == -1" class="text-danger">
<div ng-if="!game.IsOpen && userBet.BetId === -1" class="text-danger">
<i class="fa fa-warning"></i> You haven't placed a bet on this game and it is already closed for
betting
</div>
<div ng-show="!game.IsOpen">
<div ng-show="!game.IsOpen && userBet.BetId !== -1">
<div class="table-responsive">
<table class="table table-striped">
<thead>
Expand Down Expand Up @@ -254,7 +254,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input name="{{game.HomeTeam.TeamId}}" id="{{game.HomeTeam.TeamId}}" type="number"
ng-model="userBet.HomeScore" class="form-control" placeholder="Home Team Score" required
ng-model="userBet.HomeScore" class="form-control" placeholder="{{game.HomeTeam.Name}} Score" required
min="0">
</div>
</div>
Expand All @@ -265,7 +265,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input name="{{game.AwayTeam.TeamId}}" id="{{game.AwayTeam.TeamId}}" type="number"
ng-model="userBet.AwayScore" class="form-control" placeholder="Away Team Score" required
ng-model="userBet.AwayScore" class="form-control" placeholder="{{game.AwayTeam.Name}} Score" required
min="0">
</div>
</div>
Expand Down Expand Up @@ -522,17 +522,18 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input id="GameHomeScore" name="GameHomeScore" type="number"
ng-model="simulatedGame.HomeScore" class="form-control" placeholder="Home Team Score"
ng-model="simulatedGame.HomeScore" class="form-control" placeholder="{{game.HomeTeam.Name}} Score"
required min="0">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="GameAwayScore">
<team-flag team="game.AwayTeam"></team-flag>
{{game.AwayTeam.Name}} Score
</label>
<div class="col-md-2">
<input id="GameAwayScore" name="GameAwayScore" type="number"
ng-model="simulatedGame.AwayScore" class="form-control" placeholder="Away Team Score"
ng-model="simulatedGame.AwayScore" class="form-control" placeholder="{{game.AwayTeam.Name}} Score"
required min="0">
</div>
</div>
Expand Down
9 changes: 9 additions & 0 deletions Mundialito/Models/BetsModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ public BetGameTeam(Team team)
TeamId = team.TeamId;
Name = team.Name;
ShortName = team.ShortName;
Logo = team.Logo;
Flag = team.Flag;
}

[JsonPropertyName("TeamId")]
public int TeamId { get; set; }

Expand All @@ -245,4 +248,10 @@ public BetGameTeam(Team team)
[JsonPropertyName("ShortName")]
public string ShortName { get; set; }

[JsonPropertyName("Flag")]
public string Flag { get; set; }

[JsonPropertyName("Logo")]
public string Logo { get; set; }

}
17 changes: 9 additions & 8 deletions Mundialito/wwwroot/App/Games/Game.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input id="GameHomeScore" name="GameHomeScore" type="number" ng-model="game.HomeScore"
class="form-control" placeholder="Home Team Score" required min="0">
class="form-control" placeholder="{{game.HomeTeam.Name}} Score" required min="0">
</div>
</div>
<div class="form-group" ng-if="!game.IsOpen">
Expand All @@ -74,7 +74,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input id="GameAwayScore" name="GameAwayScore" type="number" ng-model="game.AwayScore"
class="form-control" placeholder="Away Team Score" required min="0">
class="form-control" placeholder="{{game.AwayTeam.Name}} Score" required min="0">
</div>
</div>
<div class="form-group" ng-if="!game.IsOpen">
Expand Down Expand Up @@ -211,11 +211,11 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
class="fa-solid pull-right"> </i>
</div>
<div class="panel-body" cg-busy="updateBetPromise">
<div ng-if="!game.IsOpen && userBet.BetId == -1" class="text-danger">
<div ng-if="!game.IsOpen && userBet.BetId === -1" class="text-danger">
<i class="fa fa-warning"></i> You haven't placed a bet on this game and it is already closed for
betting
</div>
<div ng-show="!game.IsOpen">
<div ng-show="!game.IsOpen && userBet.BetId !== -1">
<div class="table-responsive">
<table class="table table-striped">
<thead>
Expand Down Expand Up @@ -254,7 +254,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input name="{{game.HomeTeam.TeamId}}" id="{{game.HomeTeam.TeamId}}" type="number"
ng-model="userBet.HomeScore" class="form-control" placeholder="Home Team Score" required
ng-model="userBet.HomeScore" class="form-control" placeholder="{{game.HomeTeam.Name}} Score" required
min="0">
</div>
</div>
Expand All @@ -265,7 +265,7 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input name="{{game.AwayTeam.TeamId}}" id="{{game.AwayTeam.TeamId}}" type="number"
ng-model="userBet.AwayScore" class="form-control" placeholder="Away Team Score" required
ng-model="userBet.AwayScore" class="form-control" placeholder="{{game.AwayTeam.Name}} Score" required
min="0">
</div>
</div>
Expand Down Expand Up @@ -522,17 +522,18 @@ <h5 ng-show="game.GameStatsPage !== null"><a target="_blank" ng-href="{{game.Gam
</label>
<div class="col-md-2">
<input id="GameHomeScore" name="GameHomeScore" type="number"
ng-model="simulatedGame.HomeScore" class="form-control" placeholder="Home Team Score"
ng-model="simulatedGame.HomeScore" class="form-control" placeholder="{{game.HomeTeam.Name}} Score"
required min="0">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="GameAwayScore">
<team-flag team="game.AwayTeam"></team-flag>
{{game.AwayTeam.Name}} Score
</label>
<div class="col-md-2">
<input id="GameAwayScore" name="GameAwayScore" type="number"
ng-model="simulatedGame.AwayScore" class="form-control" placeholder="Away Team Score"
ng-model="simulatedGame.AwayScore" class="form-control" placeholder="{{game.AwayTeam.Name}} Score"
required min="0">
</div>
</div>
Expand Down

0 comments on commit 2068a31

Please sign in to comment.