-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
134 lines (103 loc) · 4.28 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="fr" ng-app="scoreboardApp">
<head>
<meta charset="utf-8">
<title>CS Games</title>
<meta name="description" content="CS Games Scoreboard">
<meta name="author" content="CS Games">
<!-- Styles, keep this ordering -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" href="favicon.ico" />
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-35948775-1']);
_gaq.push(['_setDomainName', 'csgames.org']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body ng-controller="ScoreboardCtrl">
<div class="container">
<div class="page-body">
<h1>Résultats</h1>
<p>
Cette page montre les résultats des compétitions au fur et à mesure qu'ils sont compilés.
Sélectionnez une compétition depuis la liste pour obtenir ses résultats ou sélectionnez "Résultat global" pour obtenir un apperçu global des positions.
</p>
<form name="frmResults" id="frmResults" method="post" action="">
<select name="cboEvent" id="cboEvent" ng-model="scoreboard.edition" ng-change="updateSelector()" >
<option ng-repeat="e in events" value="{{e.year}}">{{e.year}} - {{e.host}}</option>
</select>
<select name="cboComp" id="cboComp" ng-model="scoreboard.competition" ng-change="updateScoreboard()">
<option ng-repeat="c in competitions" value="{{c.compResults}}" >{{c.compName_en}}{{c.compWeight ? ' - ' + c.compWeight + '%' : ''}}</option>
</select>
<h2>Résultat Global</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Position</th>
<th>Université</th>
<th>Nom de l'équipe</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="r in results | orderBy:'-teamScore'">
<td class="tableContent" align="center">{{$index + 1}}</td>
<td class="tableContent">{{r.delegUniversity}}</td>
<td class="tableContent">{{r.delegAlias}}</td>
<td class="tableContent" align="center">{{r.teamScore}}</td>
</tr>
</tbody>
</table>
</form><div>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/angular.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
var scoreboardApp = angular.module('scoreboardApp', []);
scoreboardApp.controller('ScoreboardCtrl', function ($scope, $http){
$scope.scoreboard = {
edition: '',
competition: ''
}
$http.get('events.json').success(function(data) {
$scope.events = data;
$scope.scoreboard.edition = data[0]['year']
$http.get('result/'+$scope.scoreboard.edition+'.json').success(function(data) {
$scope.competitions = data;
$scope.scoreboard.competition = data[0]['compResults'];
$scope.updateSelector();
});
});
$scope.updateSelector = function() {
$http.get('result/'+$scope.scoreboard.edition+'.json').success(function(data) {
$scope.competitions = data;
$scope.scoreboard.competition = data[0]['compResults'];
$scope.updateScoreboard();
});
}
$scope.updateScoreboard = function() {
$scope.l = 'result/'+ $scope.scoreboard.edition +'/'+ $scope.scoreboard.competition;
$http.get( $scope.l).success(function(data) {
$scope.results = data;
});
}
});
</script>
</body>
</html>