Skip to content

Commit

Permalink
Merge pull request #135 from ezraroi/134-dashboard-bets-stats-to-use-…
Browse files Browse the repository at this point in the history
…team-flag

added
  • Loading branch information
ezraroi authored Sep 20, 2024
2 parents e839404 + 508bbf6 commit f873d37
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Mundialito/Client/src/Dashboard/Dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ <h6><small>{{::game.AwayTeam.Name}}</small></h6>
<uib-accordion-heading>
<div class="row">
<div class="col-md-1 col-xs-2 text-center">
<span class="badge">{{item[0]}}</span>
<div ng-if="groupedTeams[item[0]] === undefined">
<span class="badge">{{item[0]}}</span>
</div>
<div ng-if="groupedTeams[item[0]] !== undefined">
<team-flag team="groupedTeams[item[0]][0]"></team-flag>
</div>
</div>
<div class="col-md-10 col-xs-9">
<uib-progressbar max="100" min="0"
Expand Down
13 changes: 13 additions & 0 deletions Mundialito/Client/src/Dashboard/DashboardCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ angular.module('mundialitoApp').controller('DashboardCtrl', ['$scope', '$log', '
$scope.toggleValue = {};
$scope.players = players;

// Function to group teams by ShortName
function groupTeamsByShortName(teams) {
return teams.reduce((acc, team) => {
const shortName = team.ShortName;
if (!acc[shortName]) {
acc[shortName] = [];
}
acc[shortName].push(team);
return acc;
}, {});
}
$scope.groupedTeams = groupTeamsByShortName(teams);

$scope.changed = (game) => {
if ($scope.toggleValue[game.GameId]) {
$scope.selectedDic[game.GameId] = $scope.marksDic[game.GameId];
Expand Down
4 changes: 2 additions & 2 deletions Mundialito/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@
@if (env.IsProduction())
{
<script src="lib/lib-min-2d5e40df8764ea1d842fca768d139b58.js"></script>
<script src="js/app-min-edab6c6f8348e96ec77828311e34fb09.js"></script>
<script src="js/app-min-b9de64167c2b03c8f2f816e6e633631e.js"></script>
}
else {
<script src="lib/lib-77990d6df268e8d3d432fb52597000f9.js"></script>
<script src="js/app-3aca63029d88fd16639d2f211875992c.js"></script>
<script src="js/app-06c454b6fe15193adf661d79a88ef6c0.js"></script>
}
</div>
</body>
Expand Down
7 changes: 6 additions & 1 deletion Mundialito/wwwroot/App/Dashboard/Dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ <h6><small>{{::game.AwayTeam.Name}}</small></h6>
<uib-accordion-heading>
<div class="row">
<div class="col-md-1 col-xs-2 text-center">
<span class="badge">{{item[0]}}</span>
<div ng-if="groupedTeams[item[0]] === undefined">
<span class="badge">{{item[0]}}</span>
</div>
<div ng-if="groupedTeams[item[0]] !== undefined">
<team-flag team="groupedTeams[item[0]][0]"></team-flag>
</div>
</div>
<div class="col-md-10 col-xs-9">
<uib-progressbar max="100" min="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,19 @@ angular.module('mundialitoApp').controller('DashboardCtrl', ['$scope', '$log', '
$scope.toggleValue = {};
$scope.players = players;

// Function to group teams by ShortName
function groupTeamsByShortName(teams) {
return teams.reduce((acc, team) => {
const shortName = team.ShortName;
if (!acc[shortName]) {
acc[shortName] = [];
}
acc[shortName].push(team);
return acc;
}, {});
}
$scope.groupedTeams = groupTeamsByShortName(teams);

$scope.changed = (game) => {
if ($scope.toggleValue[game.GameId]) {
$scope.selectedDic[game.GameId] = $scope.marksDic[game.GameId];
Expand Down

Large diffs are not rendered by default.

This file was deleted.

0 comments on commit f873d37

Please sign in to comment.