Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
427:85d7b62d5c17 | 428:77b3b01843b5 |
---|---|
3 | 3 |
4 """ | 4 """ |
5 import datetime | 5 import datetime |
6 | 6 |
7 from django.contrib.auth.decorators import login_required | 7 from django.contrib.auth.decorators import login_required |
8 from django.contrib.auth.models import User | |
8 from django.contrib import messages | 9 from django.contrib import messages |
9 from django.core.paginator import Paginator, EmptyPage, InvalidPage | 10 from django.core.paginator import Paginator, EmptyPage, InvalidPage |
10 from django.core.urlresolvers import reverse | 11 from django.core.urlresolvers import reverse |
11 from django.http import HttpResponse | 12 from django.http import HttpResponse |
12 from django.http import HttpResponseForbidden | 13 from django.http import HttpResponseForbidden |
47 | 48 |
48 """ | 49 """ |
49 tab_index = TAB_INDICES[tab] if tab else 0 | 50 tab_index = TAB_INDICES[tab] if tab else 0 |
50 return render(request, 'messages/tabbed_base.html', { | 51 return render(request, 'messages/tabbed_base.html', { |
51 'tab': tab_index, | 52 'tab': tab_index, |
53 }) | |
54 | |
55 | |
56 @login_required | |
57 def compose_to(request, receiver): | |
58 """ | |
59 This function displays the base tabbed private messages view, | |
60 and configures it to display the compose PM tab for the given | |
61 receiver. | |
62 | |
63 """ | |
64 user = get_object_or_404(User, username=receiver) | |
65 tab_index = TAB_INDICES['compose'] | |
66 return render(request, 'messages/tabbed_base.html', { | |
67 'tab': tab_index, | |
68 'receiver': receiver, | |
52 }) | 69 }) |
53 | 70 |
54 | 71 |
55 def inbox(request): | 72 def inbox(request): |
56 """ | 73 """ |