This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
commit 863d049ab4437cd94145f33682ac5027a95c86f3 Author: Sebb <[email protected]> AuthorDate: Tue Dec 28 11:45:07 2021 +0000 Add UI support for filtering by To and Body --- webui/js/source/search.js | 12 ++++++++++++ webui/list.html | 2 ++ 2 files changed, 14 insertions(+) diff --git a/webui/js/source/search.js b/webui/js/source/search.js index b334996..90bc0bd 100644 --- a/webui/js/source/search.js +++ b/webui/js/source/search.js @@ -36,6 +36,8 @@ function search(query, date) { let header_from = document.getElementById('header_from'); let header_subject = document.getElementById('header_subject'); + let header_to = document.getElementById('header_to'); + let header_body = document.getElementById('header_body'); let sURL = '%sapi/stats.lua?d=%s&list=%s&domain=%s&q=%s'.format(G_apiURL, date, list, domain, query); if (header_from.value.length > 0) { sURL += "&header_from=%s".format(encodeURIComponent(header_from.value)); @@ -47,6 +49,16 @@ function search(query, date) { newhref += "&header_subject=%s".format(header_subject.value); header_subject.value = ""; } + if (header_to.value.length > 0) { + sURL += "&header_to=%s".format(encodeURIComponent(header_to.value)); + newhref += "&header_to=%s".format(header_to.value); + header_to.value = ""; + } + if (header_body.value.length > 0) { + sURL += "&header_body=%s".format(encodeURIComponent(header_body.value)); + newhref += "&header_body=%s".format(header_body.value); + header_body.value = ""; + } GET(sURL, renderListView, { search: true, global: global diff --git a/webui/list.html b/webui/list.html index 64924ed..be8fa64 100644 --- a/webui/list.html +++ b/webui/list.html @@ -71,6 +71,8 @@ the License. --> <li><b>Advanced filters:</b><br/> <div style="display: inline-block; width: 120px;">Author: </div><span id='hd_from'><input title="Name or email address" style="min-width: 200px; margin-right: 10px; background-color: white; font-size: 8pt;" name="header_from" id='header_from' value=""/></span><br/> <div style="display: inline-block; width: 120px;">Subject: </div><span id='hd_subject'><input style="min-width: 200px; margin-right: 10px; background-color: white; font-size: 8pt;" name="header_subject" id='header_subject' value=""/></span><br/> + <div style="display: inline-block; width: 120px;">To: </div><span id='hd_to'><input title="Name or email address" style="min-width: 200px; margin-right: 10px; background-color: white; font-size: 8pt;" name="header_to" id='header_to' value=""/></span><br/> + <div style="display: inline-block; width: 120px;">Body: </div><span id='hd_body'><input style="min-width: 200px; margin-right: 10px; background-color: white; font-size: 8pt;" name="header_body" id='header_body' value=""/></span><br/> </li> </ul>
