Skip to content

Commit

Permalink
Merge pull request #126 from ezraroi/54-change-games-filter-dropdown-…
Browse files Browse the repository at this point in the history
…to-toggle-like-in-the-dashboard-view

added
  • Loading branch information
ezraroi authored Sep 18, 2024
2 parents 4079dcd + aae9117 commit 125c1ad
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Mundialito/Client/src/Games/Games.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<div class="panel-heading">
<div class="row">
<div class="col-md-3 col-xs-12">
<select ui-select2="{allowClear: false}" class="form-control" ng-model="gamesFilter">
<option value="All" selected="selected">All Games</option>
<option value="OnlyOpen">Only Open</option>
</select>
<toggle ng-model="gamesToggle" size="btn-sm" off-class="btn-success"
on-class="btn-info" ng-change="changed()"
on="<i class='fa-solid fa-list'></i> All"
off="<i class='fa-regular fa-folder-open'></i> Open"></toggle>
</div>
</div>
</div>
Expand Down
11 changes: 9 additions & 2 deletions Mundialito/Client/src/Games/GamesCtrl.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
'use strict';
angular.module('mundialitoApp').controller('GamesCtrl', ['$scope','$log','GamesManager','games','teams', 'StadiumsManager' ,'Alert',function ($scope,$log, GamesManager, games, teams, StadiumsManager, Alert) {
$scope.newGame = null;
$scope.gamesFilter = "All";
$scope.gamesFilter = "Open";
$scope.gamesToggle = false;
$scope.games = games;
$scope.teams = teams;

$scope.changed = () => {
if ($scope.gamesFilter === "Open") {
$scope.gamesFilter = "All"
} else {
$scope.gamesFilter = "Open"
}
}

StadiumsManager.loadAllStadiums().then(function (res) {
$scope.stadiums = res;
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-ba6257de0a6b1191450457166bb9f1de.js"></script>
<script src="js/app-min-eb8d027ceaca1adaf5298c9ee868b9c5.js"></script>
}
else {
<script src="lib/lib-77990d6df268e8d3d432fb52597000f9.js"></script>
<script src="js/app-0e225f795ac563e8bed1c5a039aff720.js"></script>
<script src="js/app-f1ca643234fe743ef96cc67e8374c645.js"></script>
}
</div>
</body>
Expand Down
8 changes: 4 additions & 4 deletions Mundialito/wwwroot/App/Games/Games.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<div class="panel-heading">
<div class="row">
<div class="col-md-3 col-xs-12">
<select ui-select2="{allowClear: false}" class="form-control" ng-model="gamesFilter">
<option value="All" selected="selected">All Games</option>
<option value="OnlyOpen">Only Open</option>
</select>
<toggle ng-model="gamesToggle" size="btn-sm" off-class="btn-success"
on-class="btn-info" ng-change="changed()"
on="<i class='fa-solid fa-list'></i> All"
off="<i class='fa-regular fa-folder-open'></i> Open"></toggle>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,17 @@ angular.module('mundialitoApp').controller('GameCtrl', ['$scope', '$log', 'Const
'use strict';
angular.module('mundialitoApp').controller('GamesCtrl', ['$scope','$log','GamesManager','games','teams', 'StadiumsManager' ,'Alert',function ($scope,$log, GamesManager, games, teams, StadiumsManager, Alert) {
$scope.newGame = null;
$scope.gamesFilter = "All";
$scope.gamesFilter = "Open";
$scope.gamesToggle = false;
$scope.games = games;
$scope.teams = teams;

$scope.changed = () => {
if ($scope.gamesFilter === "Open") {
$scope.gamesFilter = "All"
} else {
$scope.gamesFilter = "Open"
}
}

StadiumsManager.loadAllStadiums().then(function (res) {
$scope.stadiums = res;
Expand Down

This file was deleted.

Large diffs are not rendered by default.

0 comments on commit 125c1ad

Please sign in to comment.