diff --git a/src/postorius/templates/postorius/lists/held_messages.html b/src/postorius/templates/postorius/lists/held_messages.html index 0a8b3c6..8db0c33 100644 --- a/src/postorius/templates/postorius/lists/held_messages.html +++ b/src/postorius/templates/postorius/lists/held_messages.html @@ -8,49 +8,57 @@ {% block main %} {% list_nav 'list_held_messages' "Held Messages" %} - <table class="table table-bordered table-striped"> - <thead> - <tr> - <th>{% trans 'Subject' %}</th> - <th>{% trans 'Sender' %}</th> - <th>{% trans 'Reason' %}</th> - <th>{% trans 'Hold Date' %}</th> - <th> </th> - </tr> - </thead> - <tbody> - {% for msg in list.held %} - <tr> - <td>{{ msg.subject }}</td> - <td>{{ msg.sender }}</td> - <td>{{ msg.reason }}</td> - <td>{{ msg.hold_date }}</td> + {% if list.held|length > 0 %} - <td class="mm_action"> - <a href="{% url 'accept_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-info" data-toggle="modal" data-target="#msg-{{ msg.request_id }}">{% trans 'View' %}</a> + <table class="table table-bordered table-striped"> + <thead> + <tr> + <th>{% trans 'Subject' %}</th> + <th>{% trans 'Sender' %}</th> + <th>{% trans 'Reason' %}</th> + <th>{% trans 'Hold Date' %}</th> + <th> </th> + </tr> + </thead> + <tbody> + {% for msg in list.held %} + <tr> + <td>{{ msg.subject }}</td> + <td>{{ msg.sender }}</td> + <td>{{ msg.reason }}</td> + <td>{{ msg.hold_date }}</td> - <a href="{% url 'accept_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-success">{% trans 'Accept' %}</a> - <a href="{% url 'defer_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-warning">{% trans 'Defer' %}</a> - <a href="{% url 'reject_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-danger">{% trans 'Reject' %}</a> - <a href="{% url 'discard_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-danger">{% trans 'Discard' %}</a> - <!-- Modal --> - <div class="modal fade held-message-details" id="msg-{{ msg.request_id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title">Subject: {{ msg.subject }}</h4> + <td class="mm_action"> + <a href="{% url 'accept_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-info" data-toggle="modal" data-target="#msg-{{ msg.request_id }}">{% trans 'View' %}</a> + + <a href="{% url 'accept_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-success">{% trans 'Accept' %}</a> + <a href="{% url 'defer_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-warning">{% trans 'Defer' %}</a> + <a href="{% url 'reject_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-danger">{% trans 'Reject' %}</a> + <a href="{% url 'discard_held_message' list.fqdn_listname msg.request_id %}" class="btn btn-mini btn-danger">{% trans 'Discard' %}</a> + + <!-- Modal --> + <div class="modal fade held-message-details" id="msg-{{ msg.request_id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> + <h4 class="modal-title">Subject: {{ msg.subject }}</h4> + </div> + <div class="modal-body"> + {{ msg.msg | linebreaks }} + </div> + </div> </div> - <div class="modal-body"> - {{ msg.msg | linebreaks }} - </div> - </div> - </div> - </td> - </tr> - {% endfor %} - </tbody> - </table> + </td> + </tr> + {% endfor %} + </tbody> + </table> + {% else %} + + <p>{% trans 'There are currently no held messages.' %}</p> + + {% endif %} {% endblock %}