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-02-17 16:17:21 +00:00
|
|
|
<div class="btn-group btn-group-justified">
|
|
|
|
|
|
|
|
<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="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 %}>{{ loc.name }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2017-03-12 14:43:41 +00:00
|
|
|
|
|
|
|
{% if request.user.is_authenticated %}
|
2017-03-12 18:06:03 +00:00
|
|
|
<a href="{% url 'proposal_list' camp_slug=camp.slug %}" class="btn btn-default">Manage My Proposals</a>
|
2017-03-12 14:43:41 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2017-01-23 22:58:41 +00:00
|
|
|
</div>
|
2017-02-17 16:17:21 +00:00
|
|
|
</form>
|
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 %}
|