[Refactor] Refactor the month view template so it can display all events
…not just the events of the current user.
This commit is contained in:
parent
c3348d3212
commit
48ffb0d472
@ -170,7 +170,7 @@ class CalendarSocialApp(Flask):
|
|||||||
|
|
||||||
calendar = GregorianCalendar(timestamp.timestamp())
|
calendar = GregorianCalendar(timestamp.timestamp())
|
||||||
|
|
||||||
return render_template('index.html', calendar=calendar)
|
return render_template('index.html', calendar=calendar, user_only=True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@route('/register', methods=['POST', 'GET'])
|
@route('/register', methods=['POST', 'GET'])
|
||||||
|
@ -120,7 +120,7 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
<td class="{% if day.month != calendar.timestamp.month %} other-month{% endif %}{% if day.date() == now.date() %} today{% endif %}">
|
<td class="{% if day.month != calendar.timestamp.month %} other-month{% endif %}{% if day.date() == now.date() %} today{% endif %}">
|
||||||
<span class="day-num">{{ day.day }}</span>
|
<span class="day-num">{{ day.day }}</span>
|
||||||
{% for event in calendar.day_events(day, user=current_user) %}
|
{% for event in calendar.day_events(day, user=current_user if user_only else none) %}
|
||||||
<a href="{{ url_for('event_details', event_uuid=event.event_uuid) }}" class="event">
|
<a href="{{ url_for('event_details', event_uuid=event.event_uuid) }}" class="event">
|
||||||
{{ event.start_time_for_user(current_user).strftime('%H:%M') }}–{{ event.end_time_for_user(current_user).strftime('%H:%M') }}
|
{{ event.start_time_for_user(current_user).strftime('%H:%M') }}–{{ event.end_time_for_user(current_user).strftime('%H:%M') }}
|
||||||
{{ event.title }}
|
{{ event.title }}
|
||||||
|
Loading…
Reference in New Issue
Block a user