# HG changeset patch # User Brian Neal # Date 1298858318 0 # Node ID f7fbb404241fd3a390e7cde2c81bf14a47703376 # Parent 7eed448b399c8eeaa1274bbc1f1c15c1c43ef536 Fix #164; have the calendar display times in the user's time zone. If the user isn't logged in, just use US/Pacific. Default the calendar mode to agenda mode. diff -r 7eed448b399c -r f7fbb404241f gpp/gcalendar/views.py --- a/gpp/gcalendar/views.py Sun Feb 27 22:58:48 2011 +0000 +++ b/gpp/gcalendar/views.py Mon Feb 28 01:58:38 2011 +0000 @@ -18,7 +18,15 @@ def index(request): + user = request.user + if user.is_authenticated(): + profile = user.get_profile() + tz = profile.time_zone + else: + tz = 'US/Pacific' + return render_to_response('gcalendar/index.html', { + 'tz': tz, }, context_instance = RequestContext(request)) diff -r 7eed448b399c -r f7fbb404241f gpp/templates/gcalendar/index.html --- a/gpp/templates/gcalendar/index.html Sun Feb 27 22:58:48 2011 +0000 +++ b/gpp/templates/gcalendar/index.html Mon Feb 28 01:58:38 2011 +0000 @@ -3,11 +3,21 @@ {% block title %}Event Calendar{% endblock %} {% block content %}

SurfGuitar101 Event Calendar

-

All times are shown in the US/Central time zone. You can add any event on our calendar to your own +

Welcome to the SG101 event calendar. You can add any event on our calendar to your own Google calendar. If you do, the event will be displayed in your time zone, and you can have Google send you email or text message reminders for the events. Click on any event below to see more details or copy it to your calendar.

- +{% if user.is_authenticated %} +

Please note: all times shown are in the {{ tz }} +time zone, which is the time zone preference you have set in your +user profile. +

+{% else %} +

Please note: all times shown are in the {{ tz }} time zone. Please +login to view the times based on the time zone set in your profile.

+{% endif %} + +