From 160dceff3e11a5cba2f65db7152d073e28a67266 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Thu, 19 May 2022 15:06:18 +0200 Subject: [PATCH] [BS5] Replace FooTable with jquery Datatables --- data/web/js/site/admin.js | 513 ++++++++++-------- data/web/js/site/quarantine.js | 146 ++--- data/web/quarantine.php | 1 + .../templates/admin/tab-config-admins.twig | 4 +- .../templates/admin/tab-config-fwdhosts.twig | 4 +- .../templates/admin/tab-config-oauth2.twig | 4 +- data/web/templates/admin/tab-mailq.twig | 4 +- data/web/templates/admin/tab-routing.twig | 8 +- data/web/templates/mailbox/tab-bcc.twig | 66 +-- .../templates/mailbox/tab-domain-aliases.twig | 28 +- data/web/templates/mailbox/tab-domains.twig | 32 +- data/web/templates/mailbox/tab-filters.twig | 106 ++-- data/web/templates/mailbox/tab-mailboxes.twig | 150 ++--- .../templates/mailbox/tab-mbox-aliases.twig | 44 +- data/web/templates/mailbox/tab-resources.twig | 36 +- data/web/templates/mailbox/tab-syncjobs.twig | 32 +- .../web/templates/mailbox/tab-tls-policy.twig | 30 +- data/web/templates/quarantine.twig | 54 +- 18 files changed, 663 insertions(+), 599 deletions(-) diff --git a/data/web/js/site/admin.js b/data/web/js/site/admin.js index f98a004a..677cd675 100644 --- a/data/web/js/site/admin.js +++ b/data/web/js/site/admin.js @@ -63,13 +63,6 @@ jQuery(function($){ draw_table = $(this).data('draw'); eval(draw_table + '()'); }); - function table_admin_ready(ft, name) { - heading = ft.$el.parents('.card').find('.card-header') - var ft_paging = ft.use(FooTable.Paging) - $(heading).children('.table-lines').text(function(){ - return ft_paging.totalRows; - }) - } function draw_domain_admins() { $('#domainadminstable').DataTable({ processing: true, @@ -78,12 +71,23 @@ jQuery(function($){ ajax: { type: "GET", url: "/api/v1/get/domain-admin/all", - dataSrc: function(json){ - console.log(json); - return json; + dataSrc: function(data){ + return process_table_data(data, 'domainadminstable'); } }, columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, { title: lang.username, data: 'username', @@ -113,74 +117,57 @@ jQuery(function($){ }, { title: lang.action, - data: null, - render: function (data, type) { - return `
- - Bearbeiten - - - Entfernen - -
`; - } + data: 'action' }, ] }); - - // ft_domainadmins = FooTable.init('#domainadminstable', { - // "columns": [ - // {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - // {"sorted": true,"name":"username","title":lang.username,"style":{"width":"250px"}}, - // {"name":"selected_domains","title":lang.admin_domains,"breakpoints":"xs sm"}, - // {"name":"tfa_active","title":"TFA", "filterable": false,"style":{"maxWidth":"80px","width":"80px"},"formatter": function(value){return 1==value?'':0==value&&'';}}, - // {"name":"active","filterable": false,"style":{"maxWidth":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'':0==value&&'';}}, - // {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"250px","width":"250px"},"type":"html","title":lang.action,"breakpoints":"xs sm"} - // ], - // "rows": $.ajax({ - // dataType: 'json', - // url: '/api/v1/get/domain-admin/all', - // jsonp: false, - // error: function () { - // console.log('Cannot draw domain admin table'); - // }, - // success: function (data) { - // return process_table_data(data, 'domainadminstable'); - // } - // }), - // "empty": lang.empty, - // "paging": {"enabled": true,"limit": 5,"size": log_pagination_size}, - // "state": {"enabled": true}, - // "filtering": {"enabled": true,"delay": 1200,"position": "left","connectors": false,"placeholder": lang.filter_table}, - // "sorting": {"enabled": true}, - // "toggleSelector": "table tbody span.footable-toggle" - // }); } function draw_oauth2_clients() { - ft_oauth2clientstable = FooTable.init('#oauth2clientstable', { - "columns": [ - {"name":"chkbox","title":"","style":{"maxWidth":"40px","width":"40px"},"filterable": false,"sortable": false,"type":"html"}, - {"name":"id","type":"text","title":"ID","style":{"width":"50px"}}, - {"name":"client_id","type":"text","title":lang.oauth2_client_id,"style":{"width":"200px"}}, - {"name":"client_secret","title":lang.oauth2_client_secret,"breakpoints":"xs sm md","style":{"width":"200px"}}, - {"name":"redirect_uri","title":lang.oauth2_redirect_uri, "type": "text"}, - {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"} - ], - "rows": $.ajax({ - dataType: 'json', - url: '/api/v1/get/oauth2-client/all', - jsonp: false, - error: function () { - console.log('Cannot draw oauth2 clients table'); - }, - success: function (data) { + $('#oauth2clientstable').DataTable({ + processing: true, + serverSide: false, + language: lang_datatables, + ajax: { + type: "GET", + url: "/api/v1/get/oauth2-client/all", + dataSrc: function(data){ return process_table_data(data, 'oauth2clientstable'); } - }), - "empty": lang.empty, - "paging": {"enabled": true,"limit": 5,"size": log_pagination_size}, - "sorting": {"enabled": true}, - "toggleSelector": "table tbody span.footable-toggle" + }, + columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, + { + title: 'ID', + data: 'id', + }, + { + title: lang.oauth2_client_id, + data: 'client_id' + }, + { + title: lang.oauth2_client_secret, + data: 'client_secret' + }, + { + title: lang.oauth2_redirect_uri, + data: 'redirect_uri' + }, + { + title: lang.action, + data: 'action' + }, + ] }); } function draw_admins() { @@ -191,11 +178,23 @@ jQuery(function($){ ajax: { type: "GET", url: "/api/v1/get/admin/all", - dataSrc: function(json){ - return json; + dataSrc: function(data){ + return process_table_data(data, 'adminstable'); } }, columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, { title: lang.username, data: 'username', @@ -218,169 +217,220 @@ jQuery(function($){ }, { title: lang.action, - data: null, - render: function (data, type) { - return `
- - Bearbeiten - - - Entfernen - -
`; - } + data: 'action' }, ] }); - - // ft_admins = FooTable.init('#adminstable', { - // "columns": [ - // {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - // {"sorted": true,"name":"usr","title":lang.username,"style":{"width":"250px"}}, - // {"name":"tfa_active","title":"TFA", "filterable": false,"style":{"maxWidth":"80px","width":"80px"},"formatter": function(value){return 1==value?'':0==value&&'';}}, - // {"name":"active","filterable": false,"style":{"maxWidth":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'':0==value&&'';}}, - // {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"250px","width":"250px"},"type":"html","title":lang.action,"breakpoints":"xs sm"} - // ], - // "rows": $.ajax({ - // dataType: 'json', - // url: '/api/v1/get/admin/all', - // jsonp: false, - // error: function () { - // console.log('Cannot draw admin table'); - // }, - // success: function (data) { - // return process_table_data(data, 'adminstable'); - // } - // }), - // "empty": lang.empty, - // "paging": {"enabled": true,"limit": 5,"size": log_pagination_size}, - // "filtering": {"enabled": false}, - // "state": {"enabled": true}, - // "sorting": {"enabled": true}, - // "toggleSelector": "table tbody span.footable-toggle" - // }); } function draw_fwd_hosts() { - ft_forwardinghoststable = FooTable.init('#forwardinghoststable', { - "columns": [ - {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - {"name":"host","type":"text","title":lang.host,"style":{"width":"250px"}}, - {"name":"source","title":lang.source,"breakpoints":"xs sm"}, - {"name":"keep_spam","title":lang.spamfilter, "type": "text","style":{"maxWidth":"80px","width":"80px"},"formatter": function(value){return 'yes'==value?'':'no'==value&&'';}}, - {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"} - ], - "rows": $.ajax({ - dataType: 'json', - url: '/api/v1/get/fwdhost/all', - jsonp: false, - error: function () { - console.log('Cannot draw forwarding hosts table'); - }, - success: function (data) { + $('#forwardinghoststable').DataTable({ + processing: true, + serverSide: false, + language: lang_datatables, + ajax: { + type: "GET", + url: "/api/v1/get/fwdhost/all", + dataSrc: function(data){ return process_table_data(data, 'forwardinghoststable'); } - }), - "empty": lang.empty, - "paging": {"enabled": true,"limit": 5,"size": log_pagination_size}, - "sorting": {"enabled": true}, - "toggleSelector": "table tbody span.footable-toggle" + }, + columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, + { + title: lang.host, + data: 'host', + }, + { + title: lang.source, + data: 'source' + }, + { + title: lang.spamfilter, + data: 'keep_spam' + }, + { + title: lang.action, + data: 'action' + }, + ] }); } function draw_relayhosts() { - ft_relayhoststable = FooTable.init('#relayhoststable', { - "columns": [ - {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - {"name":"id","type":"text","title":"ID","style":{"width":"50px"}}, - {"name":"hostname","type":"text","title":lang.host,"style":{"width":"250px"}}, - {"name":"username","title":lang.username,"breakpoints":"xs sm"}, - {"name":"in_use_by","title":lang.in_use_by,"style":{"min-width":"200px","width":"200px"}, "type": "text","breakpoints":"xs sm"}, - {"name":"active","filterable": false,"style":{"maxWidth":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'':0==value&&'';}}, - {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","min-width":"250px","width":"250px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"} - ], - "rows": $.ajax({ - dataType: 'json', - url: '/api/v1/get/relayhost/all', - jsonp: false, - error: function () { - console.log('Cannot draw forwarding hosts table'); - }, - success: function (data) { + $('#relayhoststable').DataTable({ + processing: true, + serverSide: false, + language: lang_datatables, + ajax: { + type: "GET", + url: "/api/v1/get/relayhost/all", + dataSrc: function(data){ return process_table_data(data, 'relayhoststable'); } - }), - "empty": lang.empty, - "paging": {"enabled": true,"limit": 5,"size": log_pagination_size}, - "sorting": {"enabled": true}, - "toggleSelector": "table tbody span.footable-toggle" + }, + columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, + { + title: 'ID', + data: 'id', + }, + { + title: lang.host, + data: 'hostname' + }, + { + title: lang.username, + data: 'username' + }, + { + title: lang.in_use_by, + data: 'in_use_by' + }, + { + title: lang.active, + data: 'active' + }, + { + title: lang.action, + data: 'action' + }, + ] }); } function draw_transport_maps() { - ft_transportstable = FooTable.init('#transportstable', { - "columns": [ - {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - {"name":"id","type":"text","title":"ID","style":{"width":"50px"}}, - {"name":"destination","type":"text","title":lang.destination,"style":{"min-width":"300px","width":"300px"}}, - {"name":"nexthop","type":"text","title":lang.nexthop,"style":{"min-width":"200px","width":"200px"}}, - {"name":"username","title":lang.username,"breakpoints":"xs sm"}, - {"name":"active","filterable": false,"style":{"maxWidth":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'':0==value&&'';}}, - {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","min-width":"250px","width":"250px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"} - ], - "rows": $.ajax({ - dataType: 'json', - url: '/api/v1/get/transport/all', - jsonp: false, - error: function () { - console.log('Cannot draw transports table'); - }, - success: function (data) { + $('#transportstable').DataTable({ + processing: true, + serverSide: false, + language: lang_datatables, + ajax: { + type: "GET", + url: "/api/v1/get/transport/all", + dataSrc: function(data){ return process_table_data(data, 'transportstable'); } - }), - "empty": lang.empty, - "paging": {"enabled": true,"limit": 5,"size": log_pagination_size}, - "sorting": {"enabled": true}, - "toggleSelector": "table tbody span.footable-toggle", - "on": { - "ready.ft.table": function(e, ft){ - $('.mx-info').tooltip(); - } - } + }, + columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, + { + title: 'ID', + data: 'id', + }, + { + title: lang.destination, + data: 'destination' + }, + { + title: lang.nexthop, + data: 'nexthop' + }, + { + title: lang.username, + data: 'username' + }, + { + title: lang.active, + data: 'active' + }, + { + title: lang.action, + data: 'action' + }, + ] }); } function draw_queue() { - ft_queuetable = FooTable.init('#queuetable', { - "columns": [ - {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - {"name":"queue_id","type":"text","title":"QID","style":{"width":"50px"}}, - {"name":"queue_name","type":"text","title":"Queue","style":{"width":"120px"}}, - {"name":"arrival_time","sorted": true,"direction": "DESC","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.arrival_time,"style":{"width":"170px"}}, - {"name":"message_size","style":{"whiteSpace":"nowrap"},"title":lang.message_size,"formatter": function(value){ - return humanFileSize(value); - }}, - {"name":"sender","title":lang.sender, "type": "text","breakpoints":"xs sm"}, - {"name":"recipients","title":lang.recipients, "type": "text","style":{"word-break":"break-all","min-width":"300px"},"breakpoints":"xs sm md"}, - {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"220px","width":"220px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"} - ], - "rows": $.ajax({ - dataType: 'json', - url: '/api/v1/get/mailq/all', - jsonp: false, - error: function () { - console.log('Cannot draw forwarding hosts table'); - }, - success: function (data) { + $('#queuetable').DataTable({ + processing: true, + serverSide: false, + language: lang_datatables, + ajax: { + type: "GET", + url: "/api/v1/get/mailq/all", + dataSrc: function(data){ return process_table_data(data, 'queuetable'); } - }), - "empty": lang.empty, - "paging": {"enabled": true,"limit": 5,"size": log_pagination_size}, - "sorting": {"enabled": true}, - "toggleSelector": "table tbody span.footable-toggle", - "on": { - "ready.ft.table": function(e, ft){ - table_admin_ready(ft, 'queuetable'); - } - } + }, + columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, + { + title: 'QID', + data: 'queue_id', + }, + { + title: 'Queue', + data: 'queue_name' + }, + { + title: lang.arrival_time, + data: 'arrival_time', + render: function (data, type){ + var date = new Date(data ? data * 1000 : 0); + return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); + } + }, + { + title: lang.message_size, + data: 'message_size', + render: function (data, type){ + return humanFileSize(data); + } + }, + { + title: lang.sender, + data: 'sender' + }, + { + title: lang.recipients, + data: 'recipients' + }, + { + title: lang.action, + data: 'action' + }, + ] }); } @@ -467,14 +517,33 @@ jQuery(function($){ } return data }; - // // Initial table drawings - draw_domain_admins(); - draw_admins(); - // draw_fwd_hosts(); - // draw_relayhosts(); - // draw_oauth2_clients(); - // draw_transport_maps(); - // draw_queue(); + + // detect element visibility changes + function onVisible(element, callback) { + $(element).ready(function() { + element_object = document.querySelector(element) + new IntersectionObserver((entries, observer) => { + entries.forEach(entry => { + if(entry.intersectionRatio > 0) { + callback(element_object); + observer.disconnect(); + } + }); + }).observe(element_object); + }); + } + // Draw Table if tab is active + onVisible("[id^=tab-config-admins]", () => { + draw_admins(); + draw_domain_admins(); + }); + onVisible("[id^=tab-config-oauth2]", () => draw_oauth2_clients()); + onVisible("[id^=tab-config-fwdhosts]", () => draw_fwd_hosts()); + onVisible("[id^=tab-routing]", () => { + draw_relayhosts(); + draw_transport_maps(); + }); + onVisible("[id^=tab-mailq]", () => draw_queue()); $('body').on('click', 'span.footable-toggle', function () { diff --git a/data/web/js/site/quarantine.js b/data/web/js/site/quarantine.js index 4b37390a..792c76ed 100644 --- a/data/web/js/site/quarantine.js +++ b/data/web/js/site/quarantine.js @@ -7,67 +7,20 @@ jQuery(function($){ var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="}; function escapeHtml(n){return String(n).replace(/[&<>"'`=\/]/g,function(n){return entityMap[n]})} function humanFileSize(i){if(Math.abs(i)<1024)return i+" B";var B=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],e=-1;do{i/=1024,++e}while(Math.abs(i)>=1024&&e n_results) { - new_size = n_results; - } - return new_size + ' / ' + n_results; - }) - }); $(".refresh_table").on('click', function(e) { e.preventDefault(); var table_name = $(this).data('table'); - $('#' + table_name).find("tr.footable-empty").remove(); - draw_table = $(this).data('draw'); - eval(draw_table + '()'); + $('#' + table_name).DataTable().ajax.reload(); }); - function table_quarantine_ready(ft, name) { - $('.refresh_table').prop("disabled", false); - heading = ft.$el.parents('.card').find('.card-header') - var ft_paging = ft.use(FooTable.Paging) - $(heading).children('.table-lines').text(function(){ - var total_rows = ft_paging.totalRows; - var size = ft_paging.size; - if (size > total_rows) { - size = total_rows; - } - return size + ' / ' + total_rows; - }) - } function draw_quarantine_table() { - ft_quarantinetable = FooTable.init('#quarantinetable', { - "columns": [ - {"name":"chkbox","title":"","style":{"maxWidth":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - {"name":"id","type":"ID","filterable": false,"sorted": true,"direction":"DESC","title":"ID","style":{"width":"50px"}}, - {"name":"qid","breakpoints":"all","type":"text","title":lang.qid,"style":{"width":"125px"}}, - {"name":"sender","title":lang.sender}, - {"name":"subject","title":lang.subj, "type": "text"}, - {"name":"rspamdaction","title":lang.rspamd_result, "type": "html"}, - {"name":"rcpt","title":lang.rcpt, "type": "text"}, - {"name":"virus","title":lang.danger, "type": "text"}, - {"name":"score","title": lang.spam_score, "type": "text"}, - {"name":"notified","title":lang.notified, "type": "text"}, - {"name":"created","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.received,"style":{"width":"170px"}}, - {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right"},"style":{"min-width":"250px"},"type":"html","title":lang.action,"breakpoints":"xs sm md"} - ], - "rows": $.ajax({ - dataType: 'json', - url: '/api/v1/get/quarantine/all', - jsonp: false, - error: function () { - console.log('Cannot draw quarantine table'); - }, - success: function (data) { + $('#quarantinetable').DataTable({ + processing: true, + serverSide: false, + language: lang_datatables, + ajax: { + type: "GET", + url: "/api/v1/get/quarantine/all", + dataSrc: function(data){ $.each(data, function (i, item) { if (item.subject === null) { item.subject = ''; @@ -107,25 +60,72 @@ jQuery(function($){ } item.chkbox = ''; }); - } - }), - "empty": lang.empty, - "paging": {"enabled": true,"limit": 5,"size": pagination_size}, - "state": {"enabled": true}, - "sorting": {"enabled": true}, - "filtering": {"enabled": true,"position": "left","connectors": false,"placeholder": lang.filter_table}, - "toggleSelector": "table tbody span.footable-toggle", - "on": { - "destroy.ft.table": function(e, ft){ - $('.refresh_table').attr('disabled', 'true'); - }, - "ready.ft.table": function(e, ft){ - table_quarantine_ready(ft, 'quarantinetable'); - }, - "after.ft.filtering": function(e, ft){ - table_quarantine_ready(ft, 'quarantinetable'); + + return data; } }, + columns: [ + { + // placeholder, so checkbox will not block child row toggle + title: '', + data: null, + searchable: false, + orderable: false, + defaultContent: '' + }, + { + title: '', + data: 'chkbox' + }, + { + title: 'ID', + data: 'id', + }, + { + title: lang.qid, + data: 'qid' + }, + { + title: lang.sender, + data: 'sender' + }, + { + title: lang.subj, + data: 'sender' + }, + { + title: lang.rspamd_result, + data: 'rspamdaction' + }, + { + title: lang.rcpt, + data: 'rcpt' + }, + { + title: lang.danger, + data: 'virus' + }, + { + title: lang.spam_score, + data: 'score' + }, + { + title: lang.notified, + data: 'notified' + }, + { + title: lang.received, + data: 'created', + render: function (data,type) { + var date = new Date(data ? data * 1000 : 0); + return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); + } + }, + { + title: lang.action, + data: 'action' + }, + ] }); } diff --git a/data/web/quarantine.php b/data/web/quarantine.php index 4a537e50..8e0635de 100644 --- a/data/web/quarantine.php +++ b/data/web/quarantine.php @@ -21,6 +21,7 @@ $template_data = [ 'role' => $role, 'quarantine_settings' => $quarantine_settings, 'lang_quarantine' => json_encode($lang['quarantine']), + 'lang_datatables' => json_encode($lang['datatables']), ]; require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php'; diff --git a/data/web/templates/admin/tab-config-admins.twig b/data/web/templates/admin/tab-config-admins.twig index bf946029..004017de 100644 --- a/data/web/templates/admin/tab-config-admins.twig +++ b/data/web/templates/admin/tab-config-admins.twig @@ -1,8 +1,8 @@
{{ lang.admin.admin_details }}
-
+
{{ lang.mailbox.toggle_all }} @@ -223,8 +223,8 @@
{{ lang.admin.domain_admins }}
-
+
{{ lang.mailbox.toggle_all }} diff --git a/data/web/templates/admin/tab-config-fwdhosts.twig b/data/web/templates/admin/tab-config-fwdhosts.twig index 43300297..9326e185 100644 --- a/data/web/templates/admin/tab-config-fwdhosts.twig +++ b/data/web/templates/admin/tab-config-fwdhosts.twig @@ -3,9 +3,7 @@
{{ lang.admin.forwarding_hosts }}

{{ lang.admin.forwarding_hosts_hint }}

-
-
-
+
diff --git a/data/web/templates/admin/tab-config-oauth2.twig b/data/web/templates/admin/tab-config-oauth2.twig index 5f2cb140..d0795442 100644 --- a/data/web/templates/admin/tab-config-oauth2.twig +++ b/data/web/templates/admin/tab-config-oauth2.twig @@ -3,9 +3,7 @@
{{ lang.admin.oauth2_apps }}

{{ lang.admin.oauth2_info|raw }}

-
-
-
+
{{ lang.mailbox.toggle_all }} diff --git a/data/web/templates/admin/tab-mailq.twig b/data/web/templates/admin/tab-mailq.twig index db039431..20055626 100644 --- a/data/web/templates/admin/tab-mailq.twig +++ b/data/web/templates/admin/tab-mailq.twig @@ -7,9 +7,7 @@
-
-
-
+
{{ lang.mailbox.toggle_all }} diff --git a/data/web/templates/admin/tab-routing.twig b/data/web/templates/admin/tab-routing.twig index 7e31fd3d..81328554 100644 --- a/data/web/templates/admin/tab-routing.twig +++ b/data/web/templates/admin/tab-routing.twig @@ -3,9 +3,7 @@
{{ lang.admin.relayhosts }}

{{ lang.admin.relayhosts_hint|raw }}

-
-
-
+
@@ -46,9 +44,7 @@
{{ lang.admin.transport_maps }}

{{ lang.admin.transports_hint|raw }}

-
-
-
+
diff --git a/data/web/templates/mailbox/tab-bcc.twig b/data/web/templates/mailbox/tab-bcc.twig index 3dc2e91d..0fbeed03 100644 --- a/data/web/templates/mailbox/tab-bcc.twig +++ b/data/web/templates/mailbox/tab-bcc.twig @@ -7,23 +7,25 @@
-

{{ lang.mailbox.bcc_info|raw }}

-{#
#} -
-
-

{{ lang.mailbox.recipient_map_info }}

- {#
#} -
+
+

{{ lang.mailbox.recipient_map_info }}

+ {#
#}
-
- diff --git a/data/web/templates/mailbox/tab-domain-aliases.twig b/data/web/templates/mailbox/tab-domain-aliases.twig index 22d7b96e..c05ba01b 100644 --- a/data/web/templates/mailbox/tab-domain-aliases.twig +++ b/data/web/templates/mailbox/tab-domain-aliases.twig @@ -7,19 +7,21 @@
-{#
#} -
-
- diff --git a/data/web/templates/mailbox/tab-domains.twig b/data/web/templates/mailbox/tab-domains.twig index 36473070..600abc96 100644 --- a/data/web/templates/mailbox/tab-domains.twig +++ b/data/web/templates/mailbox/tab-domains.twig @@ -9,23 +9,25 @@
-{#
#} -
-
diff --git a/data/web/templates/mailbox/tab-filters.twig b/data/web/templates/mailbox/tab-filters.twig index e0c7d1e5..d74333e6 100644 --- a/data/web/templates/mailbox/tab-filters.twig +++ b/data/web/templates/mailbox/tab-filters.twig @@ -9,64 +9,64 @@

{{ lang.mailbox.sieve_info|raw }}


-
-{#
#} -
-
- -
-
-
-
Global Prefilter
-
-
-
- -
-
-
-
-
- - +
+
+
+
Global Prefilter
+ +
+
+ +
-
-
- -
-
-
Global Postfilter
-
-
-
- -
-
-
-
-
- - +
+
+
+ + +
+
-
+
- +
+
Global Postfilter
+
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
-
diff --git a/data/web/templates/mailbox/tab-mailboxes.twig b/data/web/templates/mailbox/tab-mailboxes.twig index c6999a12..2c20a1e8 100644 --- a/data/web/templates/mailbox/tab-mailboxes.twig +++ b/data/web/templates/mailbox/tab-mailboxes.twig @@ -7,66 +7,19 @@
-
-
-
- -
- {{ lang.mailbox.toggle_all }} -
- {{ lang.mailbox.mailbox }} +
+
+
+
+ -
- TLS - -
- -
diff --git a/data/web/templates/mailbox/tab-mbox-aliases.twig b/data/web/templates/mailbox/tab-mbox-aliases.twig index 6e3a43e7..fb900ba7 100644 --- a/data/web/templates/mailbox/tab-mbox-aliases.twig +++ b/data/web/templates/mailbox/tab-mbox-aliases.twig @@ -7,28 +7,28 @@
-
- {{ lang.mailbox.alias_domain_alias_hint|raw }} -
- -
-
- diff --git a/data/web/templates/mailbox/tab-resources.twig b/data/web/templates/mailbox/tab-resources.twig index 7e633532..ea047d6f 100644 --- a/data/web/templates/mailbox/tab-resources.twig +++ b/data/web/templates/mailbox/tab-resources.twig @@ -7,24 +7,24 @@
-
-

{{ lang.mailbox.booking_0_short }} - {{ lang.mailbox.booking_null }}

-

{{ lang.mailbox.booking_lt0_short }} - {{ lang.mailbox.booking_ltnull }}

-

{{ lang.mailbox.booking_custom_short }} - {{ lang.mailbox.booking_custom }}

-
-{#
#} -
-
-
- {{ lang.mailbox.toggle_all }} - {{ lang.mailbox.quick_actions }} - - {{ lang.mailbox.add_resource }} +
+

{{ lang.mailbox.booking_0_short }} - {{ lang.mailbox.booking_null }}

+

{{ lang.mailbox.booking_lt0_short }} - {{ lang.mailbox.booking_ltnull }}

+

{{ lang.mailbox.booking_custom_short }} - {{ lang.mailbox.booking_custom }}

+ {#
#} +
+
diff --git a/data/web/templates/mailbox/tab-syncjobs.twig b/data/web/templates/mailbox/tab-syncjobs.twig index 18ccf31e..13bf3c75 100644 --- a/data/web/templates/mailbox/tab-syncjobs.twig +++ b/data/web/templates/mailbox/tab-syncjobs.twig @@ -7,21 +7,23 @@
- -
-
- diff --git a/data/web/templates/mailbox/tab-tls-policy.twig b/data/web/templates/mailbox/tab-tls-policy.twig index d4a02a03..acb74d4e 100644 --- a/data/web/templates/mailbox/tab-tls-policy.twig +++ b/data/web/templates/mailbox/tab-tls-policy.twig @@ -7,20 +7,22 @@
-

{{ lang.mailbox.tls_policy_maps_info|raw }}

-{#
#} -
-
- diff --git a/data/web/templates/quarantine.twig b/data/web/templates/quarantine.twig index c0414fd9..9908bd2d 100644 --- a/data/web/templates/quarantine.twig +++ b/data/web/templates/quarantine.twig @@ -8,41 +8,32 @@ {{ lang.quarantine.quarantine }}
-

{{ lang.quarantine.qinfo|raw }}

-

- {% if not quarantine_settings.retention_size or not quarantine_settings.max_size %} -

{{ lang.quarantine.disabled_by_config }}
- {% else %} -

- {{ lang.quarantine.settings_info|format(quarantine_settings.retention_size, quarantine_settings.max_size)|raw }} +

+

{{ lang.quarantine.qinfo|raw }}

+

+ {% if not quarantine_settings.retention_size or not quarantine_settings.max_size %} +

{{ lang.quarantine.disabled_by_config }}
+ {% else %} +

+ {{ lang.quarantine.settings_info|format(quarantine_settings.retention_size, quarantine_settings.max_size)|raw }} +

+ {% endif %}

- {% endif %} -

-
-
- @@ -54,6 +45,7 @@