-
Notifications
You must be signed in to change notification settings - Fork 2
/
base.html
408 lines (382 loc) · 16.2 KB
/
base.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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{% block title %}WBOR{% endblock %}</title>
<link rel="icon" type="image/png" href="/static/images/favicon.png">
<link rel="stylesheet" href="/static/css/bootstrap.min.css" />
<link rel="stylesheet" href="/static/css/page.css" />
<link rel="stylesheet" href="/static/css/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="/static/css/lightbox.css" media="screen" />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<script type='text/javascript' src='/static/js/jquery-ui.js'></script>
<script type='text/javascript' src='/static/js/jquery.autocomplete.js'></script>
<script type='text/javascript' src='/static/js/jquery.lightbox.js'></script>
<script type='text/javascript' src='/static/js/jquery.tinymce.js'></script>
<script type='text/javascript' src='/static/js/jquery.form.js'></script>
<script type='text/javascript'>
background = function() {
document.body.style.background =
'url(/static/images/bg/' +
(Math.round(Math.random() * 21) + 1) + '.gif)';
}
$(document).ready(function() {
if ($('textarea.tinymce').length > 0) {
$('textarea.tinymce').tinymce({
script_url: '/static/js/tiny_mce.js',
theme: "advanced",
});
}
$("#djpanel-dropdown").attr("href", "#djpanel");
$("a#dj-login").attr("href", "#log-in-modal");
$(".datepicker").datepicker();
$("#call-me-button").click(function() {
//var button_id = "70e3620d182effab182eb21d91808249cfff9658";
//// My GVId for now 70e3620d182effab182eb21d91808249cfff9658
// WBOR GVID:
var button_id = "149751eac6a0d999583c849fb23a20e411e05cf7";
var cid_number = $('#cid_number').val();
var cid_name = $('#cid_name').val();
$.get("/callvoice", {
button_id: button_id,
cid_number: cid_number,
cid_name: cid_name},
function(data) {
alert(data);
});
});
var alertbox = $("<div class='alert fade in'></div>");
alertbox.append($('<a class="close" data-dismiss="alert" href="#">×</a>'));
alertbox.append($("<span></span>"))
nowPlaying();
if ($("#delete-button")) {
$("#delete-button").click(function() {
return confirm("Are you sure you want to do this?");
});
}
if ($(".artist-autocomplete").length > 0) {
$(".artist-autocomplete").autocomplete({
serviceUrl: '/ajax/artistcomplete',
minChars: 1,
width: $(".artist-autocomplete").width(),
maxHeight: 400,
onSelect: function(value, data) {
},
});
}
if ($(".dj-autocomplete").length > 0) {
$(".dj-autocomplete").each(function(index) {
var p_key = $(this).attr("key");
$(this).autocomplete({
serviceUrl: '/ajax/djcomplete',
minChars: 1,
width: $(".dj-autocomplete").width(),
maxHeight: 400,
onSelect: function(value, data) {
$.post("/dj/permissions",
{
'dj_key': data["key"],
'permission_key': p_key,
'action': "add",
},
function(postdata) {
if (postdata.err) {
alert(postdata.err);
} else {
var li = document.createElement("li");
li.innerHTML = data["name"];
$("#" + p_key).append(li);
var newalert = alertbox.clone();
newalert.find("span").html(postdata.msg);
$("#msgbox").append(newalert);
}
}, "json");
},
});
});
}
if ($("#albumlist li a").length > 0) {
$("#albumlist li a").lightBox({
imageLoading: '/static/images/lightbox-ico-loading.gif',
imageBtnClose: '/static/images/lightbox-btn-close.gif',
imageBtnPrev: '/static/images/lightbox-btn-prev.gif',
imageBtnNext: '/static/images/lightbox-btn-next.gif',
imageBlank: '/static/images/lightbox-blank.gif',
});
}
});
function popupAlert(message, title, type) {
}
function nowPlaying() {
// request currently-playing information; update page accordingly.
// requests both now-playing box and recently-played box,
// if you're on the main page.
$.get('/updateinfo', function(data) {
$("#currentsong").html(data.song_string);
$("#currentsong").attr("data-original-title", data.song_string);
$("#currentartist").html(data.artist_string);
$("#currentartist").attr("data-original-title", data.artist_string);
$("#currentshow").html(data.program_title);
$("#currentshow").attr("data-original-title", data.program_title);
$("#currentshow").attr('href', '/programs/' + data.program_slug);
$("#currentshow").attr("data-content",
data.program_desc + "<hr />" + data.top_played);
if ($("#latestplays")) {
$("#latestplays").html(data.recent_songs_html);
}
}, "json");
nowPlayingTimer = setTimeout("nowPlaying()", 30000);
}
</script>
{% block extra_scripts %}{% endblock %}
</head>
<body onLoad="background();">
<div class="modal fade" id="call-me-modal">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Call us!</h3>
</div>
<div class="modal-body">
<p>Enter in your name and phone number, and Google
Voice will connect you automatically!</p>
<label>Your name
<input type="text" id="cid_name"></label>
<label>Your phone number
<input type="text" id="cid_number"></label>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-primary" id="call-me-button"
data-dismiss="modal">
Dial!
</a>
</div>
</div>
<div class="modal fade" id="log-in-modal">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Log in</h3>
</div>
<form method='post' action='/dj/login/' style="margin:0px;">
<div class="modal-body">
<label for='username'>Username
<input class="input-xlarge" type='text' name='username' id='username' />
</label>
<label for='password'>Password
<input class="input-xlarge" type='password' name='password' id='password' />
</label>
</div>
<div class="modal-footer">
<input class="btn btn-primary"
type='submit' name='submit' value="Log in">
</div>
</form>
</div>
<div id='outer-wrap' class='container' style='padding:18px;'>
<div id='wrap' style="margin:-10px; padding:10px;"><div id='header' style="margin:-10px; padding:10px;">
<div class="row" style="position:relative">
<div class='span6' id='logo'><!-- Start header -->
<a title='WBOR 91.1FM - Commercial-free radio from Bowdoin College, Brunswick ME, since 1951' href='/'>
<img src='/static/images/transparentlogo.png'></a>
</div>
<div class='span5 pull-right'
style="position:absolute; bottom:5px; right:-5px;">
<div class="pull-right">
<a class="btn btn-primary btn-large"
data-toggle="modal"
href="#call-me-modal">
<strong>Call us!</strong>
<br>We'll connect you
</a>
<a href='/static/wbor.m3u' class="btn btn-listen
btn-large">
<strong>Listen now!</strong>
<br>Live Internet stream
</a>
</div>
</div><!-- End header -->
</div>
</div>
<!-- This is for the "floating" navbar -->
<div class='navbar' style="margin-left:-20px; margin-right:-20px;
margin-bottom:0px;">
<div class='navbar-inner'>
<div class='container'>
<a class="btn btn-navbar"
data-toggle="collapse"
data-target=".nav-collapse#whole-nav">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="btn btn-navbar"
data-toggle="collapse"
data-target=".nav-collapse#dj-panel"
style="height:12px; overflow:hidden;">
<span class="icon-cog icon-white" style="height:12px;margin-top:-1px;">
</a>
<div class="nav-collapse" id="whole-nav">
<ul class="nav pull-left">
<li {% if news_selected %}class='active'{% endif %}>
<a href='/'>News</a>
</li>
<li {% if events_selected %}class='active'{% endif %}>
<a href='/events'>Events</a>
</li>
<li {% if schedule_selected %}class='active'{% endif %}>
<a href='/schedule'>Schedule</a>
</li>
<li {% if playlists_selected %}class='active'{% endif %}>
<a href='/playlists'>Playlists</a>
</li>
<li {% if charts_selected %}class='active'{% endif %}>
<a href='/charts'>Charts</a>
</li>
<li {% if fun_selected %}class='active'{% endif %}>
<a href='/fun'>Fun</a>
</li>
<li {% if history_selected %}class='active'{% endif %}>
<a href='/history'>History</a>
</li>
<li {% if contact_selected %}class='active'{% endif %}>
<a href='/contact'>Contact</a>
</li>
</ul>
</div>
<div class="nav-collapse" id="dj-panel">
<ul class="nav pull-right">
{% if "dj" in session %}
<li class="divider"></li>
<li class="dropdown" id="djpanel">
<a href="/dj/" id="djpanel-dropdown" class="dropdown-toggle"
data-toggle="dropdown">
<strong>DJ Panel</strong>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header"><a href="/dj/">
<strong>{{ session.dj.fullname }}</strong>
<br>{{ session.program.title }}
</a></li>
<li><a href='/dj/selectprogram'>Switch Show</a></li>
<li><a href='/dj/logout'>Log Out</a></li>
<li class="divider">
{% if session.dj.permissions %}
{% if session.dj.permissions.djs %}<li>
<a href='/dj/djs'>Manage DJs</a>
</li>{% endif %}
{% if session.dj.permissions.programs %}<li>
<a href='/dj/programs'>Manage Programs</a>
</li>{% endif %}
{% if session.dj.permissions.albums %}<li>
<a href='/dj/albums'>Manage Albums</a>
</li>{% endif %}
{% if session.dj.permissions.events %}<li>
<a href='/dj/event'>New Event</a>
</li>{% endif %}
{% if session.dj.permissions.genres %}
<!-- <li>
<a href='/dj/genres'>Session.Dj.Manage Genres</a>
</li> -->{% endif %}
{% if session.dj.permissions.permissions %}<li>
<a href='/dj/permissions'>Manage Permissions</a>
</li>{% endif %}
{% if session.dj.permissions.blog %}<li>
<a href='/dj/newpost'>New Blog Post</a>
</li>{% endif %}
<li class="divider"></li>
{% endif %}
<li><a href='/dj/chartsong'>Chart Song</a></li>
<li><a href='/dj/charts'>View Charts</a></li>
<li><a href='/dj/logs'>View Logs</a></li>
<li><a href='/dj/myshow'>Edit Show Information</a></li>
<li><a href='/dj/myself'>Edit DJ Information</a></li>
</ul>
</li>
{% else %}
<li><a href='/dj/login' id="dj-login"
data-toggle="modal">
DJ Login</a>{% endif %}</li>
</ul>
</div>
</div>
</div>
</div>
<div class="navbar navbar-nowplaying">
<div class="navbar-inner">
<div class="container" id='nowplaying'>
<ul class="nav pull-left">
<li><p class="navbar-text">Now playing</p></li>
<li><a id='currentsong'
rel="tooltip"
title="Track"
data-placement="bottom">gathering
info...</a></li>
<li><p class="navbar-text">by</p></li>
<li><a id='currentartist'
rel="tooltip"
title="Artist"
data-placement="bottom">gathering
info...</a></li>
<li><p class="navbar-text">on</p></li>
<li><a href='show/hitgitsplit' id='currentshow'
rel="popover" data-placement="bottom"
data-original-title="Show Description">
wait for it...
</a>
</li>
</ul>
<ul class="nav pull-right">
{% if "dj" in session %}
<form class="navbar-form pull-right">
<a class="btn btn-wbor" href="/dj/chartsong">Chart
Song</a>
</form>
{% endif %}
</ul>
</div>
</div>
</div>
<div class="row" id="flash_row">
<div class='span12' id='msgbox'>
{% for msg in flash %}
<div class='alert fade in'>
<a class="close" data-dismiss="alert" href="#">×</a>
{{ msg.0|safe }}
</div>
{% endfor %}
</div>
</div>
{% block main_content %}
<div class="row">
{% block top_row %}{% endblock %}
</div>
<div class="row">
<div class='span8'><!-- Left-hand column on front page -->
{% block left_column %}
{% endblock %}
</div><!-- End left-hand column -->
<!-- Right-hand column on front page -->
<div class='span4'>
{% block right_column %}
{% endblock %}
</div><!-- End right-hand column -->
</div>
{% endblock %}
<footer>
{% block footer %}<!-- footer, obviously -->
© 2010-2012, WBOR Brunswick, 91.1 FM
{% endblock %}
</footer><!-- end footer -->
</div><!-- End wrap -->
</div><!-- End outer wrap -->
<script type="text/javascript"
src="/static/js/bootstrap.js"></script>
<script type="text/javascript">
$(function() {
$('a[rel="popover"]').popover();
$('span[rel="popover"]').popover();
$('a[rel="tooltip"]').tooltip();
});
</script>
</body>
</html>