aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app/config.js
diff options
context:
space:
mode:
Diffstat (limited to 'interface/js/app/config.js')
-rw-r--r--interface/js/app/config.js19
1 files changed, 3 insertions, 16 deletions
diff --git a/interface/js/app/config.js b/interface/js/app/config.js
index 8b391582b..082806088 100644
--- a/interface/js/app/config.js
+++ b/interface/js/app/config.js
@@ -33,27 +33,14 @@ define(["jquery", "codejar", "linenumbers", "prism"],
$("#actionsFormField").empty();
var items = [];
$.each(data[0].data, function (i, item) {
- var idx = -1;
- var label = null;
- if (item.action === "greylist") {
- label = "Greylist";
- idx = 0;
- } else if (item.action === "add header") {
- label = "Probably Spam";
- idx = 1;
- } else if (item.action === "rewrite subject") {
- label = "Rewrite subject";
- idx = 2;
- } else if (item.action === "reject") {
- label = "Spam";
- idx = 3;
- }
+ var actionsOrder = ["greylist", "add header", "rewrite subject", "reject"];
+ var idx = actionsOrder.indexOf(item.action);
if (idx >= 0) {
items.push({
idx: idx,
html:
'<div class="form-group">' +
- '<label class="col-form-label col-md-2 float-left">' + label + "</label>" +
+ '<label class="col-form-label col-md-2 float-left">' + item.action + "</label>" +
'<div class="controls slider-controls col-md-10">' +
'<input class="action-scores form-control" data-id="action" type="number" value="' +
item.value + '">' +