updated the view for GET part and created corresponding template anoop
authornishanth
Wed, 21 Jul 2010 17:16:50 +0530
branchanoop
changeset 153 55f338569133
parent 152 86bfdb64edb5
child 154 5cd25b1093ad
updated the view for GET part and created corresponding template
sdi/views.py
templates/send_acco_cnf.html
--- a/sdi/views.py	Wed Jul 21 16:57:17 2010 +0530
+++ b/sdi/views.py	Wed Jul 21 17:16:50 2010 +0530
@@ -164,7 +164,30 @@
     """ display list of confirmed participants who requested for accomodation
     and let the admin decide.
     """
-    pass
+
+    rejected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3", 
+                                             registrantinfo__status_of_accomodation="4")
+    selected_not_confirmed_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3",
+                                                           registrantinfo__status_of_accomodation="2")
+    selected_confirmed_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3", 
+                                                       registrantinfo__status_of_accomodation="3")
+    not_selected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3", 
+                                                 registrantinfo__status_of_accomodation="4")
+
+    user_choices = list(rejected_ppl) + list(selected_not_confirmed_ppl) + list(not_selected_ppl)
+    form = UserSelectForm(user_choices, request.POST)
+
+    if request.method == "POST" and form.is_valid():
+        pass
+    else:
+        return render_to_response("send_acco_cnf.html", {"rejected": rejected_ppl,
+                                                        "selected_not_confirmed":selected_not_confirmed_ppl,
+                                                        "selected_confirmed":selected_confirmed_ppl,
+                                                        "not_selected":not_confirmed_ppl,
+                                                       })
+
+
+
 
 def confirm_wsp_participation(request, uid):
     """ match id versus email and take lappy details.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/send_acco_cnf.html	Wed Jul 21 17:16:50 2010 +0530
@@ -0,0 +1,62 @@
+{% extends 'base.html' %}
+{% block title %}
+Send Accomodation Confirmation
+{% endblock %}
+{% block content %}
+<form action="" method=post>
+Not Selected ppl: {{not_selected.count}}<br >
+<table cellspacing=2 cellpadding=2>
+{% for m in not_selected %}
+<tr>
+<td> <input type="checkbox" name="selected_users" value="{{m.id}}" id="id_selected_users_0" /> </td>
+<td> {{m}} </td>
+<td> {{m.gender}} </td>
+<td> {{m.profession}}</td>
+<td> {{m.affiliated_to}} </td>
+</tr>
+{% endfor %}
+</table>
+<br />
+Selected but not Confirmed Ppl: {{selected_not_confirmed.count}}<br />
+<table cellspacing=2 cellpadding=2>
+{% for m in selected_not_confirmed %}
+<tr>
+<td> <input type="checkbox" name="selected_users" value="{{m.id}}" id="id_selected_users_0" /> </td>
+<td> {{m}} </td>
+<td> {{m.gender}} </td>
+<td> {{m.profession}}</td>
+<td> {{m.affiliated_to}} </td>
+</tr>
+{% endfor %}
+</table>
+
+Rejected Ppl: {{rejected.count}}<br />
+<table cellspacing=2 cellpadding=2>
+{% for m in rejected %}
+<tr>
+<td> <input type="checkbox" name="selected_users" value="{{m.id}}" id="id_selected_users_0" /> </td>
+<td> {{m}} </td>
+<td> {{m.gender}} </td>
+<td> {{m.profession}}</td>
+<td> {{m.affiliated_to}} </td>
+</tr>
+{% endfor %}
+</table>
+
+<input type=submit value="Send confirmation email"  />
+</form>
+<br /><br />
+Selected and confirmed Ppl: {{selected_confirmed.count}}<br />
+<table cellspacing=2 cellpadding=2>
+{% for m in selected_confirmed %}
+<tr>
+<td> {{m}} </td>
+<td> {{m.gender}} </td>
+<td> {{m.profession}}</td>
+<td> {{m.affiliated_to}} </td>
+</tr>
+{% endfor %}
+</table>
+
+{% endblock %}
+