2017-02-17 16:17:21 +00:00
|
|
|
{% extends 'program_base.html' %}
|
|
|
|
{% load dateutils %}
|
2016-08-08 18:22:53 +00:00
|
|
|
|
2017-02-17 16:17:21 +00:00
|
|
|
{% block program_content %}
|
2017-01-22 11:59:57 +00:00
|
|
|
|
2017-03-17 16:58:29 +00:00
|
|
|
<div class="row">
|
2017-04-13 11:42:14 +00:00
|
|
|
<div class="col-sm-12">
|
2017-03-17 16:58:29 +00:00
|
|
|
<form method="get" id="filter" class="form-inline">
|
|
|
|
<div class="form-group">
|
|
|
|
<select id="day" name="day" class="form-control filter-control">
|
|
|
|
<option value="">All Days</option>
|
|
|
|
{% for day in camp.camp_days %}
|
|
|
|
{% with month_padded=day.lower.date|date:"m" day_padded=day.lower.date|date:"d" %}
|
|
|
|
<option
|
|
|
|
value="{{ day.lower.date|date:"Y-m-d" }}"
|
|
|
|
{% if urlyear and urlyear|add:"0" == day.lower.date.year and urlmonth == month_padded and urlday == day_padded %}
|
|
|
|
selected
|
|
|
|
{% endif %}>
|
|
|
|
{{ day.lower.date|date:"l" }}
|
|
|
|
</option>
|
|
|
|
{% endwith %}
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="event_type" name="event_type" class="form-control filter-control">
|
|
|
|
<option value="">All Types</option>
|
|
|
|
{% for type in camp.event_types %}
|
|
|
|
<option value="{{ type.slug }}"{% if eventtype and eventtype == type %}selected{% endif %}>{{ type.name }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="location" name="location" class="fa-select form-control filter-control">
|
|
|
|
<option value=""> All Locations</option>
|
|
|
|
{% for loc in camp.event_locations %}
|
|
|
|
<option value="{{ loc.slug }}" {% if location and location == loc %}selected{% endif %}>&#x{{ loc.icon }}; {{ loc.name }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2017-04-13 11:42:14 +00:00
|
|
|
|
|
|
|
<a href="{% url 'ics_view' camp_slug=camp.slug %}{{ get_string }}" class="btn btn-default form-control filter-control">
|
2017-04-13 11:53:52 +00:00
|
|
|
<i class="fa fa-calendar"></i> ICS
|
2017-04-13 11:42:14 +00:00
|
|
|
</a>
|
2017-03-17 16:58:29 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2017-01-23 22:58:41 +00:00
|
|
|
</div>
|
2017-02-17 16:17:21 +00:00
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2016-08-08 18:22:53 +00:00
|
|
|
{% block schedule_content %}
|
|
|
|
{% endblock schedule_content %}
|
|
|
|
|
2017-02-17 16:17:21 +00:00
|
|
|
{% url 'schedule_index' camp_slug=camp.slug as baseurl %}
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$('.filter-control').on('change', function() {
|
|
|
|
var day = $('#day').val();
|
|
|
|
var type = $('#event_type').val();
|
|
|
|
var loc = $('#location').val();
|
|
|
|
var url = "{{baseurl}}";
|
|
|
|
|
|
|
|
if(day) {
|
|
|
|
url = url + day + '/';
|
|
|
|
}
|
|
|
|
|
|
|
|
if(type != '' || loc != '') {
|
|
|
|
url = url + '?';
|
|
|
|
if(type != '') {
|
|
|
|
url = url + 'type=' + type;
|
|
|
|
if(loc != '') { url = url + '&'; }
|
|
|
|
}
|
|
|
|
if(loc != '') {
|
|
|
|
url = url + 'location=' + loc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
window.location.href = url;
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{% endblock program_content %}
|