From 5ffbadc163e63fc3a06992813fea6ebcd3c91a80 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 23 Jun 2023 10:13:54 -0400 Subject: =?UTF-8?q?search=20form,=20"next=20=E2=9D=AF=E2=9D=AF"=20removed?= =?UTF-8?q?=20for=20initial=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 6 +++--- org/cgi_spine_search.org | 24 ++++++++++++++++-------- src/spine_search.d | 24 ++++++++++++++++-------- src/spine_search.d_ | 24 ++++++++++++++++-------- 4 files changed, 51 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index a1a200a..7c79c37 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1687245362, - "narHash": "sha256-+f9tH+k3u9lSS136M2LCsl5NJTNPvhmHEiVOcypiu1E=", + "lastModified": 1687488839, + "narHash": "sha256-7JDjuyHwUvGJJge9jxfRJkuYyL5G5yipspc4J3HwjGA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "205ee073b053fc4d87d5adf2ebd44ebbef7bca4d", + "rev": "f9e94676ce6c7531c44d38da61d2669ebec0f603", "type": "github" }, "original": { diff --git a/org/cgi_spine_search.org b/org/cgi_spine_search.org index 6b7d29d..561cba8 100644 --- a/org/cgi_spine_search.org +++ b/org/cgi_spine_search.org @@ -703,7 +703,11 @@ if (auto m = _url.matchFirst(rgx.track_offset)) { _url_previous = _url.replace(rgx.track_offset, _set_offset_previous); } } else { // _current_offset_value = 0; - _url_next = _url ~= "&smo=" ~ cv.sql_match_limit.to!string; + if ("query_string" in cgi.post) { + _url_next = _url ~= "&smo=" ~ cv.sql_match_limit.to!string; + } else { + _url_next = ""; + } } if (_url_previous.empty) { arrow_previous = ""; @@ -716,13 +720,17 @@ if (_url_previous.empty) { ~ "❮❮ prev" ~ " || "; } -arrow_next = - "" - ~ "" - ~ "next ❯❯" - ~ ""; +if (_url_next.empty) { + arrow_next = ""; +} else { + arrow_next = + "" + ~ "" + ~ "next ❯❯" + ~ ""; +} _previous_next = "
" ~ arrow_previous ~ arrow_next; return _previous_next; #+END_SRC diff --git a/src/spine_search.d b/src/spine_search.d index 57b817b..34b4fdf 100644 --- a/src/spine_search.d +++ b/src/spine_search.d @@ -522,7 +522,11 @@ void cgi_function_intro(Cgi cgi) { _url_previous = _url.replace(rgx.track_offset, _set_offset_previous); } } else { // _current_offset_value = 0; - _url_next = _url ~= "&smo=" ~ cv.sql_match_limit.to!string; + if ("query_string" in cgi.post) { + _url_next = _url ~= "&smo=" ~ cv.sql_match_limit.to!string; + } else { + _url_next = ""; + } } if (_url_previous.empty) { arrow_previous = ""; @@ -535,13 +539,17 @@ void cgi_function_intro(Cgi cgi) { ~ "❮❮ prev" ~ " || "; } - arrow_next = - "" - ~ "" - ~ "next ❯❯" - ~ ""; + if (_url_next.empty) { + arrow_next = ""; + } else { + arrow_next = + "" + ~ "" + ~ "next ❯❯" + ~ ""; + } _previous_next = "
" ~ arrow_previous ~ arrow_next; return _previous_next; } diff --git a/src/spine_search.d_ b/src/spine_search.d_ index d2c5e1f..e66eac0 100755 --- a/src/spine_search.d_ +++ b/src/spine_search.d_ @@ -524,7 +524,11 @@ void cgi_function_intro(Cgi cgi) { _url_previous = _url.replace(rgx.track_offset, _set_offset_previous); } } else { // _current_offset_value = 0; - _url_next = _url ~= "&smo=" ~ cv.sql_match_limit.to!string; + if ("query_string" in cgi.post) { + _url_next = _url ~= "&smo=" ~ cv.sql_match_limit.to!string; + } else { + _url_next = ""; + } } if (_url_previous.empty) { arrow_previous = ""; @@ -537,13 +541,17 @@ void cgi_function_intro(Cgi cgi) { ~ "❮❮ prev" ~ " || "; } - arrow_next = - "" - ~ "" - ~ "next ❯❯" - ~ ""; + if (_url_next.empty) { + arrow_next = ""; + } else { + arrow_next = + "" + ~ "" + ~ "next ❯❯" + ~ ""; + } _previous_next = "
" ~ arrow_previous ~ arrow_next; return _previous_next; } -- cgit v1.2.3