From 0137f0f4dcf93760295399ed2dd5abf883fefa62 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 20 Jan 2022 08:53:13 -0800 Subject: [PATCH] webapps.help: improve when no results found --- extra/webapps/help/help.factor | 15 +++++++++------ extra/webapps/help/search.css | 6 +++++- extra/webapps/help/search.xml | 16 ++++++++++------ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/extra/webapps/help/help.factor b/extra/webapps/help/help.factor index 7f47acf748..19b8961098 100644 --- a/extra/webapps/help/help.factor +++ b/extra/webapps/help/help.factor @@ -9,19 +9,22 @@ IN: webapps.help TUPLE: help-webapp < dispatcher ; -: links ( seq -- seq' ) +: links ( apropos -- seq ) [ swap ] { } assoc>map ; +: ?links ( has-links? apropos -- has-links? seq ) + links [ empty? not or ] keep ; + :: ( help-dir -- action ) { help-webapp "search" } >>template [ "search" param [ unicode:blank? ] trim [ - help-dir [ - [ article-apropos links "articles" set-value ] - [ word-apropos links "words" set-value ] - [ vocab-apropos links "vocabs" set-value ] tri - ] with-directory + f help-dir [ + [ article-apropos ?links "articles" set-value ] + [ word-apropos ?links "words" set-value ] + [ vocab-apropos ?links "vocabs" set-value ] tri + ] with-directory "empty" set-value ] unless-empty help-navbar "navbar" set-value diff --git a/extra/webapps/help/search.css b/extra/webapps/help/search.css index 7212876257..e35bb0513e 100644 --- a/extra/webapps/help/search.css +++ b/extra/webapps/help/search.css @@ -19,15 +19,18 @@ color: #7f7f7f; text-align: center; border: 1px solid #ccc; + border-bottom: none; } .label:hover { background: #d8d8d8; border: 1px solid #ccc; + border-bottom: none; } .radiotab:checked + .label { border: 1px solid #ccc; + border-bottom: none; background: #f0f0f0; color: black; } @@ -35,6 +38,7 @@ .panel { display: none; width: 100%; + border-top: 1px solid #ccc; } .radiotab:checked + .label + .panel { @@ -50,6 +54,6 @@ .label { width: 33.33%; border: 1px solid white; - border-bottom: 1px solid #ccc; + border-bottom: none; } } diff --git a/extra/webapps/help/search.xml b/extra/webapps/help/search.xml index 928def0a1d..858bfbba63 100644 --- a/extra/webapps/help/search.xml +++ b/extra/webapps/help/search.xml @@ -11,41 +11,45 @@
+
-
-
+
+
-
-
+
+
-
-
+
+ + +

No results found!

+
-- 2.34.1