From 8f9a80a9ac8f353ce2cdafa23f0e5163d30d5800 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 1 May 2019 22:32:11 +0300 Subject: Add support for description-type package manifest value --- mod/mod-package-details.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'mod/mod-package-details.cxx') diff --git a/mod/mod-package-details.cxx b/mod/mod-package-details.cxx index 28370c2..fa073b5 100644 --- a/mod/mod-package-details.cxx +++ b/mod/mod-package-details.cxx @@ -186,13 +186,17 @@ handle (request& rq, response& rs) if (const optional& d = pkg->description) { const string id ("description"); + const string what (name.string () + " description"); s << (full - ? PRE_TEXT (*d, id) - : PRE_TEXT (*d, + ? DIV_TEXT (*d, *pkg->description_type, id, what, error) + : DIV_TEXT (*d, + *pkg->description_type, options_->package_description (), url (!full, squery, page, id), - id)); + id, + what, + error)); } s << TABLE(CLASS="proplist", ID="package") @@ -221,7 +225,11 @@ handle (request& rq, response& rs) package_db_->query_value ( search_params (squery, tenant, name))); - s << FORM_SEARCH (squery, "q") + // Let's disable autofocus in the full page mode since clicking the full or + // more link the user most likely intends to read rather than search, while + // autofocus scrolls the page to the search field. + // + s << FORM_SEARCH (squery, "q", !full) << DIV_COUNTER (pkg_count, "Version", "Versions"); // Enclose the subsequent tables to be able to use nth-child CSS selector. -- cgit v1.1