-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
211 lines (195 loc) · 7.87 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="Jonathan Hernández - @ion">
<meta property="og:title" content="FIFA World Cup Quiniela">
<meta property="og:url" content="http://matach.in/fifa">
<meta property="og:site_name" content="FIFA World Cup Quiniela">
<meta property="og:image" content="http://matach.in/fifa/img/logo_blue.png">
<meta property="og:description" content="Quiniela FIFA World Cup Brazil 2014">
<meta name="description" content="Quiniela FIFA World Cup Brazil 2014"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FIFA World Cup Pool</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars" data-template-name="application">
<div class="container-fluid">
<div id="sidebar" class="col-md-3 col-xs-12">
<div id="userbox">
{{#if auth.authed }}
{{#link-to 'user' auth.currentUser tagName="h3" classNames="current-user"}}
<img {{bind-attr src=auth.currentUser.avatarUrl alt=model.id}} class="avatar img-circle">
{{ auth.currentUser.name }}
<a class="logout-link" {{ action logout }} title="Sign out"><span class="glyphicon glyphicon-log-out"></span></span></a>
{{/link-to}}
<div class="stats">
<div class="stat-item">
<span class="stat-title">Place: </span>
<span class="stat-value">{{{auth.currentUser.positionOrdinal}}}</span>
</div>
<div class="stat-item">
<span class="stat-title">Score: </span>
<span class="stat-value">{{auth.currentUser.score}}</span>
</div>
</div>
{{#link-to 'user' auth.currentUser tagName="button" classNames="btn btn-success btn-block"}}
My predictions
{{/link-to}}
{{else}}
<button class="btn btn-primary btn-block" {{ action login }}>Sign in with Twitter</button>
{{/if}}
</div>
{{outlet ranking}}
<div class="clearfix"></div>
<div class="hidden-xs">
<div id="rules-header">Scoring</div>
<div class="rules">
<ul>
<li class="exact-score">Exact score = 15 points</li>
<li class="winner-prediction">Winner prediction = 10 points - goals difference.<br/>
<div class="example">
Example:<br/>
Score: Brazil 3 - 1 Croatia<br/>
Your prediction: Brazil 2 - 0 Croatia <br/>
Points: 8 <span class="operation">10 - (3 - 2) - (1 - 0)</span>
</div>
</li>
</ul>
</div>
</div>
<div class="hidden-xs">
<div id="fork">
<a href="https://github.com/ionmx/world-cup-pool">Fork me on GitHub</a>
</div>
</div>
</div>
<div id="workarea" class="col-md-9 col-xs-12">
{{outlet}}
</div>
</div>
</script>
<script type="text/x-handlebars" data-template-name="index">
{{matches-table matches=matches}}
</script>
<script type="text/x-handlebars" id="components/matches-table">
<table class="table matches">
<thead>
<tr>
<th colspan="5">
<h2 class="wc-scores">World Cup Scores</h2>
{{#if user}}
<h3 class="wc-predictions">Predictions</h3>
{{/if}}
</th>
{{#if user}}
<th>Points</th>
{{/if}}
</tr>
</thead>
{{#each match in matches itemController="match"}}
{{#if match.isVisible}}
<tr {{bind-attr class=match.gameClass}}>
<td class="home-team" {{bind-attr class=match.home.id}}>
<img {{bind-attr src=match.home.flag alt=match.home.id}} class="flag img-responsive">
<div class="team">{{match.home.name}}</div>
</td>
<td class="home-score score">
{{match.homeGoalsDisplay}}
{{#if user}}
<div class="prediction">
{{#if match.isEditable}}
{{input type="number" min=0 value=match.prediction.homePrediction insert-newline="updatePrediction" focus-out="updatePrediction" class="form-control"}}
{{else}}
{{match.homePredictionDisplay}}
{{/if}}
</div>
{{/if}}
</td>
<td class="mid-cell">
<div class="match-date">{{match.matchDate}}</div>
<div class="vs">-</div>
<div class="match-date">{{match.matchTime}}</div>
</td>
<td class="visitor-score score">
{{match.visitorGoalsDisplay}}
{{#if user}}
<div class="prediction">
{{#if match.isEditable}}
{{input type="number" min=0 value=match.prediction.visitorPrediction insert-newline="updatePrediction" focus-out="updatePrediction" class="form-control"}}
{{else}}
{{match.visitorPredictionDisplay}}
{{/if}}
</div>
{{/if}}
</td>
<td class="visitor-team" {{bind-attr class=match.visitor.id}}>
<img {{bind-attr src=match.visitor.flag alt=match.visitor.id}} class="flag img-responsive">
<div class="team">{{match.visitor.name}}</div>
</td>
{{#if user}}
<td class="points">
{{match.userPoints}}</div>
</td>
{{/if}}
</tr>
{{/if}}
{{/each}}
</table>
</script>
<script type="text/x-handlebars" data-template-name="matches">
{{matches-table matches=model}}
</script>
<script type="text/x-handlebars" data-template-name="users">
<div id="ranking-header">Live World Cup table</div>
<div class="col-md-12 col-xs-10" id="ranking-div">
<table id="ranking">
{{#each user in controller.highScores}}
{{#link-to 'user' user tagName="tr" classNames="ranking-user"}}
<td {{bind-attr class=":position user.positionClass"}}>
{{{user.positionOrdinal}}}
</td>
<td {{bind-attr class=":username user.positionClass"}}>
<img {{bind-attr src=user.avatarUrl alt=user.id}} class="avatar img-circle">
{{user.name}}
</td>
<td {{bind-attr class=":userpoints user.positionClass"}}>
{{user.score}}
</td>
{{/link-to}}
{{/each}}
</table>
</div>
</script>
<script type="text/x-handlebars" data-template-name="user">
<h1>
<img {{bind-attr src=model.avatarUrl alt=controller.id}} class="avatar img-circle img-responsive">
{{controller.name}}
<a {{bind-attr href=controller.twitterUrl}} target="_blank"><img src="img/twitter.png"></a>
</h1>
<div class="col-xs-12 col-md-12 total-points">
<span class="p-label">Place:</span><span class="p-value">{{{controller.positionOrdinal}}}</span>
<span class="p-divider"></span>
<span class="p-label">World Cup Table:</span><span class="p-value">{{controller.score}}</span>
</div>
<div class="clearfix"></div>
{{matches-table matches=controller.matches user=model}}
</script>
<script src="js/jquery.js"></script>
<script src="js/firebase.js"></script>
<script src="js/handlebars.js"></script>
<script src="js/ember.js"></script>
<script src="js/ember-data.js"></script>
<script src="js/emberfire.js"></script>
<script src="js/firebase-simple-login.js"></script>
<script src="js/moment-with-langs.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/app.js"></script>
<script>
$(function() {
});
</script>
</body>
</html>