From d63e34a7e8612dc69ae25f3d3903ba04cc808bf7 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 8 Sep 2018 17:46:57 +0300 Subject: Add support for root global and tenant views --- mod/page.cxx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'mod/page.cxx') diff --git a/mod/page.cxx b/mod/page.cxx index 46f4879..ce12da6 100644 --- a/mod/page.cxx +++ b/mod/page.cxx @@ -98,7 +98,8 @@ namespace brep << TBODY << TR << TD(ID="search-txt") - << *INPUT(TYPE="search", NAME="q", VALUE=query_, AUTOFOCUS="") + << *INPUT(TYPE="search", NAME=name_, VALUE=query_, + AUTOFOCUS="") << ~TD << TD(ID="search-btn") << *INPUT(TYPE="submit", VALUE="Search") @@ -192,14 +193,15 @@ namespace brep << SPAN(CLASS="value") << A << HREF - - // Propagate search criteria to the package details page. - // << tenant_dir (root_, tenant_) / - path (mime_url_encode (name_.string (), false)) - << query_param_ + path (mime_url_encode (name_.string (), false)); - << ~HREF + // Propagate search criteria to the package details page. + // + if (!query_.empty ()) + s << "?q=" << query_; + + s << ~HREF << name_ << ~A << ~SPAN @@ -255,7 +257,7 @@ namespace brep << SPAN(CLASS="value") << A << HREF - << tenant_dir (root_, tenant_) << "?q=" + << tenant_dir (root_, tenant_) << "?packages=" << mime_url_encode (project_.string ()) << ~HREF << project_ @@ -356,7 +358,8 @@ namespace brep { s << A << HREF - << tenant_dir (root_, tenant_) << "?q=" << mime_url_encode (t) + << tenant_dir (root_, tenant_) << "?packages=" + << mime_url_encode (t) << ~HREF << t << ~A; @@ -500,8 +503,8 @@ namespace brep if (r.empty ()) { - // If there is no requirement alternatives specified, then - // print the comment first word. + // If there is no requirement alternatives specified, then print the + // comment first word. // const auto& c (r.comment); if (!c.empty ()) -- cgit v1.1