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 --- src/doc_reform/io_out/cgi_sqlite_search_form.d | 31 ++++++++++++++++++-------- src/doc_reform/meta/conf_make_meta_structs.d | 1 + src/doc_reform/meta/conf_make_meta_yaml.d | 10 +++++++++ src/doc_reform/meta/metadoc_show_config.d | 10 ++++----- src/doc_reform/spine.d | 5 +++++ 5 files changed, 42 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/doc_reform/io_out/cgi_sqlite_search_form.d b/src/doc_reform/io_out/cgi_sqlite_search_form.d index 4a77d48..9c95f7d 100644 --- a/src/doc_reform/io_out/cgi_sqlite_search_form.d +++ b/src/doc_reform/io_out/cgi_sqlite_search_form.d @@ -516,7 +516,7 @@ void cgi_function_intro(Cgi cgi) { - ≅ SiSU spine search form + %s @@ -575,6 +575,7 @@ void cgi_function_intro(Cgi cgi) { 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; } @@ -1005,17 +1006,11 @@ void cgi_function_intro(Cgi cgi) {
-
- - -
- git - + %s
- ┃"); @@ -1342,7 +1337,11 @@ LIMIT %%s OFFSET %%s cv.sql_match_offset, ); (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; @@ -1426,9 +1425,17 @@ LIMIT %%s OFFSET %%s } } cgi.write( previous_next); + } else { // offset_not_beyond_limit = false; cgi.write("select_query_results empty

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

+ + +
+ git +

+"); } sql_search_query; } @@ -1447,6 +1454,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", @@ -1464,6 +1474,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, diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d index 34b30a3..3c749df 100644 --- a/src/doc_reform/meta/conf_make_meta_structs.d +++ b/src/doc_reform/meta/conf_make_meta_structs.d @@ -156,6 +156,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; diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index d6f9e22..9dac231 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -282,6 +282,16 @@ template contentYAMLtoSpineStruct() { ) { _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/src/doc_reform/meta/metadoc_show_config.d b/src/doc_reform/meta/metadoc_show_config.d index 4c2b976..057d7ba 100644 --- a/src/doc_reform/meta/metadoc_show_config.d +++ b/src/doc_reform/meta/metadoc_show_config.d @@ -22,7 +22,7 @@ template spineShowSiteConfig() { auto char_repeat_number = 66; if (opt_action.show_config) { 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, @@ -52,6 +52,8 @@ template spineShowSiteConfig() { 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:", @@ -116,7 +118,7 @@ template spineShowConfig() { } if (doc_matters.opt.action.show_config) { 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, @@ -142,10 +144,6 @@ template spineShowConfig() { 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/src/doc_reform/spine.d b/src/doc_reform/spine.d index 1ddfca1..01b7d8e 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -173,6 +173,7 @@ string program_name = "spine"; "workon" : false, ]; string[string] settings = [ + "cgi-search-title" : "", // config default: "spine-search" "cgi-sqlite-search-filename" : "", // config default: "spine-search" "config" : "", "output" : "", @@ -244,6 +245,7 @@ string program_name = "spine"; "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"], @@ -436,6 +438,9 @@ string program_name = "spine"; @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