diff --git a/src/postorius/static/postorius/js/held_messages.js b/src/postorius/static/postorius/js/held_messages.js
new file mode 100644
index 0000000..9f7aaec
--- /dev/null
+++ b/src/postorius/static/postorius/js/held_messages.js
@@ -0,0 +1,40 @@
+var loadjs = function(rest_url, error_message) {
+ $('#all-messages-checkbox').change(function() {
+ $('.message-checkbox').prop('checked', this.checked);
+ });
+ $('.show-modal-btn').click(function() {
+ var msgid = $(this).data('msgid');
+ $.ajax({
+ url: rest_url + msgid,
+ success: function(data) {
+ $('#msg-title').html(data.subject);
+ $('#held-stripped-message').html(data.stripped_msg.replace(/\n/g, "
"));
+ $('#held-full-message').html(data.msg.replace(/\n/g, "
"));
+ $('#held-messages-modal').modal('show');
+ },
+ error : function() {
+ alert(error_message);
+ },
+ statusCode: {
+ 500: function() {
+ alert(error_message);
+ }
+ }});
+ return false;
+ });
+ $('#toggle-full-message').click(function() {
+ if ($(this).hasClass('active')) {
+ $('#held-stripped-message').removeClass('hidden');
+ $('#held-full-message').addClass('hidden');
+ } else {
+ $('#held-stripped-message').addClass('hidden');
+ $('#held-full-message').removeClass('hidden');
+ }
+ });
+ $('#held-messages-modal').on('hidden.bs.modal', function() {
+ $('#held-stripped-message').removeClass('hidden');
+ $('#held-full-message').addClass('hidden');
+ $('#msg-title').html('');
+ $('#toggle-full-message').removeClass('active');
+ });
+}
diff --git a/src/postorius/templates/postorius/lists/held_messages.html b/src/postorius/templates/postorius/lists/held_messages.html
index 46d5de6..5543b11 100644
--- a/src/postorius/templates/postorius/lists/held_messages.html
+++ b/src/postorius/templates/postorius/lists/held_messages.html
@@ -1,6 +1,7 @@
{% extends postorius_base_template %}
{% load i18n %}
{% load nav_helpers %}
+{% load staticfiles %}
{% block subtitle %}
{% trans 'Held messages' %} | {{ list.fqdn_listname }}
@@ -55,26 +56,10 @@
{% trans 'There are currently no held messages.' %}
{% endif %} {% endblock %} {% block additionaljs %} + {% endblock %} diff --git a/src/postorius/urls.py b/src/postorius/urls.py index 8568480..0b7bf66 100644 --- a/src/postorius/urls.py +++ b/src/postorius/urls.py @@ -23,6 +23,7 @@ from postorius.views import list as list_views from postorius.views import user as user_views from postorius.views import domain as domain_views +from postorius.views import rest as rest_views list_patterns = [ @@ -105,4 +106,6 @@ url(r'^users/address_activation/(?P