-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtournament.html
171 lines (168 loc) · 6.79 KB
/
tournament.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
{% extends "base.html" %}
{% block title %}Tournament Properties{% endblock %}
{% block head %}
<style type="text/css">
form table tr th { font-size: 75%; }
input[type="number"] { width: 5em; }
</style>
<script type="text/javascript" language="javascript">
var months_of_year = [ "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" ];
function gen_date_picker(name, month, day, year) {
document.write("<select name=" + name + "_month>");
for (var m = 1; m <= 12; m++)
document.write("<option label=\"" + months_of_year[m-1] + "\" value=\"" + m + "\"" +
(m == month ? " selected" : "") + ">" +
months_of_year[m-1] + "</option>");
document.write("</select>");
document.write("<select name=" + name + "_day>");
for (var d = 1; d <= 31; d++)
document.write("<option label=\"" + d + "\" value=\"" + d + "\"" +
(d == day ? " selected" : "") + ">" +
d + "</option>");
document.write("</select>");
document.write("<select name=" + name + "_year>");
for (var y = 2018; y <= 2019; y++)
document.write("<option label=\"" + y + "\" value=\"" + y + "\"" +
(y == year ? " selected" : "") + ">" +
y + "</option>");
document.write("</select>");
}
</script>
{% endblock %}
{% block content %}
<h2>Tournament Properties</h2>
<form action="/admin/tournament" method="post">
<table border="0" cellspacing="0" cellpadding="10">
<tr>
<td align="left">Name</td>
<td align="left">
<input type="hidden" name="original_name" value="{{ tournament.name }}">
<input type="text" size="10" name="new_name" value="{{ tournament.name }}">
</td>
</tr>
<tr>
<td align="left">Published</td>
<td align="left"><input type="checkbox" name="published" value="y" {% if tournament.published %}checked{% endif %}></td>
</tr>
<tr>
<td align="left">Accepting Registrations</td>
<td align="left"><input type="checkbox" name="accepting" value="y" {% if tournament.accepting_registrations %}checked{% endif %}></td>
</tr>
<tr>
<td align="left"># Golfers</td>
<td align="left">
<input type="number" size="3" name="num_golfers" value="{{ counters.golfer_count }}">
Limit <input type="number" size="3" name="limit_golfers" value="{{ tournament.limit_golfers }}">
Sold Out <input type="checkbox" name="golf_sold_out" value="y" {% if tournament.golf_sold_out %}checked{% endif %}>
</td>
</tr>
<tr>
<td align="left"># Dinners</td>
<td align="left">
<input type="number" size="3" name="num_dinners" value="{{ counters.dinner_count }}">
Limit <input type="number" size="3" name="limit_dinners" value="{{ tournament.limit_dinners }}">
Sold Out <input type="checkbox" name="dinner_sold_out" value="y" {% if tournament.dinner_sold_out %}checked{% endif %}>
</td>
</tr>
<tr>
<td align="left">Golf Date</td>
<td align="left">
<script type="text/javascript" language="javascript">
gen_date_picker("golf", {{ tournament.golf_date.month }}, {{ tournament.golf_date.day }}, {{ tournament.golf_date.year }});
</script>
</td>
</tr>
<tr>
<td align="left">Dinner Date</td>
<td align="left">
<script type="text/javascript" language="javascript">
gen_date_picker("dinner", {{ tournament.dinner_date.month }}, {{ tournament.dinner_date.day }}, {{ tournament.dinner_date.year }});
</script>
</td>
</tr>
<tr>
<td align="left">Golf Early Bird Deadline</td>
<td align="left">
<script type="text/javascript" language="javascript">
gen_date_picker("early_bird", {{ tournament.early_bird_deadline.month }}, {{ tournament.early_bird_deadline.day }}, {{ tournament.early_bird_deadline.year }});
</script>
</td>
</tr>
<tr>
<td align="left">Dinner Early Bird Deadline</td>
<td align="left">
<script type="text/javascript" language="javascript">
gen_date_picker("dinner_early_bird", {{ tournament.dinner_early_bird_deadline.month }}, {{ tournament.dinner_early_bird_deadline.day }}, {{ tournament.dinner_early_bird_deadline.year }});
</script>
</td>
</tr>
<tr>
<td align="left">Final Deadline</td>
<td align="left">
<script type="text/javascript" language="javascript">
gen_date_picker("deadline", {{ tournament.deadline.month|default:4 }}, {{ tournament.deadline.day|default:29 }}, {{ tournament.deadline.year|default:2019 }});
</script>
</td>
</tr>
<tr>
<td align="left">Tribute Ad Deadline</td>
<td align="left">
<script type="text/javascript" language="javascript">
gen_date_picker("tribute_deadline", {{ tournament.tribute_deadline.month|default:4 }}, {{ tournament.tribute_deadline.day|default:29 }}, {{ tournament.tribute_deadline.year|default:2019 }});
</script>
</td>
</tr>
<tr>
<td align="left">Golf + Dinner Price</td>
<td align="left">Early Bird <input type="number" size="5" name="golf_price_early" value="{{ tournament.golf_price_early }}">
Late <input type="number" size="5" name="golf_price_late" value="{{ tournament.golf_price_late }}"></td>
</tr>
<tr>
<td align="left">Golf-Only Price</td>
<td align="left">Early Bird <input type="number" size="5" name="golf_only_price_early" value="{{ tournament.golf_only_price_early }}">
Late <input type="number" size="5" name="golf_only_price_late" value="{{ tournament.golf_only_price_late }}"></td>
</tr>
<tr>
<td align="left">Dinner-Only Price</td>
<td align="left">Early Bird <input type="number" size="5" name="dinner_price_early" value="{{ tournament.dinner_price_early }}">
Late <input type="number" size="5" name="dinner_price_late" value="{{ tournament.dinner_price_late }}"></td>
</tr>
<tr>
<td align="left">GO Discount Codes</td>
<td align="left"><input type="text" size="30" name="go_discount_codes" value="{{ tournament.go_discount_codes|default:"" }}"></td>
</tr>
<tr>
<td align="left">Wait List Email</td>
<td align="left">
<input type="text" size="30" name="wait_list_email" value="{{ tournament.wait_list_email }}">
</td>
</tr>
<tr>
<td align="left">Dinner Choices</td>
<td align="left">
<input type="text" size="30" name="dinner_choices" value="{{ tournament.dinner_choices }}">
</td>
</tr>
<tr>
<td align="left">Red Tees</td>
<td align="left">Rating <input type="number" step="0.1" size="3" name="red_course_rating" value="{{ tournament.red_course_rating }}">
Slope <input type="number" step="0.1" size="4" name="red_course_slope" value="{{ tournament.red_course_slope }}"></td>
</tr>
<tr>
<td align="left">White Tees</td>
<td align="left">Rating <input type="number" step="0.1" size="3" name="white_course_rating" value="{{ tournament.white_course_rating }}">
Slope <input type="number" step="0.1" size="4" name="white_course_slope" value="{{ tournament.white_course_slope }}"></td>
</tr>
<tr>
<td align="left">Blue Tees</td>
<td align="left">Rating <input type="number" step="0.1" size="3" name="blue_course_rating" value="{{ tournament.blue_course_rating }}">
Slope <input type="number" step="0.1" size="4" name="blue_course_slope" value="{{ tournament.blue_course_slope }}"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Save"></td>
</tr>
</table>
</form>
{% endblock %}