From 66947c4aaba2a3b6f64c0bd894d41af15614c01a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 19 Jul 2016 18:48:25 +0100 Subject: [PATCH] [Fix] Fix displaying of rewrite subject in WebUI --- interface/js/rspamd.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 6d6a7c5c5..1aa96e6fa 100644 --- a/interface/js/rspamd.js +++ b/interface/js/rspamd.js @@ -883,7 +883,7 @@ // Order of sliders greylist -> probable spam -> spam $('#actionsBody').empty(); $('#actionsForm').empty(); - items = []; + var items = []; var min = 0; var max = Number.MIN_VALUE; $.each(data, function (i, item) { @@ -897,18 +897,23 @@ label = 'Greylist'; idx = 0; } + else if (item.action === 'rewrite subject') { + label = 'Rewrite subject'; + idx = 2; + } else if (item.action === 'reject') { label = 'Spam'; - idx = 2; + idx = 3; } if (idx >= 0) { - items[idx] = - '
' + + items.push({idx: idx, + html: '
' + '' + '
' + '' + '
' + - '
'; + '
' + }); } if (item.value > max) { max = item.value * 2; @@ -918,7 +923,10 @@ } }); - $('#actionsBody').html('
' + items.join('') + + items.sort(function(a, b) { return a.idx - b.idx; }); + + $('#actionsBody').html('' + + items.map(function(e) { return e.html; }).join('') + '
' + '
'); -- 2.39.5