Mercurial > public > sg101
diff gpp/messages/views2.py @ 428:77b3b01843b5
Gave the beta private messages a 'compose to' view. Tweaked the color of the tables to match the jquery ui theme.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 01 May 2011 02:11:48 +0000 |
parents | 76ba9478ebbd |
children |
line wrap: on
line diff
--- a/gpp/messages/views2.py Tue Apr 26 02:11:00 2011 +0000 +++ b/gpp/messages/views2.py Sun May 01 02:11:48 2011 +0000 @@ -5,6 +5,7 @@ import datetime from django.contrib.auth.decorators import login_required +from django.contrib.auth.models import User from django.contrib import messages from django.core.paginator import Paginator, EmptyPage, InvalidPage from django.core.urlresolvers import reverse @@ -52,6 +53,22 @@ }) +@login_required +def compose_to(request, receiver): + """ + This function displays the base tabbed private messages view, + and configures it to display the compose PM tab for the given + receiver. + + """ + user = get_object_or_404(User, username=receiver) + tab_index = TAB_INDICES['compose'] + return render(request, 'messages/tabbed_base.html', { + 'tab': tab_index, + 'receiver': receiver, + }) + + def inbox(request): """ Returns the inbox for the user.