implemented list people functionality .
authornishanth
Tue, 13 Apr 2010 10:50:29 +0530
changeset 19 115860e87238
parent 18 7dae32a2439b
child 20 9354ef8119c6
implemented list people functionality .
reg/site/urls.py
reg/views.py
templates/account_created.html
templates/index.html
templates/list_attendees.html
templates/list_events.html
templates/password_reset.html
templates/view_event.html
--- a/reg/site/urls.py	Mon Apr 12 18:15:21 2010 +0530
+++ b/reg/site/urls.py	Tue Apr 13 10:50:29 2010 +0530
@@ -15,6 +15,7 @@
     (r'^event/list/$', reg_views.list_events),                       
     (r'^event/view/(\w+)/$', reg_views.view_event),
     (r'^event/register/(\w+)/$', reg_views.register_for_event),
+    (r'^event/attendees/(\w+)/$', reg_views.list_attendees),                       
     (r'^event/feedback/open/(\w+)/$', reg_views.open_feedback),
     (r'^event/feedback/close/(\w+)/$', reg_views.close_feedback),
     (r'^event/registration/open/(\w+)/$', reg_views.open_registration),
--- a/reg/views.py	Mon Apr 12 18:15:21 2010 +0530
+++ b/reg/views.py	Tue Apr 13 10:50:29 2010 +0530
@@ -340,3 +340,19 @@
 
     return render_to_response('list_events.html', context)
 
+def list_attendees(request, event_key):
+    """ see if the request user is org.
+    Else redirect him to homepage.
+    """
+
+    user = request.user
+    try:
+        event = Event.objects.get(key__iexact=event_key)
+    except Event.DoesNotExist:
+        return redirect('/reg')
+
+    if not user in event.organizers.all():
+        return redirect('/reg')
+    
+    profile = user.get_profile()
+    return render_to_response('list_attendees.html', {'user':user, 'event':event, 'attendees':event.attendees.all()})
--- a/templates/account_created.html	Mon Apr 12 18:15:21 2010 +0530
+++ b/templates/account_created.html	Tue Apr 13 10:50:29 2010 +0530
@@ -1,5 +1,7 @@
 {% extends "base.html" %}
 {% block content %}
 The account has been created.<br />
+<a href="/reg/activate/{{activation_key}}">Click here to activate your account.</a><br />
+This link will be sent to your email.<br />
 <a href="/reg/login">click here</a> to go to login page.
 {% endblock %}
--- a/templates/index.html	Mon Apr 12 18:15:21 2010 +0530
+++ b/templates/index.html	Tue Apr 13 10:50:29 2010 +0530
@@ -3,5 +3,6 @@
 	{% if user.is_staff %}
 		<a href="/reg/event/create">Create an event</a><br />	
 	{% endif %}
+	<a href="/reg/event/list">List of Workshops</a> 
 
 {% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/list_attendees.html	Tue Apr 13 10:50:29 2010 +0530
@@ -0,0 +1,30 @@
+{% extends "base.html" %}
+{% block content %}
+	List of people registered for "{{event.title}}"<br /><br />
+	<table cellspacing=5 cellpadding=5>
+	<tr>
+		<td>Name</td>
+		<td>Gender</td>
+		<td>Profession</td>
+		<td>College/Company</td>
+		<td>Interests</td>
+	</tr>
+	{% for a_user in attendees %}
+		<tr>
+			<td>{{a_user.get_full_name}}</td>
+			<td>{{a_user.get_profile.gender}}</td>
+			<td>{% ifequal a_user.get_profile.profession "S" %}
+				Student
+				{% else %}
+					{% ifequal a_user.get_profile.profession "F" %}
+						Faculty
+					{% else %}
+						Professional
+					{% endifequal %}
+				{% endifequal %}
+			</td>
+			<td>{{a_user.get_profile.interests}}</td>
+		</tr>
+	{% endfor %}
+	</table>
+{% endblock %}
--- a/templates/list_events.html	Mon Apr 12 18:15:21 2010 +0530
+++ b/templates/list_events.html	Tue Apr 13 10:50:29 2010 +0530
@@ -5,7 +5,7 @@
 		<table cellspacing=5 cellpadding=5>
 		{% for event in ongoing_events %}
 			<tr>
-				<td><a href="/reg/event/view/{{event.key}}">{{event.title}}</a></td>
+				<td  align="center"><a href="/reg/event/view/{{event.key}}">{{event.title}}</a></td>
 				<td>{{event.start_date|date:"d M Y"}} - {{event.stop_date|date:"d M Y"}}</td>
 			</tr>
 		{% endfor %}
@@ -17,7 +17,7 @@
 		<table cellspacing=5 cellpadding=5>
 		{% for event in upcoming_events %}
 			<tr>
-				<td><a href="/reg/event/view/{{event.key}}">{{event.title}}</a></td>
+				<td  align="center"><a href="/reg/event/view/{{event.key}}">{{event.title}}</a></td>
 				<td>{{event.start_date|date:"d M Y"}} - {{event.stop_date|date:"d M Y"}}</td>
 			</tr>
 		{% endfor %}
@@ -31,7 +31,7 @@
 		<table cellspacing=5 cellpadding=5>
 		{% for event in previous_events %}
 			<tr>
-				<td><a href="/reg/event/view/{{event.key}}">{{event.title}}</a></td>
+				<td  align="center"><a href="/reg/event/view/{{event.key}}">{{event.title}}</a></td>
 				<td>{{event.start_date|date:"d M Y"}} - {{event.stop_date|date:"d M Y"}}</td>
 			</tr>
 		{% endfor %}
--- a/templates/password_reset.html	Mon Apr 12 18:15:21 2010 +0530
+++ b/templates/password_reset.html	Tue Apr 13 10:50:29 2010 +0530
@@ -1,7 +1,8 @@
 {% extends "base.html" %}
 {% block content %}
 	{% if new_password %}
-		Your password has been reset to {{ new_password }}. <a href="/reg">Click here</a> to return to home page.
+		Your password is "{{ new_password }}". This will be sent to your email id when app is on FOSSEE.<br />
+		<a href="/reg">Click here</a> to return to home page.
 	{% else %}
 		<form action="" method="post">
 		{{form.as_p}}
--- a/templates/view_event.html	Mon Apr 12 18:15:21 2010 +0530
+++ b/templates/view_event.html	Tue Apr 13 10:50:29 2010 +0530
@@ -3,7 +3,7 @@
 	<h3>{{ event.title }}</h3><br />
 	Description:<br />
 	{{event.description|linebreaksbr}}<br />
-	duration of the workshop: {{event.start_date}} to {{event.stop_date}}<br />
+	duration of the workshop: {{event.start_date|date:"d M Y"}} to {{event.stop_date|date:"d M Y"}}<br />
 	
 	{% if not is_guest and event.registration_is_open %}
 		{% if is_attendee %}
@@ -18,6 +18,7 @@
 	{% endif %}
 	
 	{% if is_org %}
+		<a href="/reg/event/attendees/{{event.key}}">Click here</a> to view list of people registered for the workshop. <br />
 		{% if event.registration_is_open %}
 			<a href="/reg/event/registration/close/{{event.key}}">Click here</a> to close the registration.<br />
 		{% else %}