forked from pybay/pybay_old
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Show the schedule * add a fixture for schedule slots
- Loading branch information
Showing
9 changed files
with
382 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
{% extends 'frontend/base.html' %} | ||
{% load static %} | ||
{% load thumbnail %} | ||
{% load value_from_list_or_default %} | ||
|
||
{% block content %} | ||
<section class="code_of_conduct"> | ||
<div class="container schedule-page"> | ||
<div class="row"> | ||
<div> | ||
<div class="blue-header"> | ||
<h1><strong>Schedule</strong></h1> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% for schedule_days in schedules %} | ||
<div class="sch-schedule"> | ||
<div class="sch-filters"> | ||
<span>Filter:</span> | ||
<ul class="sch-filter-list"> | ||
<li data-filter="">All Talks</li> | ||
{% for filter, name in filters %} | ||
<li data-filter="{{ filter }}">{{ name }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
|
||
{% for day, slot_groups in schedule_days %} | ||
<div class="sch-day"> | ||
<h2 class="sch-day-title">{{ day.date }}</h2> | ||
<div class="sch-timeslots"> | ||
{% for time, slots, kind in slot_groups %} | ||
<div class="sch-timeslot {% if kind %}sch-timeslot-special sch-timeslot-special-{{ kind }}{% endif %}"> | ||
<h3 class="sch-timeslot-time">{{ time }}</h3> | ||
<div class="sch-timeslot-slots"> | ||
{% for slot in slots %} | ||
{% if slot.content_override %} | ||
<div class="sch-timeslot-slot sch-timeslot-kind-{{ slot.kind.label }} sch-timeslot-custom"> | ||
{{ slot.content_override }} | ||
</div> | ||
{% elif slot.content_ptr %} | ||
{% with talk=slot.content_ptr %} | ||
<div class="sch-timeslot-slot sch-timeslot-kind-{{ slot.kind.label }} sch-talk-level-{{ talk.proposal.audience_level }} sch-talk-{% value_from_list_or_default talk.proposal.category|cut:" " allowed_categories "other" %}"> | ||
{% if talk.speaker.photo %}<p class="sch-speaker-photo"><img src="{% thumbnail talk.speaker.photo '50x50' %}" alt="{{ talk.speaker.name }}" /></p>{% endif %} | ||
<h4>{{ talk.title }}</h4> | ||
<p class="sch-speaker">{{ talk.speaker.name }}</p> | ||
{% if talk.speaker.photo %}<p class="sch-speaker-photo"><img src="{% thumbnail talk.speaker.photo '50x50' %}" alt="{{ talk.speaker.name }}" /></p>{% endif %} | ||
<p class="sch-description">{{ talk.description }}</p> | ||
<p class="sch-room">{{ slot.rooms|join:', ' }}</p> | ||
<p class="sch-duration">{{ slot.length_in_minutes }} mins</p> | ||
</div> | ||
{% endwith %} | ||
{% else %} | ||
<div class="sch-timeslot-slot sch-timeslot-kind-{{ slot.kind.label }}"> | ||
<p>{{ slot.kind.label.title }}</p> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
{% endfor %} | ||
</div><!--container --> | ||
</section> | ||
{% endblock content %} | ||
|
||
{% block scripts %} | ||
<script src="{% static 'new/js/schedule-filters.js' %}" async></script> | ||
<style type="text/css"> | ||
{% for slug, _ in filters %} | ||
.sch-schedule-filter-{{ slug }} .sch-filter-list > li[data-filter="{{ slug }}"]{% if not forloop.last %},{% endif %}{% endfor %} { | ||
background: #428bca; | ||
color: white; | ||
} | ||
|
||
{% for slug, _ in filters %} | ||
.sch-schedule-filter-{{ slug }} .sch-timeslot-kind-talk:not(.sch-talk-{{ slug }}){% if not forloop.last %},{% endif %} {% endfor %}{ | ||
opacity: .3; | ||
} | ||
|
||
@media(max-width: 450px) { | ||
{% for slug, _ in filters %} | ||
.sch-schedule-filter-{{ slug }} .sch-timeslot-kind-talk:not(.sch-talk-{{ slug }}){% if not forloop.last %},{% endif %} {% endfor %} { | ||
display: none; | ||
} | ||
} | ||
|
||
</style> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.