-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·192 lines (182 loc) · 9.03 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<html ng-app="rankApp">
<head>
<meta charset="utf-8">
<title>Rankulatorn</title>
<link href="css/bootstrap.min.css" rel="stylesheet"></link>
<link href="css/font-awesome.min.css" rel="stylesheet"></link>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body ng-controller="rankCtrl">
<!--<a href='http://goforbundet.se'><img src='SGF_logga_2013.png' alt='Hem' width = "120px"></a>-->
<div class="container ng-cloak">
<h1>Rankulatorn</h1>
<p>Rankulatorn är ett enastående samt synnerligen magnifikt verktyg för att utföra rankkalkyler. Givet en EGD PIN (spelarID)
och en önskad rank så räknar verktyget ut poängsumman enligt <a href="http://goforbundet.se/web/node/30">reglerna för upprankning</a> baserat på de matcher som finns inrapporterade i <a href="http://europeangodatabase.eu">EGD</a>. Det resultat som ges
här medför inte automatiskt upprankning, men kan fungera som ett preliminärt besked innan <a href="http://goforbundet.se/web/node/28">rankingkommittén</a> kontrollerat resultatet. Notera att partier från elektroniska turneringar, t.ex. Lag-EM, inte räknas enligt <a href="http://goforbundet.se/web/node/30">gällande
regler</a>.
</p>
<p>Undantag: Enligt reglerna ska ett parti med mindre än 60 minuters huvudtid räknas som ett halvt parti, men rankulatorn
tar för närvarande inte hänsyn till partilängd. </p>
<form class="form-horizontal">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<label><input type="radio" name="searchBy" ng-model="search.by" value="name"> Sök på namn</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<label><input type="radio" name="searchBy" ng-model="search.by" value="egd"> Sök på EGD-pin</label>
</div>
</div>
</form>
<form class="form-horizontal" ng-submit="searchPlayers()" ng-if="search.by != 'egd'">
<h3>Sök spelare på namn</h3>
<div class="form-group">
<label for="lastName" class="col-sm-2 control-label">Efternamn *</label>
<div class="col-sm-10">
<input type="text" class="form-control" ng-model="search.lastname" id="search" placeholder="Efternamn">
</div>
</div>
<div class="form-group">
<label for="firstName" class="col-sm-2 control-label">Förnamn</label>
<div class="col-sm-10">
<input type="text" class="form-control" ng-model="search.firstname" id="search" placeholder="Förnamn">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<small>Ange minst 3 tecken i fältet Efternamn.</small>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" ng-disabled="isSearching || lastName.length < 3">
<i class="fa" ng-class="{'fa-search': !isSearching, 'fa-spin': isSearching, 'fa-spinner': isSearching}"></i>
Sök
</button>
</div>
</div>
</form>
<form class="form-horizontal" ng-submit="getGames()" ng-if="search.by == 'egd'">
<h3>Sök spelare på EGD-pin</h3>
<div class="form-group">
<label for="search" class="col-sm-2 control-label">EGD-pin</label>
<div class="col-sm-10">
<input type="text" class="form-control" ng-model="search.egdPin" id="search" placeholder="egd-pin">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" ng-disabled="isSearching">
<i class="fa" ng-class="{'fa-search': !isSearching, 'fa-spin': isSearching, 'fa-spinner': isSearching}"></i>
Sök
</button>
</div>
</div>
</form>
<div class="ng-cloak" ng-show="games.length && !isSearching">
<hr />
<h3>{{playerName}} <small>Senast rankad som {{declaredRank.text}}</small></h3>
<form class="form-horizontal">
<div class="form-group">
<label for="rank" class="col-sm-2 control-label">Önskad rank</label>
<div class="col-sm-10">
<select id="rank" class="form-control" ng-options="r.text for r in ranks | filter:selectableRankFilter" ng-model="desiredRank"
ng-change="updatePoints()">
<option value="">-- Välj rank --</option>
</select>
</div>
</div>
</form>
</div>
<div class="ng-cloak" ng-show="games.length && !isSearching">
<h3>Resultat</h3>
<div>
<div ng-show="bestRange.isEnough && danGames.isEnough">
Du uppfyller alla krav för att bli upprankad till {{desiredRank.text}} - starkt jobbat!
</div>
<div ng-show="!(bestRange.isEnough && danGames.isEnough)">
Du uppfyller inte alla krav för att bli upprankad till {{desiredRank.text}}.
</div>
<ul class="fa-ul">
<li ng-show="bestRange.isEnough"><i class="fa-li fa fa-check fa-lg" style="color: #20C020;"></i>Du har samlat {{bestRange.points.points}} poäng för att
nå {{desiredRank.text}}. Poängen har du tjänat på {{bestRange.end-bestRange.start+1}} matcher f.o.m. {{bestRange.enddate
| moment:'YYYY-MM-DD'}} (rond {{bestRange.endround}}) t.o.m. {{bestRange.startdate | moment:'YYYY-MM-DD'}} (rond {{bestRange.startround}}).</li>
<li ng-show="!bestRange.isEnough"><i class="fa-li fa fa-times fa-lg" style="color: #C02020;"></i>
<span ng-show="bestCurrentRange.points.basePoints > 0">Du har för närvarande maximalt {{bestCurrentRange.points.basePoints}}
poäng på {{bestCurrentRange.end-bestCurrentRange.start+1}} matcher (räknat f.o.m {{bestCurrentRange.enddate | moment:'YYYY-MM-DD'}}
rond {{bestCurrentRange.endround}}). Du behöver {{requiredPoints(desiredRank) - bestCurrentRange.points.basePoints}}
poäng till.</span>
<span ng-show="bestCurrentRange.points.basePoints <= 0">Du har för närvarande inga poäng. Du behöver {{requiredPoints(desiredRank)}} poäng till.</span></li>
<li ng-show="danGames.required > 0"><i ng-show="!danGames.isEnough" class="fa-li fa fa-times fa-lg" style="color: #C02020;"></i><i ng-show="danGames.isEnough"
class="fa-li fa fa-check fa-lg" style="color: #20C020;"></i>
<ng-pluralize count="danGames.count" when="{
'0': 'Du har inte vunnit någon match mot {{desiredRank.text}} eller starkare.',
'one': 'Du har vunnit en match mot {{desiredRank.text}} eller starkare.',
'other': 'Du har vunnit {} matcher mot {{desiredRank.text}} eller starkare.'}">
</ng-pluralize><span ng-show="danGames.required > danGames.count"> <ng-pluralize count="danGames.required - danGames.count" when="{'one': 'Du behöver vinna en sådan match till.', 'other': 'Du behöver vinna {} sådana matcher till.'}"></span></li>
</ul>
</div>
<h3>Partier</h3>
<table class="table table-condensed">
<thead>
<tr>
<th>Turnering</th>
<th>Datum</th>
<th>Rond</th>
<th>Motståndare</th>
<th>Rank</th>
<th>Resultat</th>
<th>Poäng</th>
<th>Poängsumma</th>
<th>Markera</th>
<th>Nollställ markering</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="g in games" ng-class="{ success: g.result, danger: !g.result }">
<td><span title="{{g.tournamentName}}">{{g.tournamentCode}}</span></td>
<td>{{g.date | moment:'YYYY-MM-DD'}}</td>
<td>{{g.round}}</td>
<td><a href="#" ng-click="$event.preventDefault(); switchToOpponent(g.egdPin)">{{g.firstName}} {{g.lastName}}</a></td>
<td>{{g.rank.text}}</td>
<td>{{g.result ? 'Vinst' : 'Förlust'}}</td>
<td>{{pointsForGame(g)}}</td>
<td>{{pointsForMarkedGames($index)}}</td>
<td>
<button class="btn btn-default" ng-show="!isMarked($index)" ng-click="mark($index)">
<i class="fa fa-plus-circle"></i>
Markera
</button>
</td>
<td>
<button class="btn btn-default" ng-show="isMarked($index)" ng-click="resetMarks()">
<i class="fa fa-trash-o"></i>
Nollställ markering
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container text-center">
<iframe src="https://ghbtns.com/github-btn.html?user=varenius&repo=se_go_rank_calculator&type=watch&v=2" frameborder="0" scrolling="0" width="70px" height="20px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=varenius&repo=se_go_rank_calculator&type=fork" frameborder="0" scrolling="0" width="70px" height="20px"></iframe>
</div>
<script src="js/jquery-2.0.3.min.js"></script>
<script src="js/underscore.js"></script>
<script src="js/moment-wl.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/ui-bootstrap-tpls-2.2.0.min.js"></script>
<script src="js/app/app.js"></script>
<script src="js/app/ranks.js"></script>
<script src="js/app/egd.js"></script>
<script src="js/app/rankulator.js"></script>
<script src="js/app/playerListController.js"></script>
</body>
</html>