Adds mobile-friendly schedule view and paged schedule view (#81)

* Adds responsive mobile CSS for schedule timetable

* Adds by-day schedule view

* Displays content_override in schedule

* Adds twitter/homepage links for speakers.
This commit is contained in:
Christopher Neugebauer 2016-12-10 17:11:40 +11:00 committed by Scott Bragg
parent 9a21d2c781
commit fa9bb1a9f9
4 changed files with 125 additions and 41 deletions

View file

@ -10,7 +10,7 @@
<tbody> <tbody>
{% for row in timetable %} {% for row in timetable %}
<tr> <tr>
<td class="time">{{ row.time|date:"h:iA" }}</td> <td class="time"><h4>{{ row.time|date:"h:iA" }}</h4></td>
{% for slot in row.slots %} {% for slot in row.slots %}
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}"> <td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{% if slot.kind.label == "talk" or slot.kind.label == "tutorial" %} {% if slot.kind.label == "talk" or slot.kind.label == "tutorial" %}
@ -22,11 +22,14 @@
<span class="speaker"> <span class="speaker">
{{ slot.content.speakers|join:", " }} {{ slot.content.speakers|join:", " }}
</span> </span>
<span class="room">
{{ slot.rooms|join:", "}}
</span>
{% endif %} {% endif %}
{% elif slot.kind.label == "shortbreak" %} {% elif slot.kind.label == "shortbreak" %}
{% else %} {% else %}
{% if slot.content_override.raw %} {% if slot.content_override %}
{{ slot.content_override.rendered|safe }} {{ slot.content_override_html|safe }}
{% else %} {% else %}
{{ slot.kind.label }} {{ slot.kind.label }}
{% endif %} {% endif %}

View file

@ -49,6 +49,24 @@
{% include "lca2017/_right_floating_image.html" with image_url=speaker_photo_url %} {% include "lca2017/_right_floating_image.html" with image_url=speaker_photo_url %}
<h3><a href="{% url "speaker_profile" speaker.pk %}">{{ speaker }}</a></h3> <h3><a href="{% url "speaker_profile" speaker.pk %}">{{ speaker }}</a></h3>
{% if speaker.homepage or speaker.twitter_username %}
<p><div class="btn-group">
{% if speaker.homepage %}
<a href="{{ speaker.homepage}}" class="btn-svg" title="Homepage">
{% include "cms_pages/home_page_blocks/btn_generic_link.html" %}
</a>
{% endif %}
{% if speaker.twitter_username %}
<a href="https://twitter.com/{{ speaker.twitter_username }}" class="btn-svg" title="{{ speaker}} on twitter">
{% include "cms_pages/home_page_blocks/btn_twitter.html" %}
</a>
{% endif %}
</div></p>
{% endif %}
{{ speaker.biography_html|safe}} {{ speaker.biography_html|safe}}
{% endfor %} {% endfor %}

View file

@ -15,19 +15,36 @@
{% block right %} {% block right %}
{% endblock %} {% endblock %}
{% block content %} {% block content_base %}
<div class="page-head"> <div class="page-head">
{% block breadcrumbs %}{% endblock %} {% block breadcrumbs %}{% endblock %}
</div> </div>
{% for section in sections %} <div class="panel panel__compact">
{% cache 600 "schedule-table" section.schedule.section %} <div class="panel--content">
{% for timetable in section.days %}
<h3>{{ section.schedule.section.name }} — {{ timetable.day.date|date:"l" }}, {{ timetable.day.date }}</h3>
{% include "symposion/schedule/_grid.html" %}
{% endfor %}
{% endcache %}
{% endfor %}
<div class="panel--tab-controls">
<div class="panel--tabs">
{% for section in sections %}
{% for timetable in section.days %}
<a data-tab-control="{{ timetable.day.date|date:"l"}}" class="panel--tab-switch {% if forloop.is_first and forloop.parentloop.is_first %}is-active{% endif %}">{{ timetable.day.date|date:"l"}}</a>
{% endfor %}
{% endfor %}
</div>
</div>
{% for section in sections %}
{% cache 600 "schedule-table" section.schedule.section %}
{% for timetable in section.days %}
<div data-tab-content="{{ timetable.day.date|date:"l"}}" class="panel--tab-content is-active">
<h3>{{ section.schedule.section.name }} — {{ timetable.day.date|date:"l" }}, {{ timetable.day.date }}</h3>
{% include "symposion/schedule/_grid.html" %}
</div>
{% endfor %}
{% endcache %}
{% endfor %}
</div>
</div>
{% endblock %} {% endblock %}

View file

@ -1607,43 +1607,89 @@ table.alt tr:not(:last-of-type) {
margin-top: 2em; margin-top: 2em;
} }
/* Schedule timetable for mobile */
@media only screen and (max-width: 480px) {
.calendar {
line-height: 1.0;
}
.calendar thead {
display: none;
}
.calendar tr,
.calendar td
{
display: block;
padding: 0.5ex;
}
.calendar td,
.calendar td:not(:first-of-type) {
border: 0px;
}
.calendar .slot .title,
.calendar .slot .speaker,
.calendar .slot .room
{
display: block;
line-height: 1.2;
}
.calendar .slot .room
{
font-style: italic;
}
}
/* Schedule timetable needs some more specific font sizes */ /* Schedule timetable needs some more specific font sizes */
.calendar td { @media not screen and (max-width: 480px) {
font-size: 0.9vw;
}
.slot { .calendar td {
padding-left: 0.625rem; font-size: 0.9vw;
padding-top: 0.2rem; }
padding-bottom: 0.625rem;
padding-right: 0.625rem;
vertical-align: middle;
}
.calendar th { .slot {
border-bottom: 1px solid #0c486c; padding-left: 0.625rem;
border-left: 0px !important; padding-top: 0.2rem;
} padding-bottom: 0.625rem;
padding-right: 0.625rem;
vertical-align: middle;
}
.calendar .title { .calendar th {
display: block; border-bottom: 1px solid #0c486c;
padding-bottom: 0.5vh; border-left: 0px !important;
} }
.slot-shortbreak { .calendar .title {
color: #fff ; display: block;
} padding-bottom: 0.5vh;
}
.slot-tutorial { .slot-shortbreak {
vertical-align: top; color: #fff ;
} }
.time { .slot-tutorial {
font-size: 0.5vw; vertical-align: top;
line-height: 0.4; }
vertical-align: middle;
padding-top: 0.25rem; .time {
font-size: 0.5vw;
line-height: 0.4;
vertical-align: middle;
padding-top: 0.25rem;
}
.calendar .slot .room {
display: none;
}
} }