diff --git a/fixtures/schedule_slots.json b/fixtures/schedule_slots.json new file mode 100644 index 00000000..a1074326 --- /dev/null +++ b/fixtures/schedule_slots.json @@ -0,0 +1 @@ +[{"model": "symposion_schedule.schedule", "pk": 1, "fields": {"section": 2, "published": true, "hidden": false}}, {"model": "symposion_schedule.day", "pk": 1, "fields": {"schedule": 1, "date": "2017-08-11"}}, {"model": "symposion_schedule.day", "pk": 2, "fields": {"schedule": 1, "date": "2017-08-13"}}, {"model": "symposion_schedule.day", "pk": 3, "fields": {"schedule": 1, "date": "2017-08-12"}}, {"model": "symposion_schedule.room", "pk": 1, "fields": {"schedule": 1, "name": "Robertson", "order": 1}}, {"model": "symposion_schedule.room", "pk": 2, "fields": {"schedule": 1, "name": "Robertson 2", "order": 2}}, {"model": "symposion_schedule.room", "pk": 3, "fields": {"schedule": 1, "name": "Fisher East", "order": 3}}, {"model": "symposion_schedule.room", "pk": 4, "fields": {"schedule": 1, "name": "Fisher West", "order": 4}}, {"model": "symposion_schedule.slotkind", "pk": 1, "fields": {"schedule": 1, "label": "lunch"}}, {"model": "symposion_schedule.slotkind", "pk": 2, "fields": {"schedule": 1, "label": "talk"}}, {"model": "symposion_schedule.slotkind", "pk": 3, "fields": {"schedule": 1, "label": "expo"}}, {"model": "symposion_schedule.slotkind", "pk": 4, "fields": {"schedule": 1, "label": "sponsored"}}, {"model": "symposion_schedule.slotkind", "pk": 5, "fields": {"schedule": 1, "label": "reception"}}, {"model": "symposion_schedule.slotkind", "pk": 6, "fields": {"schedule": 1, "label": "lightning"}}, {"model": "symposion_schedule.slotkind", "pk": 7, "fields": {"schedule": 1, "label": "keynote"}}, {"model": "symposion_schedule.slot", "pk": 1, "fields": {"name": "2017-08-12 lunch (12:00:00 - 13:00:00) ", "day": 3, "kind": 1, "start": "12:00:00", "end": "13:00:00", "content_override": "lunch will be served outside", "content_override_html": "

lunch will be served outside

"}}, {"model": "symposion_schedule.slot", "pk": 2, "fields": {"name": "2017-08-12 talk (11:00:00 - 12:00:00) Fisher East", "day": 3, "kind": 2, "start": "11:00:00", "end": "12:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 4, "fields": {"name": "2017-08-12 talk (13:00:00 - 13:45:00) Robertson", "day": 3, "kind": 2, "start": "13:00:00", "end": "13:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 5, "fields": {"name": "2017-08-12 talk (13:00:00 - 13:45:00) Robertson 2", "day": 3, "kind": 2, "start": "13:00:00", "end": "13:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 6, "fields": {"name": "2017-08-12 talk (13:00:00 - 13:45:00) Fisher East", "day": 3, "kind": 2, "start": "13:00:00", "end": "13:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 7, "fields": {"name": "2017-08-12 talk (13:00:00 - 13:45:00) Fisher West", "day": 3, "kind": 2, "start": "13:00:00", "end": "13:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 8, "fields": {"name": "2017-08-12 talk (11:00:00 - 12:00:00) Fisher West", "day": 3, "kind": 2, "start": "11:00:00", "end": "12:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 9, "fields": {"name": "2017-08-12 talk (14:00:00 - 15:00:00) Robertson", "day": 3, "kind": 2, "start": "14:00:00", "end": "15:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 10, "fields": {"name": "2017-08-12 talk (14:00:00 - 15:00:00) Robertson 2", "day": 3, "kind": 2, "start": "14:00:00", "end": "15:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 11, "fields": {"name": "2017-08-12 talk (14:00:00 - 15:00:00) Fisher East", "day": 3, "kind": 2, "start": "14:00:00", "end": "15:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 12, "fields": {"name": "2017-08-12 talk (14:00:00 - 15:00:00) Fisher West", "day": 3, "kind": 2, "start": "14:00:00", "end": "15:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 13, "fields": {"name": "2017-08-12 talk (15:15:00 - 16:15:00) Robertson", "day": 3, "kind": 2, "start": "15:15:00", "end": "16:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 14, "fields": {"name": "2017-08-12 talk (15:15:00 - 16:15:00) Robertson 2", "day": 3, "kind": 2, "start": "15:15:00", "end": "16:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 15, "fields": {"name": "2017-08-12 talk (15:15:00 - 16:15:00) Fisher East", "day": 3, "kind": 2, "start": "15:15:00", "end": "16:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 16, "fields": {"name": "2017-08-12 talk (15:15:00 - 16:15:00) Fisher West", "day": 3, "kind": 2, "start": "15:15:00", "end": "16:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 17, "fields": {"name": "2017-08-12 talk (16:30:00 - 17:30:00) Robertson", "day": 3, "kind": 2, "start": "16:30:00", "end": "17:30:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 18, "fields": {"name": "2017-08-12 talk (16:30:00 - 17:30:00) Robertson 2", "day": 3, "kind": 2, "start": "16:30:00", "end": "17:30:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 19, "fields": {"name": "2017-08-12 talk (16:30:00 - 17:30:00) Fisher East", "day": 3, "kind": 2, "start": "16:30:00", "end": "17:30:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 20, "fields": {"name": "2017-08-12 talk (16:30:00 - 17:30:00) Fisher West", "day": 3, "kind": 2, "start": "16:30:00", "end": "17:30:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 21, "fields": {"name": "2017-08-12 expo (17:00:00 - 20:00:00) ", "day": 3, "kind": 3, "start": "17:00:00", "end": "20:00:00", "content_override": "Job Fair / tools expo in the Atrium", "content_override_html": "

Job Fair / tools expo in the Atrium

"}}, {"model": "symposion_schedule.slot", "pk": 22, "fields": {"name": "2017-08-12 sponsored (19:30:00 - 20:30:00) Fisher East", "day": 3, "kind": 4, "start": "19:30:00", "end": "20:30:00", "content_override": "Sponsored Program TBD", "content_override_html": "

Sponsored Program TBD

"}}, {"model": "symposion_schedule.slot", "pk": 23, "fields": {"name": "2017-08-12 sponsored (19:30:00 - 20:30:00) Fisher West", "day": 3, "kind": 4, "start": "19:30:00", "end": "20:30:00", "content_override": "Sponsored Program TBD", "content_override_html": "

Sponsored Program TBD

"}}, {"model": "symposion_schedule.slot", "pk": 24, "fields": {"name": "2017-08-13 reception (09:30:00 - 10:00:00) ", "day": 2, "kind": 5, "start": "09:30:00", "end": "10:00:00", "content_override": "Breakfast at Atrium", "content_override_html": "

Breakfast at Atrium

"}}, {"model": "symposion_schedule.slot", "pk": 25, "fields": {"name": "2017-08-13 talk (10:00:00 - 11:00:00) Robertson", "day": 2, "kind": 2, "start": "10:00:00", "end": "11:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 26, "fields": {"name": "2017-08-13 talk (10:00:00 - 11:00:00) Robertson 2", "day": 2, "kind": 2, "start": "10:00:00", "end": "11:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 27, "fields": {"name": "2017-08-13 talk (10:00:00 - 11:00:00) Fisher West", "day": 2, "kind": 2, "start": "10:00:00", "end": "11:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 28, "fields": {"name": "2017-08-13 talk (10:00:00 - 11:00:00) Fisher East", "day": 2, "kind": 2, "start": "10:00:00", "end": "11:00:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 29, "fields": {"name": "2017-08-13 talk (11:15:00 - 12:15:00) Robertson", "day": 2, "kind": 2, "start": "11:15:00", "end": "12:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 30, "fields": {"name": "2017-08-13 talk (11:15:00 - 12:15:00) Robertson 2", "day": 2, "kind": 2, "start": "11:15:00", "end": "12:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 31, "fields": {"name": "2017-08-13 talk (11:15:00 - 12:15:00) Fisher East", "day": 2, "kind": 2, "start": "11:15:00", "end": "12:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 32, "fields": {"name": "2017-08-13 talk (11:15:00 - 12:15:00) Fisher West", "day": 2, "kind": 2, "start": "11:15:00", "end": "12:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 33, "fields": {"name": "2017-08-13 lunch (12:00:00 - 13:30:00) ", "day": 2, "kind": 1, "start": "12:00:00", "end": "13:30:00", "content_override": "Lunch served outside", "content_override_html": "

Lunch served outside

"}}, {"model": "symposion_schedule.slot", "pk": 34, "fields": {"name": "2017-08-13 talk (13:15:00 - 14:15:00) Robertson", "day": 2, "kind": 2, "start": "13:15:00", "end": "14:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 35, "fields": {"name": "2017-08-13 talk (13:15:00 - 14:15:00) Robertson 2", "day": 2, "kind": 2, "start": "13:15:00", "end": "14:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 36, "fields": {"name": "2017-08-13 talk (13:15:00 - 14:15:00) Fisher East", "day": 2, "kind": 2, "start": "13:15:00", "end": "14:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 37, "fields": {"name": "2017-08-13 talk (13:15:00 - 14:15:00) Fisher West", "day": 2, "kind": 2, "start": "13:15:00", "end": "14:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 38, "fields": {"name": "2017-08-13 talk (14:30:00 - 15:15:00) Robertson 2", "day": 2, "kind": 2, "start": "14:30:00", "end": "15:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 39, "fields": {"name": "2017-08-13 talk (14:30:00 - 15:15:00) Robertson", "day": 2, "kind": 2, "start": "14:30:00", "end": "15:15:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 40, "fields": {"name": "2017-08-13 talk (15:45:00 - 16:45:00) Robertson", "day": 2, "kind": 2, "start": "15:45:00", "end": "16:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 41, "fields": {"name": "2017-08-13 talk (14:30:00 - 15:30:00) Fisher East", "day": 2, "kind": 2, "start": "14:30:00", "end": "15:30:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 42, "fields": {"name": "2017-08-13 talk (14:30:00 - 15:30:00) Fisher West", "day": 2, "kind": 2, "start": "14:30:00", "end": "15:30:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 43, "fields": {"name": "2017-08-13 talk (15:45:00 - 16:45:00) Robertson 2", "day": 2, "kind": 2, "start": "15:45:00", "end": "16:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 44, "fields": {"name": "2017-08-13 talk (15:45:00 - 16:45:00) Fisher East", "day": 2, "kind": 2, "start": "15:45:00", "end": "16:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 45, "fields": {"name": "2017-08-13 talk (15:45:00 - 16:45:00) Fisher West", "day": 2, "kind": 2, "start": "15:45:00", "end": "16:45:00", "content_override": "", "content_override_html": ""}}, {"model": "symposion_schedule.slot", "pk": 46, "fields": {"name": "2017-08-13 lightning (17:00:00 - 18:00:00) Robertson", "day": 2, "kind": 6, "start": "17:00:00", "end": "18:00:00", "content_override": "Nothing else happening at Lightning Talks", "content_override_html": "

Nothing else happening at Lightning Talks

"}}, {"model": "symposion_schedule.slot", "pk": 47, "fields": {"name": "2017-08-13 keynote (18:00:00 - 18:15:00) Robertson", "day": 2, "kind": 7, "start": "18:00:00", "end": "18:15:00", "content_override": "This is actually closing and raffle", "content_override_html": "

This is actually closing and raffle

"}}, {"model": "symposion_schedule.slot", "pk": 48, "fields": {"name": "2017-08-12 keynote (09:30:00 - 10:45:00) Robertson", "day": 3, "kind": 7, "start": "09:30:00", "end": "10:45:00", "content_override": "Opening + Keynote", "content_override_html": "

Opening + Keynote

"}}, {"model": "symposion_schedule.slot", "pk": 49, "fields": {"name": "2017-08-12 reception (08:30:00 - 09:30:00) ", "day": 3, "kind": 5, "start": "08:30:00", "end": "09:30:00", "content_override": "Registration and breakfast", "content_override_html": "

Registration and breakfast

"}}, {"model": "symposion_schedule.slot", "pk": 50, "fields": {"name": "2017-08-11 keynote (19:00:00 - 19:30:00) ", "day": 1, "kind": 7, "start": "19:00:00", "end": "19:30:00", "content_override": "Location TBD", "content_override_html": "

Location TBD

"}}, {"model": "symposion_schedule.slot", "pk": 51, "fields": {"name": "2017-08-11 lightning (19:30:00 - 20:30:00) ", "day": 1, "kind": 6, "start": "19:30:00", "end": "20:30:00", "content_override": "Location TBD", "content_override_html": "

Location TBD

"}}, {"model": "symposion_schedule.slot", "pk": 52, "fields": {"name": "2017-08-11 reception (17:30:00 - 19:00:00) ", "day": 1, "kind": 5, "start": "17:30:00", "end": "19:00:00", "content_override": "Location TBD Registration starts at 5:30p", "content_override_html": "

Location TBD Registration starts at 5:30p

"}}, {"model": "symposion_schedule.slot", "pk": 53, "fields": {"name": "2017-08-11 reception (20:30:00 - 21:30:00) ", "day": 1, "kind": 5, "start": "20:30:00", "end": "21:30:00", "content_override": "Location TBD Closing and more networking", "content_override_html": "

Location TBD Closing and more networking

"}}, {"model": "symposion_schedule.slotroom", "pk": 1, "fields": {"slot": 2, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 3, "fields": {"slot": 4, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 4, "fields": {"slot": 5, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 5, "fields": {"slot": 6, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 6, "fields": {"slot": 7, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 7, "fields": {"slot": 8, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 8, "fields": {"slot": 9, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 9, "fields": {"slot": 10, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 10, "fields": {"slot": 11, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 11, "fields": {"slot": 12, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 12, "fields": {"slot": 13, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 13, "fields": {"slot": 14, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 14, "fields": {"slot": 15, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 15, "fields": {"slot": 16, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 16, "fields": {"slot": 17, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 17, "fields": {"slot": 18, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 18, "fields": {"slot": 19, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 19, "fields": {"slot": 20, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 20, "fields": {"slot": 22, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 21, "fields": {"slot": 23, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 22, "fields": {"slot": 25, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 23, "fields": {"slot": 26, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 24, "fields": {"slot": 27, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 25, "fields": {"slot": 28, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 26, "fields": {"slot": 29, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 27, "fields": {"slot": 30, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 28, "fields": {"slot": 31, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 29, "fields": {"slot": 32, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 30, "fields": {"slot": 34, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 31, "fields": {"slot": 35, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 32, "fields": {"slot": 36, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 33, "fields": {"slot": 37, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 34, "fields": {"slot": 38, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 35, "fields": {"slot": 39, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 36, "fields": {"slot": 40, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 37, "fields": {"slot": 41, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 38, "fields": {"slot": 42, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 39, "fields": {"slot": 43, "room": 2}}, {"model": "symposion_schedule.slotroom", "pk": 40, "fields": {"slot": 44, "room": 3}}, {"model": "symposion_schedule.slotroom", "pk": 41, "fields": {"slot": 45, "room": 4}}, {"model": "symposion_schedule.slotroom", "pk": 42, "fields": {"slot": 46, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 43, "fields": {"slot": 47, "room": 1}}, {"model": "symposion_schedule.slotroom", "pk": 44, "fields": {"slot": 48, "room": 1}}] \ No newline at end of file diff --git a/pybay/templates/frontend/schedule.html b/pybay/templates/frontend/schedule.html new file mode 100644 index 00000000..75c23f03 --- /dev/null +++ b/pybay/templates/frontend/schedule.html @@ -0,0 +1,96 @@ + +{% extends 'frontend/base.html' %} +{% load static %} +{% load thumbnail %} +{% load value_from_list_or_default %} + +{% block content %} +
+
+
+
+
+

Schedule

+
+
+
+ + {% for schedule_days in schedules %} +
+
+ Filter: +
    +
  • All Talks
  • + {% for filter, name in filters %} +
  • {{ name }}
  • + {% endfor %} +
+
+ + {% for day, slot_groups in schedule_days %} +
+

{{ day.date }}

+
+ {% for time, slots, kind in slot_groups %} +
+

{{ time }}

+
+ {% for slot in slots %} + {% if slot.content_override %} +
+ {{ slot.content_override }} +
+ {% elif slot.content_ptr %} + {% with talk=slot.content_ptr %} +
+ {% if talk.speaker.photo %}

{{ talk.speaker.name }}

{% endif %} +

{{ talk.title }}

+

{{ talk.speaker.name }}

+ {% if talk.speaker.photo %}

{{ talk.speaker.name }}

{% endif %} +

{{ talk.description }}

+

{{ slot.rooms|join:', ' }}

+

{{ slot.length_in_minutes }} mins

+
+ {% endwith %} + {% else %} +
+

{{ slot.kind.label.title }}

+
+ {% endif %} + {% endfor %} +
+
+ {% endfor %} +
+
+ {% endfor %} +
+ + {% endfor %} +
+
+{% endblock content %} + +{% block scripts %} + + +{% endblock %} diff --git a/pybay/templates/symposion/schedule/schedule_conference.html b/pybay/templates/symposion/schedule/schedule_conference.html index 37a9ab17..777a001d 100644 --- a/pybay/templates/symposion/schedule/schedule_conference.html +++ b/pybay/templates/symposion/schedule/schedule_conference.html @@ -22,7 +22,7 @@

Conference Schedule

{% cache 600 "schedule-table" section.schedule.section %} {% for timetable in section.days %}

{{ section.schedule.section.name }} — {{ timetable.day.date }}

- {% include "schedule/_grid.html" %} + {% include "symposion/schedule/_grid.html" %} {% endfor %} {% endcache %} {% endfor %} diff --git a/pybay/templatetags/value_from_list_or_default.py b/pybay/templatetags/value_from_list_or_default.py new file mode 100644 index 00000000..ee78f078 --- /dev/null +++ b/pybay/templatetags/value_from_list_or_default.py @@ -0,0 +1,9 @@ +from django.template import Library + + +register = Library() + + +@register.simple_tag +def value_from_list_or_default(val, allowed_values, default): + return val if val in allowed_values else default diff --git a/pybay/urls.py b/pybay/urls.py index f06a7e3b..68b3fabc 100644 --- a/pybay/urls.py +++ b/pybay/urls.py @@ -42,7 +42,8 @@ url(r"^reviews/", include("symposion.reviews.urls")), url(r"^boxes/", include("pinax.boxes.urls")), - # url(r"^schedule/", include("symposion.schedule.urls")), + url(r"^schedule/", views.pybay_schedule), + url(r"^schedule-sym/", include("symposion.schedule.urls")), # url(r"^account/signup/$", SignupView.as_view(), name="account_signup"), # url(r"^account/login/$", symposion.views.LoginView.as_view(), name="account_login"), # url(r"^teams/", include(teams_urls)), diff --git a/pybay/views.py b/pybay/views.py index cbc5c17d..8b27026b 100644 --- a/pybay/views.py +++ b/pybay/views.py @@ -1,9 +1,11 @@ import json +import itertools from django.shortcuts import render from django.http import (HttpResponse, HttpResponseForbidden, HttpResponseNotFound) from django.views.generic import TemplateView +from django.db.models import Prefetch from .forms import CallForProposalForm from pybay.faqs.models import Faq, Category @@ -11,6 +13,7 @@ from pybay.proposals.models import TalkProposal, Proposal from pybay.utils import get_accepted_speaker_by_slug from symposion.speakers.models import Speaker +from symposion.schedule.models import Schedule from collections import defaultdict from django.conf import settings @@ -158,3 +161,46 @@ def proposal_detail(request, proposal_id): return HttpResponse( json.dumps({'data': result}), content_type="application/json" ) + + +def _day_slots(day): + groupby = itertools.groupby(day.slot_set.all(), lambda slot: slot.start) + for time, grouper in groupby: + slots = list(grouper) + kind = slots[0].kind if len(slots) == 1 and slots[0].content_override else '' + yield time, slots, kind + + +FILTER_CATEGORIES = [ + "All things Web", + "DevOps", +] + + +def pybay_schedule(request): + if request.user.is_staff: + schedules = Schedule.objects.filter(hidden=False) + else: + schedules = Schedule.objects.filter(published=True, hidden=False) + + schedules.prefetch_related( + Prefetch('day_set__slot_set__presentation_set__proposal_base'), + ) + + schedules = [ + [(day, _day_slots(day)) for day in schedule.day_set.all()] + for schedule in schedules + ] + + filters = [ + (name.lower().replace(' ', ''), name) + for name in FILTER_CATEGORIES + ] + + ctx = { + 'schedules': schedules, + 'filters' : filters + [('other', 'Other'), ('level-1', 'Beginner-friendly')], + 'allowed_categories': [slug for slug, _ in filters] + } + + return render(request, "frontend/schedule.html", ctx) diff --git a/static/new/css/style.css b/static/new/css/style.css index cdee1914..f1b221d1 100644 --- a/static/new/css/style.css +++ b/static/new/css/style.css @@ -85,6 +85,29 @@ p.question { color: #32648e; } +/* Schedule */ + +.sch-schedule:not(.sch-schedule-filtered) .sch-filter-list > li[data-filter=""] { + background: #428bca; + color: white; +} + +.sch-day-title { + font-weight: bold; + margin: 22px 0 0 0; + padding: 8px 0; +} + +.sch-timeslot-time { + margin: 8px 0 0 0; + padding: 5px 0 5px 2px; +} + +.sch-timeslot-slots { + display: flex; + flex-wrap: wrap; +} + /* Sponsor list */ .gold-sponsors .sponsor-list { /*background: hsl(0, 50%, 50%); @@ -151,6 +174,190 @@ p.question { } } +.sch-filters span { + font-size: 16px; +} + +.sch-filter-list { + display: inline-block; + margin-left: 10px; +} + +.sch-filter-list > li { + display: inline-block; + padding: 10px 15px 11px 15px; + margin: 0 5px 5px 0; + line-height: 1; + border: 3px solid #428bca; + border-radius: 25px; + color: #428bca; + cursor: pointer; + font-weight: 600; + transition: all 0.3s ease-out; +} + +.sch-timeslot-slot { + flex: 1 0 20%; + margin: 0 5px 10px 5px; + padding: 16px 20px; + border: 2px solid hsl(0, 0%, 95%); + border-radius: 4px; + text-align: center; +} + +.sch-timeslot-kind-keynote, +.sch-timeslot-kind-reception, +.sch-timeslot-kind-lunch, +.sch-timeslot-kind-lightning, +.sch-timeslot-kind-expo +{ + font-weight: bold; + border: 0; + background: hsl(50, 100%, 80%); + border-radius: 6px; +} + +@media(max-width: 991px) { + .sch-timeslot-slot { + flex-basis: 45%; + } +} + +.sch-timeslot-kind-talk { + display: flex; + flex-flow: row wrap; + align-content: flex-start; + position: relative; + padding-top: 4px; + padding-bottom: 4px; + text-align: left; +} + +.sch-timeslot-kind-talk > * { + flex-basis: 100%; +} + +.sch-room, .sch-duration { + flex: 1 0 auto; + white-space: nowrap; + font-size: 11px; + font-weight: bold; +} + +.sch-room { + order: -100; + text-align: right; +} + +.sch-duration { + order: -90; +} + +.sch-duration::before { + content: '\2022'; + margin: 0 .5em; +} + +.sch-timeslot-kind-talk > h4 { + font-weight: bold; +} + +.sch-speaker { + font-weight: bold; + margin-top: 4px; +} + +.sch-speaker-photo { + width: 40px; + height: 40px; + overflow: hidden; + position: absolute; + top: 42px; + right: 15px; + border-radius: 50%; +} +.sch-speaker-photo img { + height: 100%; +} + +.sch-speaker-photo + h4, +.sch-speaker-photo + h4 + .sch-speaker { + padding-right: 50px; +} + +@media(max-width: 450px) { + .schedule-page.container { + padding-left: 0; + padding-right: 0; + } + + .sch-filters > span { + display: block; + margin-left: 10px; + } + + .sch-timeslot-time { + background: hsl(0, 0%, 95%); + padding: 8px 10px; + text-align: center; + } + + .sch-timeslot-slots { + display: block; + } + + .sch-timeslot-slot { + border: 0; + padding: 15px 10px; + margin: 0; + } + .sch-timeslot-slot:not(:first-child) { + border-top: 1px solid hsl(0, 0%, 95%); + border-radius: 0; + } + + .sch-timeslot-kind-talk { + margin: 0; + } + + .sch-timeslot-kind-talk > h4 { + order: -120; + flex: 1 1; + } + + .sch-duration, .sch-room { + flex: 0 1; + margin: 0; + line-height: 1; + } + + .sch-speaker-photo { + left: 10px; + top: 15px; + } + + .sch-speaker-photo + h4, + .sch-speaker-photo + h4 + .sch-speaker { + padding: 0 0 0 46px; + } + + .sch-timeslot-kind-keynote, + .sch-timeslot-kind-reception, + .sch-timeslot-kind-lunch, + .sch-timeslot-kind-lightning, + .sch-timeslot-kind-expo { + margin: 0 0; + border-radius: 0; + } + + .sch-timeslot-special .sch-timeslot-kind-keynote, + .sch-timeslot-special .sch-timeslot-kind-reception, + .sch-timeslot-special .sch-timeslot-kind-lunch, + .sch-timeslot-special .sch-timeslot-kind-lightning, + .sch-timeslot-special .sch-timeslot-kind-expo { + margin-bottom: 30px; + } +} /* SPONSOR PAGE PRICING TABLE */ diff --git a/static/new/js/schedule-filters.js b/static/new/js/schedule-filters.js new file mode 100644 index 00000000..c73fa210 --- /dev/null +++ b/static/new/js/schedule-filters.js @@ -0,0 +1,17 @@ +!function($) { + var parentClass = 'sch-schedule'; + var filterEnabledClass = 'sch-schedule-filtered'; + var prefix = 'sch-schedule-filter-'; + $('.sch-filter-list').click(function(e) { + var target = $(e.target); + var filter = target.closest('li').data('filter'); + if (filter === undefined) return; + var schedule = target.closest('.' + parentClass); + var alreadySelected = filter === '' || schedule.hasClass(prefix + filter); + schedule.removeClass(function(i, cls) { return cls; }); + schedule.addClass(parentClass); + if (!alreadySelected) { + schedule.addClass(filterEnabledClass + ' ' + prefix + filter); + } + }); +}(jQuery); diff --git a/static/new/js/scripts.js b/static/new/js/scripts.js index 956f0242..cfb39db6 100644 --- a/static/new/js/scripts.js +++ b/static/new/js/scripts.js @@ -355,6 +355,9 @@ $(window).load(function() { //Call For Propositions Form $(document).ready(function() { + if(!$('#contact_form').bootstrapValidator) { + return; + } $('#contact_form').bootstrapValidator({ // To use feedback icons, ensure that you use Bootstrap v3.1.0 or later feedbackIcons: {