-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
230 lines (229 loc) · 18.8 KB
/
index.html
File metadata and controls
230 lines (229 loc) · 18.8 KB
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A tool to run better tournaments with less fuss" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="SortMatch.ca" />
<meta name="twitter:description" content="A tool to run better tournaments with less fuss" />
<meta name="twitter:image" content="https://sortmatch.ca/static/trophy-icon.png" />
<meta name="twitter:url" content="https://sortmatch.ca" />
<meta property="og:title" content="SortMatch.ca">
<meta property="og:type" content="website">
<meta property="og:url" content="https://sortmatch.ca">
<meta property="og:image" content="https://sortmatch.ca/static/trophy-icon.png" />
<meta property="og:description" content="A tool to run better tournaments with less fuss" />
<title>SortMatch.ca</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href='https://fonts.googleapis.com/css?family=Lobster|Cabin:400,700' rel='stylesheet' type='text/css'>
<link href='static/style.css' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="container theme-showcase" role="main" id="vue-app">
<div id="detail" v-if="name" v-cloak>
<p v-if="banner"><img v-on:click="bannerChange" v-bind:src="banner" /></p>
<div class="row">
<div class="col-md-4" v-bind:class="{ 'col-md-offset-4': competitors.length < 2, 'sliding-transition': competitors.length >= 2 }">
<h2>{{ lang.competitors }}</h2>
<p v-if="competitors.length < 2">{{ lang.hintStart }}</p>
<table id="competitors" v-bind:class="{ 'table': competitors.length, 'unstyled': !competitors.length }">
<thead v-if="competitors.length">
<tr>
<th>{{ lang.competitorName }}</th>
<th>{{ lang.competitorMatches }}</th>
<th>{{ lang.competitorRating }}</th>
</tr>
</thead>
<tbody>
<tr v-for="competitor in competitors | orderBy '(paused ? 0 : 10000) + ranking.getRating()' -1" v-bind:class="{ 'active': !competitor.matched }">
<td data-competitor="{{ competitors.indexOf(competitor) }}">
<span class="dropdown">
<span class="dropdown-toggle" v-bind:class="{ 'text-muted': competitor.paused }" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">{{ competitor.name }} <span class="caret"></span></span>
<ul class="dropdown-menu">
<li><a href="#" v-on:click="competitorNameChange(competitor)">{{ lang.competitorName }}</a>
<li><a href="#" v-on:click="competitorInitialRatingChange(competitor)">{{ lang.competitorInitialRating }}</a>
<li><a href="#" v-on:click="competitorPause(competitor)"><span v-if="competitor.paused">{{ lang.tournamentContinue }}</span><span v-else>{{ lang.tournamentPause }}</span></a>
</ul>
</span>
</td>
<td v-bind:class="{ 'text-muted': competitor.paused }">{{ competitor | matchesCompletedLength }}</td>
<td title="{{ Math.max(100, competitor.ranking.getRating()) / 100 | round '2' }}">
<div class="progress">
<div class="progress-bar {{ competitor | competitorToProgressBarClass }}" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: {{ Math.min(100, Math.max(20, competitor.ranking.getRating() / 20)) }}%;">
<span v-if="competitor.ranking.getRating() >= 1300">{{ Math.max(100, competitor.ranking.getRating()) / 100 | round '1' }}</span>
<span v-else>{{ Math.max(100, competitor.ranking.getRating()) / 100 | round '0' }}</span>
</div>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">
<div class="btn-group">
<button id="competitor-add" class="btn btn-success" v-bind:class="{ 'btn-sm': matches.length }" v-on:click="competitorAdd(null)"><span class="glyphicon glyphicon-plus"></span> {{ lang.competitorAdd }}</button>
<button title="{{ lang.competitorAddMultiple }}" class="btn btn-success" v-bind:class="{ 'btn-sm': matches.length }" data-toggle="modal" data-target="#competitor-add-multiple"><span class="glyphicon glyphicon-th-list"></span></button>
</div>
<div class="modal fade" id="competitor-add-multiple" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<p>{{ lang.hintBulkAdd }}</p>
<textarea class="form-control"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ lang.cancel }}</button>
<button type="button" class="btn btn-success" v-on:click="competitorAddMultiple">{{ lang.competitorAddMultiple }}</button>
</div>
</div>
</div>
</div>
</td>
</tr>
</tfoot>
</table>
</div>
<div class="col-md-8" v-if="competitors.length > 1" transition="delayedfade">
<h2>{{ lang.matchesPending }}</h2>
<table class="table">
<thead>
<tr>
<th>{{ lang.matchesFavored }}</th>
<th class="hidden-xs"></th>
<th>{{ lang.matchesChallenger }}</th>
<th>{{ lang.matchesFinished }}</th>
</tr>
</thead>
<tbody>
<tr v-for="match in matches | finished false | favoredOrder">
<td v-bind:class="{ 'text-muted': match.favored.paused }" data-competitor="{{ competitors.indexOf(match.favored) }}">{{ match.favored.name }}</td>
<td class="hidden-xs">
<div class="progress" v-if="match.favored.matches.length > 2 || match.unfavored.matches.length > 2">
<div class="progress-bar progress-bar-{{ match.favored | competitorToClass }}" style="width: 50%"> </div>
<div class="progress-bar progress-bar-{{ match.unfavored | competitorToClass }}" style="width: 50%"> </div>
</div>
</td>
<td v-bind:class="{ 'text-muted': match.unfavored.paused }" data-competitor="{{ competitors.indexOf(match.unfavored) }}">{{ match.unfavored.name }}</td>
<td>
<div class="dropdown">
<button class="btn btn-success btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">{{ lang.matchesRecord }} <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#" v-on:click="matchResolve(match, RESULT_FAVORED)">{{ lang.matchesWin }} {{ match.favored.name }}</a></li>
<li><a href="#" v-on:click="matchResolve(match, RESULT_TIE)">{{ lang.matchesTie }}</a></li>
<li><a href="#" v-on:click="matchResolve(match, RESULT_UNFAVORED)">{{ lang.matchesWin }} {{ match.unfavored.name }}</a></li>
<li role="separator" class="divider"></li>
<li><a href="#" v-on:click="matchResolve(match, RESULT_ABANDONED)">{{ lang.matchesSkipped }}</a></li>
</ul>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr class="active">
<td colspan="4">
<button class="btn btn-sm btn-default" data-toggle="modal" data-target="#match-add"><span class="glyphicon glyphicon-plus"></span> {{ lang.matchesAdd }}</button>
<button v-on:click="planMatches()" class="btn btn-sm" v-bind:class="{ 'btn-primary': !matches.length, 'btn-default': matches.length }"><span class="glyphicon glyphicon-play"></span> {{ lang.tournamentContinue }}</button>
<span class="dropdown">
<button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><span class="glyphicon glyphicon-cog"></span> <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li class="dropdown-header">{{ lang.tournamentBenign }}</li>
<li><a href="#" v-on:click="tournamentExport">{{ lang.tournamentExport }}</a>
<li><a href="#" v-on:click="bannerChange">{{ lang.tournamentBanner }}</a>
<li role="separator" class="divider"></li>
<li class="dropdown-header">{{ lang.tournamentDestructive }}</li>
<li><a href="#" v-on:click="tournamentDelete">{{ lang.tournamentDelete }}</a>
</ul>
</span>
<div class="modal" id="match-add" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<select class="form-control" id="match-add-left">
<option v-for="competitor in competitors | orderBy '(paused ? 0 : 10000) + ranking.getRating()' -1">{{ competitor.name }}</option>
</select>
</div>
<div class="col-sm-6">
<select class="form-control" id="match-add-right">
<option v-for="competitor in competitors | orderBy '(paused ? 0 : 10000) + ranking.getRating()' -1">{{ competitor.name }}</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ lang.cancel }}</button>
<button type="button" class="btn btn-success" v-on:click="matchAdd">{{ lang.matchesAdd }}</button>
</div>
</div>
</div>
</div>
</td>
</tr>
</tfoot>
</table>
<footer class="small">
<p v-if="competitors.length && matches.length && matches.length < competitors.length * 5">{{ lang.hintContinueUntil }}</p>
<p v-if="competitors.length && matches.length >= competitors.length * 5">{{ lang.hintFinishRemaining }}</p>
</footer>
<h2>{{ lang.matchesCompleted }}</h2>
<table class="table table-condensed" id="matches-completed">
<thead>
<tr>
<th>{{ lang.matchesMatched }}</th>
<th>{{ lang.matchesFavored }}</th>
<th>{{ lang.matchesChallenger }}</th>
<th>{{ lang.matchesFinished }}</th>
</tr>
</thead>
<tbody>
<tr v-for="match in matches | finished true | orderBy 'finished' -1">
<td>{{ match.start.toLocaleTimeString() }}</td>
<td v-bind:class="{ 'text-muted': match.favored.paused, 'danger': match.result === RESULT_UNFAVORED, 'success': match.result === RESULT_FAVORED, 'warning': match.result === RESULT_TIE, 'info': match.result === RESULT_ABANDONED }" data-competitor="{{ competitors.indexOf(match.favored) }}">{{ match.favored.name }}</td>
<td v-bind:class="{ 'text-muted': match.unfavored.paused, 'danger': match.result === RESULT_FAVORED, 'success': match.result === RESULT_UNFAVORED, 'warning': match.result === RESULT_TIE, 'info': match.result === RESULT_ABANDONED }" data-competitor="{{ competitors.indexOf(match.unfavored) }}">{{ match.unfavored.name }}</td>
<td v-on:click="matchRevert(match)">{{ match.finished.toLocaleTimeString() }} <span class="caret"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="index" v-else class="unstyled" v-cloak>
<p><img id="logo" src="static/trophy-icon.png" /></p>
<h1>{{{ lang.indexHeader }}}</h1>
<p>
<span v-for="tournamentName in tournamentNames">
<a href="?{{ tournamentName }}" class="btn" v-bind:class="{ 'btn-primary': tournamentName.endsWith(' Example'), 'btn-info': !tournamentName.endsWith(' Example') }"><span class="glyphicon glyphicon-play"></span> {{ tournamentName }}</a>
</span>
<button class="btn btn-success" v-on:click="tournamentAdd"><span class="glyphicon glyphicon-plus"></span> {{ lang.indexAdd }}</button>
</p>
<footer class="small">{{{ lang.indexFooter }}}</footer>
<h3>{{ lang.indexImport }}</h3>
<input type="file" id="files" name="files[]" multiple class="btn btn-default btn-sm" />
</div>
</div>
<noscript>
<h2>SortMatch.ca requires JavaScript</h2>
<p>All tournament calculations are run in-browser and no data is pushed back to the server.</p>
<p>You're free to inspect the code or run your own fork (<a href="https://github.com/bradbeattie/sortmatch">the source is hosted on github</a>).</p>
</noscript>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.15/vue.min.js"></script>
<script src="static/jquery.color-2.1.2.min.js"></script>
<script src="static/FileSaver.min.js"></script>
<script src="static/glicko2.js"></script>
<script src="static/lang.js"></script>
<script src="static/tournament.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-6512994-8', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>