[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:
Gergely Polonkai 2018-07-11 12:55:49 +02:00
parent c3348d3212
commit 48ffb0d472
2 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@ class CalendarSocialApp(Flask):
calendar = GregorianCalendar(timestamp.timestamp())
return render_template('index.html', calendar=calendar)
return render_template('index.html', calendar=calendar, user_only=True)
@staticmethod
@route('/register', methods=['POST', 'GET'])

View File

@ -120,7 +120,7 @@
{%- 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>
{% 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">
{{ event.start_time_for_user(current_user).strftime('%H:%M') }}{{ event.end_time_for_user(current_user).strftime('%H:%M') }}
{{ event.title }}