# HG changeset patch # User Brian Neal # Date 1304215908 0 # Node ID 77b3b01843b5fa60eede4a6f7598397d32260146 # Parent 85d7b62d5c17433508df9cbda75878604c99f553 Gave the beta private messages a 'compose to' view. Tweaked the color of the tables to match the jquery ui theme. diff -r 85d7b62d5c17 -r 77b3b01843b5 gpp/messages/static/css/messages.css --- a/gpp/messages/static/css/messages.css Tue Apr 26 02:11:00 2011 +0000 +++ b/gpp/messages/static/css/messages.css Sun May 01 02:11:48 2011 +0000 @@ -17,7 +17,7 @@ table.messages th { color: black; - background: #bdd6d6; + background: #87b6d9; padding: 3px 4px 3px 4px; font-weight: bold; } diff -r 85d7b62d5c17 -r 77b3b01843b5 gpp/messages/static/js/tabbed_messages.js --- a/gpp/messages/static/js/tabbed_messages.js Tue Apr 26 02:11:00 2011 +0000 +++ b/gpp/messages/static/js/tabbed_messages.js Sun May 01 02:11:48 2011 +0000 @@ -6,7 +6,12 @@ }, load: function(event, ui) { selectedTab = ui; - if (doReply && ui.index == 1) + if (ui.index == 1 && receiver && !doReply) + { + $('#id_receiver').val(receiver); + receiver = ''; + } + else if (doReply && ui.index == 1) { doReply = false; var msg = msgCache[$msgDialog.msgId]; diff -r 85d7b62d5c17 -r 77b3b01843b5 gpp/messages/urls.py --- a/gpp/messages/urls.py Tue Apr 26 02:11:00 2011 +0000 +++ b/gpp/messages/urls.py Sun May 01 02:11:48 2011 +0000 @@ -29,6 +29,9 @@ url(r'^beta/(inbox|compose|outbox|trash|options)/$', 'index', name='messages-beta_index_named'), + url(r'^beta/compose/([\w.@+-]{1,30})/$', + 'compose_to', + name='messages-beta_compose_to'), url(r'^beta/inbox-tab/$', 'inbox', name='messages-beta_inbox'), diff -r 85d7b62d5c17 -r 77b3b01843b5 gpp/messages/views2.py --- 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. diff -r 85d7b62d5c17 -r 77b3b01843b5 gpp/templates/messages/tabbed_base.html --- a/gpp/templates/messages/tabbed_base.html Tue Apr 26 02:11:00 2011 +0000 +++ b/gpp/templates/messages/tabbed_base.html Sun May 01 02:11:48 2011 +0000 @@ -10,6 +10,11 @@ //