summaryrefslogtreecommitdiffstats
path: root/agenda/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'agenda/views.py')
-rwxr-xr-xagenda/views.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/agenda/views.py b/agenda/views.py
index 524558c..1f2ceb3 100755
--- a/agenda/views.py
+++ b/agenda/views.py
@@ -84,8 +84,9 @@ def mismensajes(request):
if request.user.is_authenticated():
missing_pixies = Event.events.missing_pixies().filter(redes__user=user.id).distinct()
group_todos = Todo.todos.pending_todos().filter(network__user=request.user).order_by('due_date')
+ attending = user.event_set.all().filter(end_date__gte=datetime.now())
my_mentored_events = Event.events.next_events().filter(pixie=user).select_related()
- return render_to_response('agenda/user_page.html', {'wishlist':wishlist, 'todolist':todolist,'group_todos': group_todos, 'my_mentored_events': my_mentored_events,'newtodo': newtodo, 'missing_pixies': missing_pixies },context_instance=RequestContext(request))
+ return render_to_response('agenda/user_page.html', {'wishlist':wishlist, 'attending': attending,'todolist':todolist,'group_todos': group_todos, 'my_mentored_events': my_mentored_events,'newtodo': newtodo, 'missing_pixies': missing_pixies },context_instance=RequestContext(request))
else:
event = Event.calendar.filter(public=True)
return render_to_response('agenda/event_list.html', {'event':event })
@@ -128,7 +129,8 @@ def calendar (request):
def wishlist (request):
wishlist = Wish.objects.all().filter(done=False).order_by('due_date')
- return render_to_response('agenda/wishlist.html', {'wishlist': wishlist}, context_instance=RequestContext(request))
+ done = Wish.objects.all().filter(done=True).order_by('due_date')[:10]
+ return render_to_response('agenda/wishlist.html', {'wishlist': wishlist, 'done': done }, context_instance=RequestContext(request))
@@ -224,6 +226,12 @@ def closetodo(request,todo_id,event_id):
request.user.message_set.create(message=todo.title+' has been closed as completed')
return HttpResponseRedirect('/agenda/map/'+event_id)
+def closewishitem(request,wish_id):
+ wish = get_object_or_404(Wish, pk=wish_id)
+ wish.done = True
+ wish.save()
+ return HttpResponseRedirect('/agenda/wishlist/')
+
def closegrouptodo(request,todo_id,object_id):
if request.method == 'POST':
todo = get_object_or_404(Todo, pk=todo_id)