diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-08-01 20:03:48 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-08-07 19:01:06 +0300 |
commit | 7db53790ca2d2c004bfd00b503eca59a8d084870 (patch) | |
tree | 5f6201d48322043e1f2802efddb28e5643a2dab7 /mod/page.cxx | |
parent | ee220058d977738c02ead45cc5567bbab33adf48 (diff) |
Add support for loading package version reviews
Diffstat (limited to 'mod/page.cxx')
-rw-r--r-- | mod/page.cxx | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/mod/page.cxx b/mod/page.cxx index 177fb64..17fef91 100644 --- a/mod/page.cxx +++ b/mod/page.cxx @@ -618,6 +618,80 @@ namespace brep << ~TR; } + // TR_REVIEWS_SUMMARY + // + void TR_REVIEWS_SUMMARY:: + operator() (serializer& s) const + { + s << TR(CLASS="reviews") + << TH << "reviews" << ~TH + << TD + << SPAN(CLASS="value"); + + if (reviews_) + { + s << A + << HREF + << reviews_url_ << reviews_->manifest_file + << ~HREF; + + if (reviews_->fail != 0) + s << SPAN(CLASS="fail") << '-' << reviews_->fail << ~SPAN; + + if (reviews_->fail != 0 && reviews_->pass != 0) + s << '/'; + + if (reviews_->pass != 0) + s << SPAN(CLASS="pass") << '+' << reviews_->pass << ~SPAN; + + s << ~A; + } + else + s << SPAN(CLASS="none") << 0 << ~SPAN; + + s << ~SPAN + << ~TD + << ~TR; + } + + // TR_REVIEWS_COUNTER + // + void TR_REVIEWS_COUNTER:: + operator() (serializer& s) const + { + const char* l (result == review_result::fail ? "fail" : "pass"); + + s << TR(CLASS=l) + << TH << l << ~TH + << TD + << SPAN(CLASS="value"); + + if (reviews_) + { + size_t n (result == review_result::fail + ? reviews_->fail + : reviews_->pass); + + if (n != 0) + { + s << A + << HREF + << reviews_url_ << reviews_->manifest_file + << ~HREF + << SPAN(CLASS=l) << n << ~SPAN + << ~A; + } + else + s << n; + } + else + s << SPAN(CLASS="none") << 0 << ~SPAN; + + s << ~SPAN + << ~TD + << ~TR; + } + // TR_URL // void TR_URL:: |