Skip to content

Commit d147fa4

Browse files
committed
add
1 parent 2da92bd commit d147fa4

File tree

1 file changed

+183
-0
lines changed

1 file changed

+183
-0
lines changed
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr">
4+
<head>
5+
<title>Create Conference Schedule - {{conference}}</title>
6+
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8" />
7+
<style type="text/css" media="screen" title="Normal Text">@import url("/media/css/base.css");</style>
8+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
9+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script><style media="print">
10+
#pgHeaderContainer, #pgSideWrap { display:none; }
11+
div.schedwrap {
12+
font-size: 69%;
13+
}
14+
</style>
15+
<style>
16+
div.schedwrap {
17+
border: 1px solid black;
18+
position: relative;
19+
}
20+
div.sessblock {
21+
border: 1px solid gray;
22+
overflow:hidden;
23+
position: absolute;
24+
}
25+
div.sesspending {
26+
opacity: 0.3;
27+
}
28+
div.roomheader {
29+
font-weight: bold;
30+
font-size: 1.2em;
31+
top: 0px;
32+
text-align: center;
33+
}
34+
div.sessblock a {
35+
text-decoration: none;
36+
color: black;
37+
}
38+
div.actualsession {
39+
z-index: 10;
40+
}
41+
{%for track in tracks%}
42+
div.track{{track.id}} {
43+
background-color: {{track.color}};
44+
}
45+
{%endfor%}
46+
</style>
47+
48+
<script type="text/javascript">
49+
$( init );
50+
/* Yes, this is very full of ugly hacks */
51+
52+
function init() {
53+
$('.actualsession').draggable({
54+
cursor: 'move',
55+
snap: '.sessionslot',
56+
revert: 'invalid',
57+
});
58+
59+
$('.sessionslot').droppable({
60+
drop: function(event, ui) {
61+
session = ui.draggable;
62+
63+
// Are we moving away from existing slot? If so, mark it as open!
64+
if (session.attr('slot')) {
65+
oldslot = $('#' + session.attr('slot'));
66+
oldslot.attr('sessionid', null);
67+
oldslot.droppable('option', 'accept', '.actualsession');
68+
}
69+
70+
$(this).attr('sessionid', session.attr('id'));
71+
session.attr('slot', $(this).attr('id'));
72+
73+
// Since something is now in this slot, turn off the acceptableness
74+
$(this).droppable('option', 'accept', 'busy');
75+
76+
// Align the position of our object
77+
session.css($(this).offset());
78+
session.height($(this).height());
79+
session.width($(this).width());
80+
}
81+
});
82+
83+
$('#availablewrapper').droppable({
84+
drop: function(event, ui) {
85+
session = ui.draggable;
86+
// Are we moving away from existing slot? If so, mark it as open!
87+
if (session.attr('slot')) {
88+
oldslot = $('#' + session.attr('slot'));
89+
oldslot.attr('sessionid', null);
90+
oldslot.droppable('option', 'accept', '.actualsession');
91+
session.attr('slot', null);
92+
}
93+
}
94+
});
95+
96+
$('#loaderDiv')
97+
.hide()
98+
.ajaxStart(function() { $(this).show(); })
99+
.ajaxStop(function() { $(this).hide(); })
100+
;
101+
102+
// Load the current state
103+
$.post('.', {'get': 1}, function(data) {
104+
$.each(data, function(k, v) {
105+
slot = $('#' + k);
106+
session = $('#' + v);
107+
slot.attr('sessionid', session.attr('id'));
108+
session.attr('slot', slot.attr('id'));
109+
110+
// Since something is now in this slot, turn off the acceptableness
111+
slot.droppable('option', 'accept', 'busy');
112+
113+
// Align the position of our object
114+
session.css(slot.offset());
115+
session.height(slot.height());
116+
session.width(slot.width());
117+
});
118+
});
119+
}
120+
121+
function saveDraft() {
122+
if (!confirm("Are you sure you want to save the draft? (This overwrites all changes, but doesn't publish anything)")) {
123+
return;
124+
}
125+
// Build a representation of all scheduled slots
126+
sched = {}
127+
$('.sessionslot').each(function(i, el) {
128+
sessionid = $(el).attr('sessionid');
129+
if (sessionid) {
130+
sched[$(el).attr('id')] = sessionid;
131+
}
132+
});
133+
$.post('.', sched, function(data) {
134+
alert('Saved.');
135+
}).error(function(data) {
136+
alert('Failed!\n' + data);
137+
});
138+
}
139+
</script>
140+
141+
</head>
142+
<body>
143+
<h1>Create Conference Schedule - {{conference}}</h1>
144+
<p>
145+
<b>NOTE! THIS IS FOR CREATING A TENTATIVE SCHEDULE ONLY!</b>
146+
You also have to manually verify that the length of the talk matches
147+
the talk slot, if your schedule supports multiple different lengths.
148+
</p>
149+
150+
<div id="loaderDiv" style="background-color: gray; position:absolute; z-index:9999; top:0; left:0; width:100%; height:100%; opacity: .5;text-align:center;">
151+
<font size="30">Please wait, talking to Mr Server...</font>
152+
</div>
153+
154+
<div id="availablewrapper" style="float:right; border:1px solid blue;width:{{sesswidth}}px;height:500px;">
155+
<h3>Available sessions</h3>
156+
{%for s in sessions %}
157+
<div id="sess{{s.id}}" class="sessblock actualsession track{{s.track.id}}{%if s.ispending%} sesspending{%endif%}" style="top: {{s.top}}px; width: {{sesswidth}}px; height: {{s.height}}px;">{{s.title}}<br/><i>{{s.speaker_list}}</i></div>
158+
{%endfor%}
159+
</div>
160+
161+
{%for day in days%}
162+
<h2>{{day.day|date:"l, F d"}}</h2>
163+
<div class="schedwrap" style="height: {{day.schedule_height}}px; width: {{day.schedule_width}}px;">
164+
{%for room in day.rooms%}
165+
<div class="sessblock roomheader" style="left: {{room.leftpos}}px; width: {{room.widthpos}}px; height: {{room.heightpos}}px;">
166+
{{room.name}}
167+
</div>
168+
{%endfor%}
169+
{%for session in day.sessions%}
170+
<div id="slot{{session.id}}" class="sessblock sessionslot" style="top: {{session.toppos}}px; left: {{session.leftpos}}px; width: {{session.widthpos}}px; height: {{session.heightpos}}px;">
171+
{{session.timeslot}}
172+
</div>
173+
{%endfor%}
174+
</div>
175+
176+
{%endfor%}
177+
<button onClick="saveDraft()">Save draft</button>
178+
<p>
179+
When you are ready to publish, click <a href="publish/">here</a>. (you must
180+
save using the standard save button first, of course)
181+
</p>
182+
</body>
183+
</html>

0 commit comments

Comments
 (0)