# HG changeset patch # User Brian Neal # Date 1475630794 18000 # Node ID 62cfdddd584a11418d30ba979e4e1a352374d7f5 # Parent 1407af5472e430940e7803f5d86bf2d2552a679a Convert private messages to V3_DESIGN. diff -r 1407af5472e4 -r 62cfdddd584a messages/views.py --- 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") diff -r 1407af5472e4 -r 62cfdddd584a sg101/templates/messages/compose.html --- a/sg101/templates/messages/compose.html Wed Sep 28 20:25:29 2016 -0500 +++ b/sg101/templates/messages/compose.html Tue Oct 04 20:26:34 2016 -0500 @@ -1,23 +1,46 @@ {% extends 'messages/messages_base.html' %} {% load core_tags %} {% load script_tags %} -{% block custom_js %} -{% script_tags 'jquery-ui' %} -{% script_tags 'markitup' %} -{% endblock %} +{% load static from staticfiles %} {% block messages_content %}

Compose Private Message

Use this form to send a new private message to another user.

{% csrf_token %} - -{{ compose_form.as_table }} - - - - -
  - {% comment_dialogs %} - -
+ {{ compose_form.non_field_errors }} + {{ compose_form.receiver.errors }} +
+
+ +
+
+ {{ compose_form.subject.errors }} +
+
+ +
+
+ {% post_box compose_form.message %} + {{ compose_form.attach_signature.errors }} +
+
+ {{ compose_form.attach_signature }} + +
+
+ {{ compose_form.parent_id }} +
+{% include 'core/v3/post_box_modals.html' %} {% endblock %} +{% block custom_js %} + +{% endblock %} diff -r 1407af5472e4 -r 62cfdddd584a sg101/templates/messages/inbox.html --- a/sg101/templates/messages/inbox.html Wed Sep 28 20:25:29 2016 -0500 +++ b/sg101/templates/messages/inbox.html Tue Oct 04 20:26:34 2016 -0500 @@ -1,24 +1,23 @@ {% extends 'messages/messages_base.html' %} {% load static from staticfiles %} -{% block custom_js %} - -{% endblock %} {% block messages_content %} -

Inbox (Page {{ page.number }} of {{ page.paginator.num_pages }})

+

Inbox {{ inbox_pct }}% used

This is your inbox. It contains messages sent to you by others. Messages in bold are unread. Messages in italics indicate you have replied to the message.

{% if page.object_list %} - {% include "messages/pagination.html" %} + {% include "core/v3/pagination.html" %}
{% csrf_token %} - +
+ + {% for msg in page.object_list %} {% endfor %} - - -
From Subject Date
@@ -31,19 +30,24 @@
- - -
+
+
+ + +
+
- {% include "messages/pagination.html" %} + {% include "core/v3/pagination.html" %} {% else %}

Your Inbox is empty.

{% endif %} {% include 'messages/usage_graph.html' with pct_used=inbox_pct box_name='inbox' %} {% endblock %} +{% block custom_js %} + +{% endblock %} diff -r 1407af5472e4 -r 62cfdddd584a sg101/templates/messages/messages_base.html --- a/sg101/templates/messages/messages_base.html Wed Sep 28 20:25:29 2016 -0500 +++ b/sg101/templates/messages/messages_base.html Tue Oct 04 20:26:34 2016 -0500 @@ -1,31 +1,33 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% load static from staticfiles %} {% load script_tags %} -{% block custom_css %} - -{% endblock %} {% block content %}

Your Private Messages

-{% if messages %} -