aboutsummaryrefslogtreecommitdiff
path: root/brep
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-08-19 11:20:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-08-23 13:54:51 +0200
commit0ebdc6a8f9bd26d73687adc654120751f928188c (patch)
treec1da4f0f4c9f360d712b99ea19f40532be380252 /brep
parentbcd246076540a8353fa55fc0a5e19343c1a2dbc9 (diff)
XHTML generation revision
Diffstat (limited to 'brep')
-rw-r--r--brep/package-search.cxx69
1 files changed, 31 insertions, 38 deletions
diff --git a/brep/package-search.cxx b/brep/package-search.cxx
index 3317d43..455778b 100644
--- a/brep/package-search.cxx
+++ b/brep/package-search.cxx
@@ -58,7 +58,7 @@ namespace brep
throw invalid_request (400, e.what ());
}
- // @@ Would be nice to have a manipulator identing string properly
+ // @@ Would be nice to have a manipulator indenting string properly
// according to the most nested element identation.
//
const char* ident ("\n ");
@@ -68,11 +68,11 @@ namespace brep
s << HTML
<< HEAD
<< TITLE << title << ~TITLE
- << STYLE(TYPE="text/css") << ident
+ << CSS_STYLE << ident
<< ".package {margin: 0 0 0.5em;}" << ident
<< ".name a {text-decoration: none;}" << ident
<< ".summary {font-size: small;}"
- << ~STYLE
+ << ~CSS_STYLE
<< ~HEAD
<< BODY;
@@ -93,59 +93,52 @@ namespace brep
for (const auto& p: r)
{
- s << DIV(CLASS="package")
- << DIV(CLASS="name")
- << A
- << HREF
- << "/go/" << mime_url_encode (p.name);
+ s << DIV(CLASS="package")
+ << DIV(CLASS="name")
+ << A
+ << HREF << "/go/" << mime_url_encode (p.name);
// Propagate search criteria to the package version search url.
//
if (!q.empty ())
- s << "?" << q;
-
- s << ~HREF
- << p.name
- << ~A
- << ~DIV
- << DIV(CLASS="summary")
- << p.summary
- << ~DIV
- << ~DIV;
+ s << "?" << q;
+
+ s << ~HREF
+ << p.name
+ << ~A
+ << ~DIV
+ << DIV(CLASS="summary")
+ << p.summary
+ << ~DIV
+ << ~DIV;
}
t.commit ();
if (pr.page () || r.size () == options_->results_on_page ())
{
- s << DIV;
+ s << DIV;
if (pr.page ())
- {
- s << A
- << HREF << "/?p=" << pr.page () - 1
- << (q.empty () ? "" : "&" + q)
- << ~HREF
- << "Previous"
- << ~A
- << " ";
- }
+ s << A
+ << HREF << "/?p=" << pr.page () - 1 << (q.empty () ? "" : "&" + q)
+ << ~HREF
+ << "Previous"
+ << ~A
+ << " ";
// @@ Not ideal as can produce link to an empty page, but easy to fix
// and most likelly will be replaced with something more meaningful
// based on knowing the total number of matched packages.
//
if (r.size () == options_->results_on_page ())
- {
- s << A
- << HREF << "/?p=" << pr.page () + 1
- << (q.empty () ? "" : "&" + q)
- << ~HREF
- << "Next"
- << ~A;
- }
-
- s << ~DIV;
+ s << A
+ << HREF << "/?p=" << pr.page () + 1 << (q.empty () ? "" : "&" + q)
+ << ~HREF
+ << "Next"
+ << ~A;
+
+ s << ~DIV;
}
s << ~BODY