From 437e3e7c363a0f876e551609518718bce2c89218 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 20 Apr 2020 13:12:53 -0400 Subject: cgi search form title --- org/meta_conf_make_meta.org | 12 ++++++++++++ org/out_cgi_search_sqlite.org | 32 +++++++++++++++++++++++--------- org/output_show.org | 10 ++++------ org/spine.org | 5 +++++ 4 files changed, 44 insertions(+), 15 deletions(-) (limited to 'org') diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org index d80a270..de0080b 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -44,6 +44,7 @@ webserv: cgi_bin_url: "http://localhost/cgi-bin" cgi_bin_part: "cgi-bin" cgi_bin_path: "/usr/lib/cgi-bin" + cgi_search_title: "≅ SiSU spine search form" cgi_search_script: "spine-search" cgi_search_script_raw_fn_d: "spine_search.d" cgi_port: "" @@ -266,6 +267,7 @@ struct ConfCompositeSiteLocal { string w_srv_cgi_domain; // if not set same as webserv_domain string w_srv_cgi_bin_part; string w_srv_cgi_bin_path; + string w_srv_cgi_search_title; string w_srv_cgi_search_script; string w_srv_cgi_search_script_raw_fn_d; string w_srv_cgi_port; @@ -690,6 +692,16 @@ if ("webserv" in _yaml ) { _struct_composite.conf.w_srv_cgi_bin_path = _yaml["webserv"]["cgi_bin_path"].get!string; } + if (_opt_action.cgi_search_title.length > 0) { + _struct_composite.conf.w_srv_cgi_search_title = _opt_action.cgi_search_title; + } else if ("cgi_search_title" in _yaml["webserv"] + && _yaml["webserv"]["cgi_search_title"].type.string + && _yaml["webserv"]["cgi_search_title"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_cgi_search_title = _yaml["webserv"]["cgi_search_title"].get!string; + } else { + _struct_composite.conf.w_srv_cgi_search_title = "≅ SiSU spine search form"; + } if (_opt_action.cgi_sqlite_search_filename.length > 0) { _struct_composite.conf.w_srv_cgi_search_script = _opt_action.cgi_sqlite_search_filename; } else if ("cgi_search_script" in _yaml["webserv"] diff --git a/org/out_cgi_search_sqlite.org b/org/out_cgi_search_sqlite.org index 62f456d..32e11ea 100644 --- a/org/out_cgi_search_sqlite.org +++ b/org/out_cgi_search_sqlite.org @@ -122,6 +122,9 @@ mixin GenericMain!cgi_function_intro; get_doc_collection_sub_root(make_and_meta_struct.conf.output_path), make_and_meta_struct.conf.output_path ~ "/sqlite/", _sqlite_db_fn, + (opt_action.cgi_search_title.empty) + ? make_and_meta_struct.conf.w_srv_cgi_search_title + : opt_action.cgi_search_title, (opt_action.css_theme_default) ? "FFFFFF" : "000000", (opt_action.css_theme_default) ? "000000" : "CCCCCC", (opt_action.css_theme_default) ? "FFFFFF" : "000000", @@ -139,6 +142,9 @@ mixin GenericMain!cgi_function_intro; (opt_action.css_theme_default) ? "FFFFFF" : "777777", (opt_action.css_theme_default) ? "000000" : "FFFF48", (opt_action.css_theme_default) ? "FFFF48" : "777748", + (opt_action.cgi_search_title.empty) + ? make_and_meta_struct.conf.w_srv_cgi_search_title + : opt_action.cgi_search_title, (opt_action.css_theme_default) ? "222222" : "AAAAAA", _cgi_search_script, _sqlite_db_fn, @@ -815,7 +821,7 @@ string show_matched_objects (string fn) { - ≅ SiSU spine search form + %s @@ -874,6 +880,7 @@ string show_matched_objects (string fn) { background-color : #%s; } p.norm { } + p.center { text-align : center; } p.i1 { padding-left : 1em; } p.i2 { padding-left : 2em; } p.i3 { padding-left : 3em; } @@ -1310,17 +1317,11 @@ string show_matched_objects (string fn) {
-
- - -
- git - + %s
- ┃"); @@ -1717,7 +1718,11 @@ LIMIT %%s OFFSET %%s #+NAME: cgi_sqlite_select_statement_0 #+BEGIN_SRC d (cv.checked_sql) - ? cgi.write(previous_next ~ "
" ~ sql_select.the_body.strip.split("\n ").join(" ").split("\n").join("
") ~ "
\n") + ? cgi.write(previous_next + ~ "
" + ~ sql_select.the_body.strip.split("\n ").join(" ").split("\n").join("
") + ~ "
\n" + ) : ""; cgi.write(previous_next); auto select_query_results = db.execute(sql_select.the_body).cached; @@ -1819,9 +1824,17 @@ LIMIT %%s OFFSET %%s #+BEGIN_SRC d } cgi.write( previous_next); + } else { // offset_not_beyond_limit = false; cgi.write("select_query_results empty

\n"); } + cgi.write("

+ + +
+ git +

+"); } sql_search_query; } @@ -1899,3 +1912,4 @@ dub --force --compiler=ldc2 && sudo cp -v cgi-bin/spine-search /usr/lib/cgi-bin/ http://localhost/cgi-bin/spine-search? #+END_SRC + diff --git a/org/output_show.org b/org/output_show.org index 17b361a..e473c92 100644 --- a/org/output_show.org +++ b/org/output_show.org @@ -158,7 +158,7 @@ template spineShowSiteConfig() { #+NAME: meta_metadoc_show_site_config #+BEGIN_SRC d writefln( - "\n%s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n", + "\n%s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n", markup.repeat_character_by_number_provided("-", char_repeat_number), "- webserv domain name:", config.conf.w_srv_domain, @@ -188,6 +188,8 @@ writefln( config.conf.w_srv_cgi_bin_url, "- webserv cgi action:", config.conf.w_srv_cgi_action, + "- webserv cgi title:", + config.conf.w_srv_cgi_title, // "- webserv cgi file links:", // config.conf.w_srv_cgi_file_links, "- webserv sqlite db:", @@ -247,7 +249,7 @@ template spineShowConfig() { #+NAME: meta_metadoc_show_config #+BEGIN_SRC d writefln( - "%s\n\"%s\", %s\n%s\n%s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n", + "%s\n\"%s\", %s\n%s\n%s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n%40-s%10-s\n", markup.repeat_character_by_number_provided("-", char_repeat_number), doc_matters.conf_make_meta.meta.title_full, doc_matters.conf_make_meta.meta.creator_author, @@ -273,10 +275,6 @@ writefln( doc_matters.conf_make_meta.conf.w_srv_cgi_search_script, "- webserv cgi search script in d:", doc_matters.conf_make_meta.conf.w_srv_cgi_search_script_raw_fn_d, - "- webserv cgi port:", - doc_matters.conf_make_meta.conf.w_srv_cgi_port, - "- webserv cgi user:", - doc_matters.conf_make_meta.conf.w_srv_cgi_user, "- webserv cgi url:", doc_matters.conf_make_meta.conf.w_srv_cgi_bin_url, "- webserv cgi action:", diff --git a/org/spine.org b/org/spine.org index e5752ca..0f9b7a1 100644 --- a/org/spine.org +++ b/org/spine.org @@ -415,6 +415,7 @@ bool[string] opts = [ "workon" : false, ]; string[string] settings = [ + "cgi-search-title" : "", // config default: "spine-search" "cgi-sqlite-search-filename" : "", // config default: "spine-search" "config" : "", "output" : "", @@ -492,6 +493,7 @@ auto helpInfo = getopt(args, "very-verbose", "output to terminal", &opts["very-verbose"], "workon", "(reserved for some matters under development & testing)", &opts["workon"], "xhtml", "xhtml output", &opts["xhtml"], + "cgi-search-title", "if generating a cgi search form the title to use for it", &settings["cgi-search-title"], "cgi-sqlite-search-filename", "=[filename] default is spine-search", &settings["cgi-sqlite-search-filename"], "config", "=/path/to/config/file/including/filename", &settings["config"], "lang", "=[lang code e.g. =en or =en,es]", &settings["lang"], @@ -691,6 +693,9 @@ struct OptActions { @trusted string sqlite_filename() { return settings["sqlite-db-filename"]; } + @trusted string cgi_search_title() { + return settings["cgi-search-title"]; + } @trusted string cgi_sqlite_search_filename() { return settings["cgi-sqlite-search-filename"]; } -- cgit v1.2.3