view sg101/templates/messages/inbox.html @ 818:cf486a8e8b43

Added the ability to export private messages to email.
author Brian Neal <bgneal@gmail.com>
date Sat, 13 Sep 2014 16:19:46 -0500
parents 59e36169a814
children 02ae9a4a846a
line wrap: on
line source
{% extends 'messages/messages_base.html' %}
{% block custom_js %}
<script src="{{ STATIC_URL }}js/messages.js"></script>
{% endblock %}
{% block messages_content %}
<h3>Inbox <small>(Page {{ page.number }} of {{ page.paginator.num_pages }})</small></h3>
<p>
This is your inbox. It contains messages sent to you by others. Messages in <strong>bold</strong> are unread.
Messages in <em>italics</em> indicate you have replied to the message.
</p>
{% if page.object_list %}
   {% include "messages/pagination.html" %}
   <form action="{% url 'messages-bulk' %}" method="post">{% csrf_token %}
   <table class="messages">
   <tr>
      <th>From</th>
      <th>Subject</th>
      <th>Date</th>
      <th><input type="checkbox" onclick="tabMasterCheckClick(this, 'pm_ids');" /></th>
   </tr>
   {% for msg in page.object_list %}
   <tr>
      <td><a href="{% url 'bio.views.view_profile' msg.sender.username %}">
         {{ msg.sender.username }}</a></td>
      <td>
         <a href="{% url 'messages-view' msg.pk %}"
            class="{% if msg.unread %}unread {% endif %}{% if msg.replied_to %}replied_to{% endif %}">{{ msg.subject }}</a>
         </td>
      <td>{{ msg.send_date|date:"M j, Y g:i A" }}</td>
      <td><input type="checkbox" name="pm_ids" value="{{ msg.id }}" /></td>
   </tr>
   {% endfor %}
   <tr>
      <td colspan="4">
         <input type="submit" name="action" value="Email Checked Messages" onclick="return bulkMsgAction('email');" />
         <input type="submit" name="action" value="Delete Checked Messages" onclick="return bulkMsgAction('delete');" />
      </td>
   </tr>
   </table>
   <input type="hidden" name="src" value="inbox" />
   <input type="hidden" name="page" value="{{ page.number }}" />
   </form>
   {% include "messages/pagination.html" %}
{% else %}
   <p><em>Your Inbox is empty.</em></p>
{% endif %}
{% include 'messages/usage_graph.html' with pct_used=inbox_pct box_name='inbox' %}
{% endblock %}