From ba7c76631693c6d4ae4927543dddf0e1bbce6454 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 3 Jul 2018 14:22:03 +0200 Subject: [PATCH] Allow displaying event details --- calsocial/__init__.py | 12 ++++++++++++ calsocial/templates/event-details.html | 14 ++++++++++++++ calsocial/templates/month-view.html | 9 ++++++--- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 calsocial/templates/event-details.html diff --git a/calsocial/__init__.py b/calsocial/__init__.py index 0bc5d08..b3b6409 100644 --- a/calsocial/__init__.py +++ b/calsocial/__init__.py @@ -204,5 +204,17 @@ class CalendarSocialApp(Flask): return render_template('user-settings.html', form=form) + @staticmethod + @route('/event/') + def event_details(event_id): + """View to display event details + """ + + from .models import Event + + event = Event.query.get_or_404(event_id) + + return render_template('event-details.html', event=event) + app = CalendarSocialApp(__name__) diff --git a/calsocial/templates/event-details.html b/calsocial/templates/event-details.html new file mode 100644 index 0000000..1854c20 --- /dev/null +++ b/calsocial/templates/event-details.html @@ -0,0 +1,14 @@ +{% extends 'base.html' %} + +{% block content %} +

+ {{ event.title }}
+ + {{ event.start_time_for_user(current_user) }}–{{ event.end_time_for_user(current_user) }} + {% if current_user.timezone | string != event.time_zone %} + ({{ event.start_time_tz }}–{{ event.end_time_tz }} {{ event.time_zone }}) + {% endif %} + +

+{{ event.description }} +{% endblock %} diff --git a/calsocial/templates/month-view.html b/calsocial/templates/month-view.html index eee37ff..cf38bf0 100644 --- a/calsocial/templates/month-view.html +++ b/calsocial/templates/month-view.html @@ -47,7 +47,10 @@ background-color: #d8d8d8; } - tr.week > td > div.event { + tr.week > td > a.event { + display: block; + color: black; + text-decoration: none; border: 1px solid green; background-color: white; border-radius: 2px; @@ -118,10 +121,10 @@ {{ day.day }} {% for event in calendar.day_events(day, user=current_user) %} - + {% endfor %} {% endfor %}