From 48ffb0d4725f1863ba192aa9ccd299e5f019d1ac Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 11 Jul 2018 12:55:49 +0200 Subject: [PATCH] [Refactor] Refactor the month view template so it can display all events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …not just the events of the current user. --- calsocial/__init__.py | 2 +- calsocial/templates/month-view.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/calsocial/__init__.py b/calsocial/__init__.py index 40e325e..5020734 100644 --- a/calsocial/__init__.py +++ b/calsocial/__init__.py @@ -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']) diff --git a/calsocial/templates/month-view.html b/calsocial/templates/month-view.html index ca5d75d..52e5826 100644 --- a/calsocial/templates/month-view.html +++ b/calsocial/templates/month-view.html @@ -120,7 +120,7 @@ {%- endif %} {{ day.day }} - {% 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) %} {{ event.start_time_for_user(current_user).strftime('%H:%M') }}–{{ event.end_time_for_user(current_user).strftime('%H:%M') }} {{ event.title }}