updated view_event page .
--- a/reg/views.py Thu Apr 15 19:00:23 2010 +0530
+++ b/reg/views.py Thu Apr 15 19:19:08 2010 +0530
@@ -192,19 +192,17 @@
except Event.DoesNotExist:
return redirect("/reg")
- is_guest = False if user.is_authenticated() and user.is_active else True
- is_attendee = True if user in event.attendees.all() else False
+ is_attendee = True if user.is_active and user in event.attendees.all() else False
is_org = True if user in event.organizers.all() else False
can_submit_feedback = False
- if not event.feedback_status == "0":
+ if not event.feedback_status == "0" and user.is_authenticated():
try:
FeedLog.objects.get(user=user,event=event,day=event.feedback_status)
except FeedLog.DoesNotExist:
can_submit_feedback = True
context = {'user': user,
- 'is_guest': is_guest,
'event': event,
'is_attendee': is_attendee,
'is_org': is_org,
--- a/templates/feedback.html Thu Apr 15 19:00:23 2010 +0530
+++ b/templates/feedback.html Thu Apr 15 19:19:08 2010 +0530
@@ -1,8 +1,9 @@
{% extends "base.html" %}
{% block content %}
-Feedback on Day {{event.feedback_status}} of {{event.title}} at {{event.venue}}
+Feedback on Day {{event.feedback_status}} of {{event.title}} at {{event.venue}}<br /><br />
{% if submitted %}
- Your feedback has been successfully submitted.
+ Your feedback has been successfully submitted.<br />
+ <a href="/reg/event/view/{{event.key}}">Return to the workshop page</a>
{% else %}
<form action="" method="post">
{{ form.as_p }}
--- a/templates/view_event.html Thu Apr 15 19:00:23 2010 +0530
+++ b/templates/view_event.html Thu Apr 15 19:19:08 2010 +0530
@@ -5,19 +5,17 @@
{{event.description|linebreaksbr}}<br /><br />
<b>Duration:</b> {{event.start_date|date:"d M Y"}} to {{event.stop_date|date:"d M Y"}}<br />
<b>Venue:</b> {{event.venue}} <br /><br />
-
- {% if user.is_authenticated %}
- {% if event.registration_is_open %}
- {% if is_attendee %}
- You have registered for this workshop.<br />
- {% else %}
+
+ {% if event.registration_is_open %}
+ {% if user.is_authenticated %}
+ {% if not is_attendee %}
<a href="/reg/event/register/{{event.key}}">Register for this workshop.</a><br />
{% endif %}
{% else %}
- Registration for this workshop is not open at this moment.<br />
+ <a href="/reg/register/{{event.key}}">Register for this workshop</a>.<br />
{% endif %}
{% else %}
- <a href="/reg/register/{{event.key}}">Register for this workshop</a>.<br />
+ Registration for this workshop is not open at this moment.<br />
{% endif %}
{% if can_submit_feedback %}