diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-08-30 00:50:08 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2016-08-30 00:57:07 +0300 |
commit | 665057a9c4bb0d2ea5ca35d81cb1c22244fa7002 (patch) | |
tree | 35c9c6f50801a19ab4824647ab8921b9234f6003 /mod | |
parent | 321fa79e78c17bdb1e3e27f6e8b9d019201584a1 (diff) |
Support stubs on package and package version details pages
Diffstat (limited to 'mod')
-rw-r--r-- | mod/mod-package-details.cxx | 2 | ||||
-rw-r--r-- | mod/mod-package-version-details.cxx | 2 | ||||
-rw-r--r-- | mod/page | 21 | ||||
-rw-r--r-- | mod/page.cxx | 13 |
4 files changed, 29 insertions, 9 deletions
diff --git a/mod/mod-package-details.cxx b/mod/mod-package-details.cxx index 1ee7a7a..7821b69 100644 --- a/mod/mod-package-details.cxx +++ b/mod/mod-package-details.cxx @@ -211,7 +211,7 @@ handle (request& rq, response& rs) s << TABLE(CLASS="proplist version") << TBODY - << TR_VERSION (name, p->version.string (), root) + << TR_VERSION (name, p->version, root) // @@ Shouldn't we skip low priority row ? Don't think so, why? // diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index ccd81c5..b2172ce 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -169,7 +169,7 @@ handle (request& rq, response& rs) // Repeat version here since it can be cut out in the header. // - << TR_VERSION (pkg->version.string ()) + << TR_VERSION (pkg->version) << TR_PRIORITY (pkg->priority) << TR_LICENSES (pkg->license_alternatives) @@ -114,20 +114,31 @@ namespace brep public: // Display the version as a link to the package version details page. // - TR_VERSION (const string& p, const string& v, const dir_path& r) - : package_ (&p), version_ (v), root_ (&r) {} + TR_VERSION (const string& p, const version& v, const dir_path& r) + : package_ (&p), + version_ (v.string ()), + stub_ (v.compare (wildcard_version, true) == 0), + root_ (&r) + { + } // Display the version as a regular text. // - TR_VERSION (const string& v) - : package_ (nullptr), version_ (v), root_ (nullptr) {} + TR_VERSION (const version& v) + : package_ (nullptr), + version_ (v.string ()), + stub_ (v.compare (wildcard_version, true) == 0), + root_ (nullptr) + { + } void operator() (xml::serializer&) const; private: const string* package_; - const string& version_; + string version_; + bool stub_; const dir_path* root_; }; diff --git a/mod/page.cxx b/mod/page.cxx index 79b5da5..aba7581 100644 --- a/mod/page.cxx +++ b/mod/page.cxx @@ -144,14 +144,23 @@ namespace brep << SPAN(CLASS="value"); if (package_ == nullptr) + { s << version_; + + if (stub_) + s << " (stub)"; + } else { assert (root_ != nullptr); s << A(HREF=*root_ / dir_path (mime_url_encode (*package_)) / path (version_)) - << version_ - << ~A; + << version_; + + if (stub_) + s << " (stub)"; + + s << ~A; } s << ~SPAN |