commit 6b9f92c: [Minor] Fix maps list layout

moisseev moiseev at mezonplus.ru
Sat Jul 18 19:49:06 UTC 2020


Author: moisseev
Date: 2020-07-18 18:32:34 +0300
URL: https://github.com/rspamd/rspamd/commit/6b9f92c56a651178b9f03bdc3c3f6833cdf0c60a (refs/pull/3441/head)

[Minor] Fix maps list layout

---
 interface/css/rspamd.css   |  4 ----
 interface/index.html       |  2 +-
 interface/js/app/config.js | 13 +++++++------
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/interface/css/rspamd.css b/interface/css/rspamd.css
index d468696dc..6755a160e 100644
--- a/interface/css/rspamd.css
+++ b/interface/css/rspamd.css
@@ -285,10 +285,6 @@ table#symbolsTable input[type="number"] {
     background-color: #cddbff;
 }
 
-td.maps-cell {
-    vertical-align: middle;
-}
-
 .map-link {
     display: block;
     color: #0088cc;
diff --git a/interface/index.html b/interface/index.html
index c7b941c7e..163de31aa 100644
--- a/interface/index.html
+++ b/interface/index.html
@@ -221,7 +221,7 @@
 						<span class="h6 font-weight-bolder my-2">Lists</span>
 					</div>
 					<div class="card-body nopadding">
-						<table class="table table-sm table-hover" id="listMaps">
+						<table class="table table-sm table-hover mb-0" id="listMaps">
 						</table>
 					</div>
 				</div>
diff --git a/interface/js/app/config.js b/interface/js/app/config.js
index 2c65bfff1..8b391582b 100644
--- a/interface/js/app/config.js
+++ b/interface/js/app/config.js
@@ -137,12 +137,13 @@ define(["jquery", "codejar", "linenumbers", "prism"],
                     var $tbody = $("<tbody>");
 
                     $.each(data, function (i, item) {
-                        var label = (item.editable === false || rspamd.read_only)
-                            ? "<span class=\"badge badge-secondary\">Read</span>"
-                            : "<span class=\"badge badge-secondary\">Read</span> <span class=\"badge badge-success\">Write</span>";
-                        var $tr = $("<tr>");
-                        $("<td class=\"col-lg-2 maps-cell\">" + label + "</td>").appendTo($tr);
-                        var $span = $("<span class=\"map-link\" data-toggle=\"modal\" data-target=\"#modalDialog\">" + item.uri + "</span>").data("item", item);
+                        var $td = '<td><span class="badge badge-secondary">Read</span></td>';
+                        if (!(item.editable === false || rspamd.read_only)) {
+                            $td = $($td).append(' <span class="badge badge-success">Write</span>');
+                        }
+                        var $tr = $("<tr>").append($td);
+
+                        var $span = $('<span class="map-link" data-toggle="modal" data-target="#modalDialog">' + item.uri + "</span>").data("item", item);
                         $span.wrap("<td>").parent().appendTo($tr);
                         $("<td>" + item.description + "</td>").appendTo($tr);
                         $tr.appendTo($tbody);


More information about the Commits mailing list