Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2025c65c2d
@ -33,7 +33,7 @@ config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/championship/:idchampionship/team/:idteam/drivers', {templateUrl: 'partials/championship-team-drivers.html', controller: 'DriverCtrl'});
|
||||
|
||||
$routeProvider.when('/viewer', {templateUrl: 'partials/viewer.html', controller: 'ViewerCtrl'});
|
||||
$routeProvider.when('/viewer/poule/:tier/:poule/overview', {templateUrl: 'partials/viewer-pouleoverview.html', controller: 'ViewerCtrl'});
|
||||
$routeProvider.when('/viewer/poule/:tier/:poule/overview', {templateUrl: 'partials/viewer-pouleoverview.html', controller: 'PouleViewerCtrl'});
|
||||
|
||||
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'LoginCtrl'});
|
||||
$routeProvider.when('/register', {templateUrl: 'partials/register.html', controller: 'RegisterCtrl'});
|
||||
|
||||
@ -2,7 +2,7 @@ angular.module('bananaraceApp.controllers').controller('OverviewCtrl', ['$scope'
|
||||
//set route params in scope variables
|
||||
$scope.currentChampionship = $routeParams.idchampionship;
|
||||
|
||||
console.log('OVERVIEW.JS LOADEDddd');
|
||||
console.log('OVERVIEW.JS LOADED');
|
||||
|
||||
//data for the data gods
|
||||
$scope.overviewdata = {};
|
||||
|
||||
@ -1,35 +1,27 @@
|
||||
angular.module('bananaraceApp.controllers').controller('ViewerCtrl', ['$scope', '$routeParams', 'TeamService', function($scope, $routeParams, TeamService) {
|
||||
angular.module('bananaraceApp.controllers').controller('PouleViewerCtrl', ['$scope', '$routeParams', 'TeamService', function($scope, $routeParams, TeamService) {
|
||||
|
||||
//store all the teams
|
||||
$scope.teamsInPoule = [];
|
||||
$scope.currentTeamInPouleIndex = -1;
|
||||
|
||||
$scope.refreshTeamsForPoule = function() {
|
||||
var idchampionship = $routeParams.idchampionship;
|
||||
var tier = $routeParams.tier;
|
||||
var poule = $routeParams.poule;
|
||||
ViewerService.getTeamInPoule(idchampionship, tier, poule).
|
||||
ViewerService.getTeamsForPoule(idchampionship, tier, poule).
|
||||
success(function(data, status, headers, config) {
|
||||
console.log('getTeamsInPoule successful...');
|
||||
console.log('getTeamsForPoule successful...');
|
||||
console.log(data);
|
||||
if(data['ok']==true) {
|
||||
$scope.teamsInPoule = data.teams;
|
||||
} else {
|
||||
console.log('call returned but wasnt ok: '+data['error']);
|
||||
console.log('call returned but wasnt ok: '+data.error);
|
||||
}
|
||||
}).
|
||||
error(function(data, status, headers, config) {
|
||||
console.log('getTeamsInPoule failed...');
|
||||
console.log('getTeamsForPoule failed...');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.goToNextTeamInPoule = function() {
|
||||
if($scope.teamsInPoule.length>0) {
|
||||
//set up everything for the next team
|
||||
$scope.currentTeamInPouleIndex = (($scope.currentTeamInPouleIndex+1)%$scope.teamsInPoule.length);
|
||||
} else {
|
||||
$scope.currentTeamInPouleIndex = -1;
|
||||
}
|
||||
};
|
||||
//check if we need to load the teams for poule: only if
|
||||
|
||||
}]);
|
||||
|
||||
@ -54,9 +54,6 @@ appServices.service('PouleService', function($http) {
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
appServices.service('TeamService', function($http) {
|
||||
this.getTeams = function(idchampionship) {
|
||||
return $http.post('server/getteams.php', {idchampionship:idchampionship});
|
||||
@ -83,6 +80,7 @@ appServices.service('TeamService', function($http) {
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
appServices.service('RaceService', function($http) {
|
||||
this.getDrives = function(idrace) {
|
||||
return $http.post('server/getdrives.php', {idrace:idrace});
|
||||
@ -123,6 +121,7 @@ appServices.service('RaceService', function($http) {
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
appServices.service('DriverService', function($http) {
|
||||
this.getDrivers = function(idchampionship, idteam) {
|
||||
return $http.post('server/getdrivers.php', {idchampionship:idchampionship, idteam:idteam});
|
||||
@ -159,12 +158,19 @@ appServices.service('DriveService', function($http) {
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
appServices.service('OverviewService', function($http) {
|
||||
this.getData = function(idchampionship) {
|
||||
return $http.post('server/getoverviewofchampionship.php', {idchampionship:idchampionship});
|
||||
};
|
||||
});
|
||||
|
||||
appServices.service('ViewerService', function($http) {
|
||||
this.getData = function(tier, poule, idchampionship) {
|
||||
return $http.post('server/getoverviewofchampionship.php', {tier:tier, poule:poule, idchampionship:idchampionship});
|
||||
};
|
||||
});
|
||||
|
||||
appServices.service('MainService', function($http, $cookies) {
|
||||
|
||||
var activerace = null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user