iens

Manager of links to read
git clone https://git.instinctive.eu/iens.git
Log | Files | Refs | README | LICENSE

commit 5eb2cd368fd37389f10902a6e87486af1cb1f16e
parent 937b784204ef8cb8331648f939205ea215d51311
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date:   Tue, 24 Mar 2026 18:58:59 +0000

Button title of progressive loading refects context
Diffstat:
Msrc/cgi.scm | 16+++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/cgi.scm b/src/cgi.scm @@ -441,17 +441,19 @@ END-OF-CSS (define (new-fragment) (catch-up) - (let ((last-id (string->number (required-input-var "last-id")))) -(htmx-output - `(,@(query - (map-rows* post-fragment) - (sql db "SELECT id,mark,ptime,section,title,url FROM gruik WHERE id > ? AND mark >= 0;") - last-id) + (let* ((last-id (string->number (required-input-var "last-id"))) + (frags (query + (map-rows* post-fragment) + (sql db "SELECT id,mark,ptime,section,title,url FROM gruik WHERE id > ? AND mark >= 0;") + last-id)) + (btn (if (null? frags) "Recheck" "More"))) + (htmx-output + `(,@frags (form (@ (method GET) (action "new") (id "load-new") (hx-swap "outerHTML") (hx-post "x-new")) (input (@ (type "hidden") (name "last-id") (value ,(query fetch-value (sql db "SELECT MAX(id) FROM gruik;"))))) - (input (@ (type "submit") (name "submit") (value "Load")))) + (input (@ (type "submit") (name "submit") (value ,btn)))) )))) (define (new-view)