diff --git a/css/app.css b/css/app.css index 94f760b..deb0ea7 100644 --- a/css/app.css +++ b/css/app.css @@ -24,24 +24,10 @@ body { } -/*Animations*/ - -/* The starting CSS styles for the enter animation */ -.fade.ng-enter { - transition:0.5s linear all; - opacity:0; +/* */ +div.team-col { + padding: 5px; } -/* The finishing CSS styles for the enter animation */ -.fade.ng-enter.ng-enter-active { - opacity:1; -} -/* now the element will fade out before it is removed from the DOM */ -.fade.ng-leave { - transition:0.5s linear all; - opacity:1; -} -.fade.ng-leave.ng-leave-active { - opacity:0; -} \ No newline at end of file + diff --git a/js/controllers/viewer.js b/js/controllers/viewer.js index 1698ea3..de069e8 100644 --- a/js/controllers/viewer.js +++ b/js/controllers/viewer.js @@ -1,8 +1,8 @@ -var mod = angular.module('bananaraceApp.controllers', ['ngAnimate']); +var mod = angular.module('bananaraceApp.controllers'); -mod.controller('PouleViewerCtrl', ['$scope', '$routeParams', 'ViewerService', - function($scope, $routeParams, ViewerService) { +mod.controller('PouleViewerCtrl', ['$scope', '$routeParams', 'ViewerService', '$interval', + function($scope, $routeParams, ViewerService, $interval) { //store all the teams $scope.teamsInPoule = []; @@ -30,5 +30,11 @@ mod.controller('PouleViewerCtrl', ['$scope', '$routeParams', 'ViewerService', }; $scope.refreshTeamsForPoule(); + var timer = $interval($scope.refreshTeamsForPoule, 1000); + + // Cancel timer on destroying controller + $scope.$on('$destroy', function() { + $interval.cancel(timer); + }); } ]); \ No newline at end of file diff --git a/js/filters.js b/js/filters.js index 554c892..11ce75a 100644 --- a/js/filters.js +++ b/js/filters.js @@ -13,20 +13,45 @@ var mod = angular.module('bananaraceApp.filters', []); mod.filter('secondsToString', function() { return function(seconds) { - var minutes = Math.floor(seconds/60); - var secondsleft = seconds-(minutes*60); + var minutes = Math.floor(seconds / 60); + var secondsleft = seconds - (minutes * 60); - var padWithZeroes = function(input, desiredlength) { - var str = input+""; - while(str.length
-
+
- +
-
+
- +
- +
diff --git a/partials/championships.html b/partials/championships.html index 0abfa4a..d51e2f3 100644 --- a/partials/championships.html +++ b/partials/championships.html @@ -13,7 +13,7 @@ Naam - +
diff --git a/partials/viewer-pouleoverview.html b/partials/viewer-pouleoverview.html index 4f052eb..f52a1f6 100644 --- a/partials/viewer-pouleoverview.html +++ b/partials/viewer-pouleoverview.html @@ -5,28 +5,23 @@ +
- -
-
+
+

{{team.teamname}}

-
- -
+
-
-
-

Race {{race.idrace}}

+
+
+

Race {{race.idrace}}

+
+
+
{{laptime.laptime | interval}}
+
-
-
    -
  • {{laptime.laptime}}
  • -
- -
-
diff --git a/server/getteamsforpoule.php b/server/getteamsforpoule.php index 42d753f..d0ca248 100644 --- a/server/getteamsforpoule.php +++ b/server/getteamsforpoule.php @@ -15,14 +15,14 @@ //fetch teams $teamfetch = pg_prepare($dbconn, "teamfetch", "select team.*, team.name teamname from team inner join team_poule using (idteam, idchampionship) where tier = $1 and poule = $2 and idchampionship = $3"); - $result['lasterror'].=pg_last_error()."\n"; + // $result['lasterror'].=pg_last_error()."\n"; $racefetch = pg_prepare($dbconn, "racefetch", "select * from race where tier = $1 and poule = $2 and idchampionship = $3 and idteam = $4"); - $result['lasterror'].=pg_last_error()."\n"; + // $result['lasterror'].=pg_last_error()."\n"; $laptimefetch = pg_prepare($dbconn, "laptimefetch", "select vm1.idrace, vm2.cleaneduptime-vm1.cleaneduptime laptime from valid_measurements vm1 inner join valid_measurements vm2 on vm1.idrace = vm2.idrace and vm1.idmeasurement != vm2.idmeasurement and vm1.cleaneduptime < vm2.cleaneduptime and vm2.cleaneduptime = (select min(cleaneduptime) from valid_measurements vm3 where vm3.cleaneduptime>vm1.cleaneduptime and vm3.idrace = vm1.idrace) where vm1.idrace = $1 order by vm1.idrace, laptime"); - $result['lasterror'].=pg_last_error()."\n"; + // $result['lasterror'].=pg_last_error()."\n"; $teamfetch = pg_execute($dbconn, "teamfetch", array($tier, $poule, $idchampionship)); - $result['lasterror'].=pg_last_error()."\n"; + // $result['lasterror'].=pg_last_error()."\n"; //resulting teams array $teams = array(); @@ -35,7 +35,7 @@ //loop over each race $racefetchexec = pg_execute($dbconn, "racefetch", array($tier, $poule, $idchampionship, $idteam)); - $result['lasterror'].=pg_last_error()."\n"; + // $result['lasterror'].=pg_last_error()."\n"; while($racerow = pg_fetch_assoc($racefetchexec)) { $result['GETTING IN IT'] = true; @@ -46,7 +46,7 @@ //fetch the laptimes $laptimefetch = pg_execute($dbconn, "laptimefetch", array($race['idrace'])); - $result['lasterror'].=pg_last_error()."\n"; + // $result['lasterror'].=pg_last_error()."\n"; while($laptimerow = pg_fetch_assoc($laptimefetch)) { $laptime = array(); $laptime['laptime'] = $laptimerow['laptime'];