update schedule templates

This commit is contained in:
Luke Hatcher 2012-12-19 23:59:48 -05:00
parent 4c3b01c9a8
commit 50fa632127
3 changed files with 125 additions and 55 deletions

View file

@ -1,32 +1,39 @@
<table class="table table-bordered table-condensed"> <table class="calendar table table-bordered">
<tr> <thead>
<th>&nbsp;</th>
{% for room in timetable.rooms %}
<th>{{ room.name }}</th>
{% endfor %}
</tr>
{% for row in timetable %}
<tr> <tr>
<td class="time">{{ row.time|date:"h:iA" }}</td> <th class="time">&nbsp;</th>
{% for slot in row.slots %} {% for room in timetable.rooms %}
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}"> <th>{{ room.name }}</th>
{% if slot.kind.label == "talk" %}
{% if not slot.content %}
<a class="btn btn-mini edit-slot" data-action="{% url schedule_slot_edit schedule.section.slug slot.pk %}" href="#">+</a>
{% else %}
<div class="title"><a class="edit-slot" data-action="{% url schedule_slot_edit schedule.section.slug slot.pk %}" href="#">{{ slot.content.title }}</a></div>
<div class="speaker">{{ slot.content.speaker }}</div>
{% endif %}
{% else %}
{% if slot.content_override.raw %}
{{ slot.content_override.rendered|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
&mdash; <a class="edit-slot" data-action="{% url schedule_slot_edit schedule.section.slug slot.pk %}" href="#">edit</a>
{% endif %}
</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} </thead>
<tbody>
{% for row in timetable %}
<tr>
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{% if slot.kind.label == "talk" or slot.kind.label == "tutorial" %}
{% if not slot.content %}
<a class="btn btn-mini edit-slot" data-action="{% url schedule_slot_edit schedule.section.slug slot.pk %}" href="#">+</a>
{% else %}
<span class="title"><a class="edit-slot" data-action="{% url schedule_slot_edit schedule.section.slug slot.pk %}" href="#">{{ slot.content.title }}</a></span>
<span class="speaker">{{ slot.content.speaker }}</span>
{% endif %}
{% else %}
{% if slot.content_override.raw %}
{{ slot.content_override.rendered|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
&mdash; <a class="edit-slot" data-action="{% url schedule_slot_edit schedule.section.slug slot.pk %}" href="#">edit</a>
{% endif %}
</td>
{% endfor %}
{% if forloop.last %}
<td colspan="{{ timetable.rooms|length }}"></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table> </table>

View file

@ -1,30 +1,41 @@
<table class="table table-bordered table-condensed"> <table class="calendar table table-bordered">
<tr> <thead>
<th>&nbsp;</th>
{% for room in timetable.rooms %}
<th>{{ room.name }}</th>
{% endfor %}
</tr>
{% for row in timetable %}
<tr> <tr>
<td class="time">{{ row.time|date:"h:iA" }}</td> <th class="time">&nbsp;</th>
{% for slot in row.slots %} {% for room in timetable.rooms %}
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}"> <th>{{ room.name }}</th>
{% if slot.kind.label == "talk" %}
{% if not slot.content %}
{% else %}
<div class="title"><a href="{% url schedule_presentation_detail slot.content.pk %}">{{ slot.content.title }}</a></div>
<div class="speaker">{{ slot.content.speaker }}</div>
{% endif %}
{% else %}
{% if slot.content_override.raw %}
{{ slot.content_override.rendered|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
{% endif %}
</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} </thead>
</table> <tbody>
{% for row in timetable %}
<tr>
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{% if slot.kind.label == "talk" or slot.kind.label == "tutorial" %}
{% if not slot.content %}
{% else %}
<span class="title">
<a href="{% url schedule_presentation_detail slot.content.pk %}">{{ slot.content.title }}</a>
</span>
<span class="speaker">
{{ slot.content.speakers|join:", " }}
</span>
{% endif %}
{% else %}
{% if slot.content_override.raw %}
{{ slot.content_override.rendered|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
{% endif %}
</td>
{% endfor %}
{% if forloop.last %}
<td colspan="{{ timetable.rooms|length }}"></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>

View file

@ -0,0 +1,52 @@
table.calendar {
background-color: #fffff;
table-layout: fixed;
font-size: 12px;
tr {
min-height: 36px;
}
th {
text-align: center;
&.time {
width: 40px;
}
}
td {
text-align: center;
vertical-align: middle;
&.time {
vertical-align: top;
padding-top: 0;
margin-top: 0;
color: #444;
font-size: 11px;
}
&.slot {
font-weight: bold;
text-shadow: #fff 0px 1px 0px;
// Customize for slot types per site
&.slot-break { background-color: #ECFFFF; }
&.slot-plenary { background-color: lighten(#DCDCFF, 3%); }
p {
padding: 0;
margin: 0;
}
}
span.title {
font-weight: bold;
display: block;
}
span.speaker {
font-weight: normal;
display:block;
}
}
}