forked from dheslin24/dailybox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
display_box.html
227 lines (218 loc) · 9.72 KB
/
display_box.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
212
213
214
215
216
217
218
219
220
221
222
223
{% extends "layout_uat.html" %}
{% block title %}
Index
{% endblock %}
{% block main %}
<div class="row">
<div class="col-md-8 col-xs-12">
<h2>
<p class="text-center">
{{ box_name }} </br>
<p>
</h2>
<h3>
<p class="text-center">
Entry Fee: {{ fee }}
Boxes Available: {{ avail }} </br>
</p>
</h3>
<h5>
<p class="text-center">
{{ payout }} </br>
<!--
{{ final_payout }}
-->
</p>
</h5>
{% if avail != 0 %}
<h5>
<p class="text-center"> Click your selection again to 'undo' pick. </p>
</h5>
{% else %}
<h3>
<p class="text-center">Current Final Payout: <span style="color: darkgreen;"><strong>{{ final_payout }}</strong></span> Current Reverse Final Payout: <span style="color: darkgreen;"><strong>{{ rev_payout }}</strong></span></p>
{% endif %}
</h3>
<h4><p class="text-center">{{ num_selection }}</p>
<!--
<a href="{{ url_for("current_winners", boxid=boxid) }}">Click here for list of current winners</a>
-->
<!--
</br>
</br>
<a href="{{ url_for("payment_status") }}">Click here for payment status of all users</a>
-->
<!--
<p> Randomize Selection </p>
<form name="randform" id="randform" action="{{ url_for("select_box") }}", method="POST">
<input type="text" name="rand" id="rand" size="5" placeholder="# boxes">
<input type="hidden" name="boxid" value="{{ boxid }}">
<input type="submit" onClick="return empty()">
</form>
-->
</div>
<div class="col-md-4 col-xs-12">
</div>
</div>
<div class="row">
<div class="col-md-8 col-xs-12">
<table id="grid" align="center">
<h3>
<!--
<tr>
<td></td>
<td></td>
{% for n in range(0,10) %}
<td>
<form action="{{ url_for("select_box") }}", method="POST">
<button type="submit" value="{{ loop.index0 }}" name="column">Select Column</button>
<input type="hidden" name="boxid" value="{{ boxid }}">
</form>
</td>
{% endfor %}
</tr>
-->
</h3>
<h1>
<!--
<tr><td style="background-color: #aaa" colspan="12"><strong style="font-size: 30px; letter-spacing: 5px">{{ home[0:3] }}</td></tr>
-->
<tr>
<td class="BYG" colspan="2" style="border-bottom: solid blue;"><strong style="font-size: 30px;">BYG</td>
<td class="{{ home }}" colspan="10" style="border-bottom: 2px solid black;"><strong style="font-size: 30px; letter-spacing: 5px;">{{ home[0:3] }}</td></tr>
<tr>
<td class="BYG" colspan="2" style="border-bottom: 1px solid black;">Box: {{ boxid }} </td>
{% for num in x %}
<h1><td class="{{ home }}"><strong style="font-size: 30px"> {{ x[loop.index0|string] }} </strong></td></h1>
{% endfor %}
</tr>
</h1>
<h3>
{% for row in grid %}
{% set outer_loop = loop %}
<tr>
<h1><td class="{{ away }}"><strong style="font-size: 30px"> {{ away_team[outer_loop.index0|string] }} </strong></td></h1>
<h1><td class="{{ away }}" style="border-bottom: 2px solid black;"><strong style="font-size: 30px"> {{ y[outer_loop.index0|string] }} </strong></td></h1>
{% for box in row %}
{% if box[1][:6] == 'WINNER' %}
{% if box[2] == session['username'] %}
<td class="my_winning_box" onClick="document.getElementById('{{- box[0]|int -}}').submit()">
<form action="{{ url_for("select_box") }}", id="{{- box[0]|int -}}" method="POST">
<input type="hidden" name="boxid", value="{{ boxid }}">
<input type="hidden" name="box_num" value="{{- box[0]|int -}}">
{% set bnum = outer_loop.index0|int * 10 + loop.index|int %}
<p class="corner"> {{ bnum }}</p>
{{ box[1] }}<br><br>
</form>
</td>
{% else %}
<td class="winning_box" onClick="document.getElementById('{{- box[0]|int -}}').submit()">
<form action="{{ url_for("select_box") }}", id="{{- box[0]|int -}}" method="POST">
<input type="hidden" name="boxid", value="{{ boxid }}">
<input type="hidden" name="box_num" value="{{- box[0]|int -}}">
{% set bnum = outer_loop.index0|int * 10 + loop.index|int %}
<p class="corner"> {{ bnum }}</p>
{{ box[1] }}<br><br>
</form>
</td>
{% endif %}
{% elif box[1] == session['username'] %}
<td class="user_box" onClick="document.getElementById('{{- box[0]|int -}}').submit()">
<form action="{{ url_for("select_box") }}", id="{{- box[0]|int -}}" method="POST">
<input type="hidden" name="boxid", value="{{ boxid }}">
<input type="hidden" name="box_num" value="{{- box[0]|int -}}">
{% set bnum = outer_loop.index0|int * 10 + loop.index|int %}
<p class="corner"> {{ bnum }}</p>
{{- box[1][:10] -}}
</form>
</td>
{% elif box[1] != 'Available ' %}
<td class="taken_box" onClick="document.getElementById('{{- box[0]|int -}}').submit()">
<form action="{{ url_for("select_box") }}", id="{{- box[0]|int -}}" method="POST">
<input type="hidden" name="boxid", value="{{ boxid }}">
<input type="hidden" name="box_num" value="{{- box[0]|int -}}">
{% set bnum = outer_loop.index0|int * 10 + loop.index|int %}
<p class="corner"> {{ bnum }}</p>
{{- box[1][:10] -}}
</form>
</td>
{% else %}
<td class="box" onClick="document.getElementById('{{- box[0]|int -}}').submit()">
<form action="{{ url_for("select_box") }}", id="{{- box[0]|int -}}" method="POST">
<input type="hidden" name="boxid", value="{{ boxid }}">
<input type="hidden" name="box_num" value="{{- box[0]|int -}}">
{% set bnum = outer_loop.index0|int * 10 + loop.index|int %}
<p class="corner" style="color: black;"> {{ bnum }}</p>
{{- box[1][:10] -}}
</form>
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</h3>
</table>
</div>
<div class="col-md-4 col-xs-12">
<p class="text-center"> Live IN-Game Updates (Must Refresh) </p>
<table class="table table-striped" align="center" style="padding-top: 30px">
<th>#</th>
<th>TB</th>
<th>KC</th>
<th>Desc</th>
<th>Winner</th>
<th>Box</th>
{% for score in scores %}
{% if score[0] == 100 %}
<tr>
<td style="background-color: blue; color: white;">RF</td>
{% for field in score[1:-1] %}
<td class="revfinal" style="background-color: blue; color: white;">{{ field }}</td>
{% endfor %}
<td style="background-color: blue; color: white;">{{ score[-1]|int + 1 }}</td>
</tr>
{% elif score[0] == 101 %}
<tr>
<td style="background-color: lightblue;">RFT</td>
<td style="background-color: lightblue;">n/a</td>
<td style="background-color: lightblue;">n/a</td>
{% for field in score[3:-1] %}
<td style="background-color: lightblue;">{{ field }}</td>
{% endfor %}
<td style="background-color: lightblue;">{{ score[-1]|int + 1 }}</td>
</tr>
{% elif score[0] == 200 %}
<tr>
<td style="background-color: darkgreen; color: white;">F</td>
{% for field in score[1:-1] %}
<td style="background-color: darkgreen; color: white;">{{ field }}</td>
{% endfor %}
<td style="background-color: darkgreen; color: white;">{{ score[-1]|int + 1 }}</td>
</tr>
{% elif score[0] == 201 %}
<tr>
<td style="background-color: lightgreen;">FT</td>
<td style="background-color: lightgreen;">n/a</td>
<td style="background-color: lightgreen;">n/a</td>
{% for field in score[3:-1] %}
<td style="background-color: lightgreen;">{{ field }}</td>
{% endfor %}
<td style="background-color: lightgreen;">{{ score[-1]|int + 1 }}</td>
</tr>
{% else %}
<tr>
{% for field in score[:-1] %}
{% if field == None %}
<td>n/a</td>
{% else %}
<td>{{ field }}</td>
{% endif %}
{% endfor %}
<td>{{ score[-1]|int + 1 }}</td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>
</div>
{% endblock %}