Skip to content

Commit

Permalink
Update booking_confirm to look better when hours open is bigger
Browse files Browse the repository at this point in the history
  • Loading branch information
abkruse committed Aug 10, 2017
1 parent 0afab2c commit 2976b89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion member/templates/member/events/booking_confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h4 class='header-font' style='text-align:center; color:black;'>Confirm Booking<
{% for block, times in event_dict.items %}
{% if room == block %}
{% for time in times %}
{% if forloop.counter0|divisibleby:2 %}
{% if forloop.counter0|divisibleby:loop_count %}
<th class="rotate"><div><span>
{{ time.hour }}:{{ time.minutes }}
</div></span></th>
Expand Down
7 changes: 6 additions & 1 deletion member/views/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ def confirm_booking(request, room, start, end, date, rate):
event_dict = {}
calendar = room.get_calendar(target_date)
event_dict[room] = calendar
if len(calendar) > 48:
loop_count = 4
else:
loop_count = 2

# Infuse room calendar with search range
search_start = start.replace(':', '')
Expand Down Expand Up @@ -249,7 +253,8 @@ def confirm_booking(request, room, start, end, date, rate):
'room': room,
'date': date,
'rate': rate,
'event_dict': event_dict
'loop_count': loop_count,
'event_dict': event_dict,
}
return render(request, 'member/events/booking_confirm.html', context)

Expand Down

0 comments on commit 2976b89

Please sign in to comment.