Skip to content

Commit

Permalink
only show the ocurrent in the affected slot
Browse files Browse the repository at this point in the history
  • Loading branch information
llazzaro committed Jul 16, 2015
1 parent f2b5b7b commit c849111
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 7 additions & 8 deletions schedule/templates/schedule/_daily_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
{% endif %}
</td>
<td class="col-md-4">
{% for occ in occurrences %}
<button type="button" class="btn {% if occ.cancelled %} btn-danger {%else%} btn-primary {% endif %}" data-toggle="modal" data-target="#{% hash_occurrence occ %}">
{% options occ %}
{% title occ %}
</button>
{% include 'schedule/_detail.html' with occurrence=occ %}
{% endfor %}

{% for occ in slot.occurrences %}
<button type="button" class="btn {% if occ.cancelled %} btn-danger {%else%} btn-primary {% endif %}" data-toggle="modal" data-target="#{% hash_occurrence occ %}">
{% options occ %}
{% title occ %}
</button>
{% include 'schedule/_detail.html' with occurrence=occ %}
{% endfor %}
</td>
</tr>
{% endfor %}
Expand Down
2 changes: 0 additions & 2 deletions schedule/templatetags/scheduletags.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ def daily_table(context, day, start=8, end=20, increment=30):
context['addable'] = addable

day_part = day.get_time_slot(day.start + datetime.timedelta(hours=start), day.start + datetime.timedelta(hours=end))
occurrences = day_part.get_occurrences()
# get slots to display on the left
slots = _cook_slots(day_part, increment)
context['occurrences'] = occurrences
context['slots'] = slots
return context

Expand Down

0 comments on commit c849111

Please sign in to comment.