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
The following commit(s) were added to refs/heads/master by this push:
new 2d285fd Better display when no topics
2d285fd is described below
commit 2d285fde352c441adf5173c3bcbbb34e60896da5
Author: Sebb <[email protected]>
AuthorDate: Wed Sep 15 14:41:53 2021 +0100
Better display when no topics
---
webui/js/ponymail.js | 6 +++++-
webui/js/source/listview-header.js | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index b87c101..3a0dd5d 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -2047,7 +2047,11 @@ function listview_header(state, json) {
if (state && state.pos) {
first = 1 + state.pos;
}
- chevrons.innerHTML = "Showing <b>%u through %u</b> of <b>%u</b>
topics ".format(first, Math.min(first + per_page - 1, blobs.length),
blobs.length||0);
+ if (blobs.length == 0) {
+ chevrons.innerHTML = "No topics to show";
+ } else {
+ chevrons.innerHTML = "Showing <b>%u through %u</b> of <b>%u</b>
topics ".format(first, Math.min(first + per_page - 1, blobs.length),
blobs.length||0);
+ }
let pprev = Math.max(0, first - per_page - 1);
let cback = new HTML('button', { onclick: 'listview_header({pos: %u},
current_json);'.format(pprev), disabled: (first == 1) ? 'true': null}, new
HTML('span', {class: 'glyphicon glyphicon-chevron-left'}, " "));
diff --git a/webui/js/source/listview-header.js
b/webui/js/source/listview-header.js
index 13353e5..1e04b39 100644
--- a/webui/js/source/listview-header.js
+++ b/webui/js/source/listview-header.js
@@ -59,7 +59,11 @@ function listview_header(state, json) {
if (state && state.pos) {
first = 1 + state.pos;
}
- chevrons.innerHTML = "Showing <b>%u through %u</b> of <b>%u</b>
topics ".format(first, Math.min(first + per_page - 1, blobs.length),
blobs.length||0);
+ if (blobs.length == 0) {
+ chevrons.innerHTML = "No topics to show";
+ } else {
+ chevrons.innerHTML = "Showing <b>%u through %u</b> of <b>%u</b>
topics ".format(first, Math.min(first + per_page - 1, blobs.length),
blobs.length||0);
+ }
let pprev = Math.max(0, first - per_page - 1);
let cback = new HTML('button', { onclick: 'listview_header({pos: %u},
current_json);'.format(pprev), disabled: (first == 1) ? 'true': null}, new
HTML('span', {class: 'glyphicon glyphicon-chevron-left'}, " "));