From 8e3bcd8ededa94314460f77673d3576f24139fd6 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 11 Jul 2018 12:57:09 +0200 Subject: [PATCH] Create a view that can list all events --- calsocial/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/calsocial/__init__.py b/calsocial/__init__.py index 5020734..267cd59 100644 --- a/calsocial/__init__.py +++ b/calsocial/__init__.py @@ -415,5 +415,19 @@ class CalendarSocialApp(Flask): return render_template('profile-edit.html', form=form) + @staticmethod + @route('/all-events') + def all_events(): + from .calendar_system.gregorian import GregorianCalendar + + try: + timestamp = datetime.fromtimestamp(float(request.args.get('date'))) + except TypeError: + timestamp = datetime.utcnow() + + calendar = GregorianCalendar(timestamp.timestamp()) + + return render_template('index.html', calendar=calendar, user_only=False) + app = CalendarSocialApp(__name__)