From aae03d26ba02c2a1cab3283519b788a7a795fede Mon Sep 17 00:00:00 2001 From: Tobias Date: Sat, 6 Oct 2018 13:01:42 +1300 Subject: [PATCH] Add more mobile-friendly schedule --- .../templates/symposion/schedule/_mobile.html | 30 +++++++++++++++++++ .../schedule/schedule_conference.html | 11 +++++-- pinaxcon/templatetags/lca2019_tags.py | 10 ++++++- static/src/scss/app.scss | 21 +++++++++++++ 4 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 pinaxcon/templates/symposion/schedule/_mobile.html diff --git a/pinaxcon/templates/symposion/schedule/_mobile.html b/pinaxcon/templates/symposion/schedule/_mobile.html new file mode 100644 index 00000000..1e2ab647 --- /dev/null +++ b/pinaxcon/templates/symposion/schedule/_mobile.html @@ -0,0 +1,30 @@ +{% load lca2018_tags %} +{% load lca2019_tags %} +{% load waffle_tags %} + + +{% for row in timetable %} +{% if forloop.last %} +{% else %} +{% for slot in row.slots %} +
+ {% if forloop.first %} +

{{ row.time|date:"h:iA" }}

+ {% endif %} + {% with slot.kind.label.lower as label %} + {% if label == "talk" or label == "tutorial" %} + {% if slot.content %} +

{{ slot.content.title }}

+

{{ slot.content.speakers|join:", "}}

+ {% listlookup timetable.rooms forloop.counter0 as value %} +

Theatre {{ value }}
ends {{ slot.end }}

+ {% endif %} + {% else %} +

{{ slot.kind.label }}

+ {% endif %} + {% endwith %} +
+{% endfor %} +{% endif %} +{% endfor %} + diff --git a/pinaxcon/templates/symposion/schedule/schedule_conference.html b/pinaxcon/templates/symposion/schedule/schedule_conference.html index 950cbbd9..8b74918a 100644 --- a/pinaxcon/templates/symposion/schedule/schedule_conference.html +++ b/pinaxcon/templates/symposion/schedule/schedule_conference.html @@ -33,7 +33,7 @@ -
+
{% for section in sections %} @@ -44,11 +44,16 @@ role="tabpanel" aria-labelledby="schedule_day_{{ timetable.day.date|date:"l"|lower}}-tab" > +
{% cache 180 cache-schedule timetable.day.date %} -
{% include "symposion/schedule/_grid.html" %} -
{% endcache %} +
+
+ {% cache 180 cache-schedule-mobile timetable.day.date %} + {% include "symposion/schedule/_mobile.html" %} + {% endcache %} +
{% endfor %} {% endfor %} diff --git a/pinaxcon/templatetags/lca2019_tags.py b/pinaxcon/templatetags/lca2019_tags.py index 46c8a197..10363159 100644 --- a/pinaxcon/templatetags/lca2019_tags.py +++ b/pinaxcon/templatetags/lca2019_tags.py @@ -21,4 +21,12 @@ def any_is_void(invoices): for invoice in invoices: if invoice.is_void: return True - return False \ No newline at end of file + return False + + +@register.simple_tag +def listlookup(lookup, target): + try: + return lookup[target] + except IndexError: + return '' \ No newline at end of file diff --git a/static/src/scss/app.scss b/static/src/scss/app.scss index be18b37e..278efa31 100644 --- a/static/src/scss/app.scss +++ b/static/src/scss/app.scss @@ -607,4 +607,25 @@ hr { text-transform: uppercase; } } +} + + +.schedule-page { + @include media-breakpoint-down(lg) { + .container { + max-width: 100%; + } + } + + @include media-breakpoint-down(md) { + .hidden-md-down { + display: none !important; + } + } + + @include media-breakpoint-up(lg) { + .hidden-md-up { + display: none !important; + } + } } \ No newline at end of file