diff messages/views.py @ 1133:62cfdddd584a

Convert private messages to V3_DESIGN.
author Brian Neal <bgneal@gmail.com>
date Tue, 04 Oct 2016 20:26:34 -0500
parents 79a71b9d0a2a
children
line wrap: on
line diff
--- a/messages/views.py	Wed Sep 28 20:25:29 2016 -0500
+++ b/messages/views.py	Tue Oct 04 20:26:34 2016 -0500
@@ -74,6 +74,7 @@
         'page': page,
         'inbox_pct': pct_used,
         'outbox_pct': None,
+        'V3_DESIGN': True,
         })
 
 
@@ -91,6 +92,7 @@
         'page': page,
         'inbox_pct': None,
         'outbox_pct': pct_used,
+        'V3_DESIGN': True,
         })
 
 
@@ -106,6 +108,7 @@
         'page': page,
         'inbox_pct': None,
         'outbox_pct': None,
+        'V3_DESIGN': True,
         })
 
 
@@ -129,6 +132,7 @@
     return render(request, 'messages/options.html', {
         'tab': 'options',
         'form': form,
+        'V3_DESIGN': True,
         })
 
 
@@ -157,6 +161,7 @@
     return render(request, 'messages/compose.html', {
         'tab': 'compose',
         'compose_form': compose_form,
+        'V3_DESIGN': True,
         })
 
 
@@ -178,7 +183,9 @@
     else:
         if msg.sender != request.user and msg.receiver != request.user:
             django_messages.error(request,
-                    "You don't have permission to read that message.")
+                                  "You don't have permission to read that message.",
+                                  extra_tags="alert")
+
             return redirect('messages-inbox')
 
         initial_data = {
@@ -206,6 +213,7 @@
         'msg': msg,
         'form': form,
         'msg_flag': msg_flag,
+        'V3_DESIGN': True,
         })
 
 
@@ -278,7 +286,7 @@
     if count > 0:
         django_messages.success(request, msg)
     else:
-        django_messages.error(request, msg)
+        django_messages.error(request, msg, extra_tags="alert")
 
 
 def _undelete_pms(user, msg_ids):
@@ -334,14 +342,16 @@
     """
     msg = get_object_or_404(Message.objects.select_related(), pk=msg_id)
     if msg.receiver != request.user:
-        django_messages.error(request, "You can't report this message.")
+        django_messages.error(request, "You can't report this message.",
+                              extra_tags="alert")
         return redirect('messages-inbox')
     try:
         msg.flag
     except Flag.DoesNotExist:
         pass
     else:
-        django_messages.error(request, "This message has already been reported.")
+        django_messages.error(request, "This message has already been reported.",
+                              extra_tags="alert")
         return redirect('messages-inbox')
 
     if request.method == 'POST':
@@ -360,6 +370,7 @@
     return render(request, 'messages/report_message.html', {
         'msg': msg,
         'form': form,
+        'V3_DESIGN': True,
         })
 
 
@@ -405,4 +416,4 @@
     if count > 0:
         django_messages.success(request, msg)
     else:
-        django_messages.error(request, msg)
+        django_messages.error(request, msg, extra_tags="alert")