aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-10-14 17:45:52 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-10-14 17:45:52 +0300
commitef2bc84384177d6302f193786f0aff131862416d (patch)
treeb2c38edbc0bf634b6cdfbf11b7a96afff82977aa /mod
parent46ab16e599d4d0725526b70a0024d33429908e94 (diff)
Make some web interface cleanups
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-package-details.cxx21
-rw-r--r--mod/mod-package-version-details.cxx3
-rw-r--r--mod/mod-packages.cxx3
-rw-r--r--mod/page.cxx15
-rw-r--r--mod/page.hxx22
5 files changed, 14 insertions, 50 deletions
diff --git a/mod/mod-package-details.cxx b/mod/mod-package-details.cxx
index e0bd1ef..13e6422 100644
--- a/mod/mod-package-details.cxx
+++ b/mod/mod-package-details.cxx
@@ -265,23 +265,12 @@ handle (request& rq, response& rs)
assert (p->internal ());
- // @@ Shouldn't we make package repository name to be a link to the proper
- // place of the About page, describing corresponding repository?
- // Yes, I think that's sounds reasonable.
- // Or maybe it can be something more valuable like a link to the
- // repository package search page ?
- //
- // @@ In most cases package location will be the same for all versions
- // of the same package. Shouldn't we put package location to the
- // package summary part and display it here only if it differs
- // from the one in the summary ?
- //
- // Hm, I am not so sure about this. Consider: stable/testing/unstable.
+ const repository_location& rl (p->internal_repository.load ()->location);
+
+ // @@ Maybe the repository link can be something more valuable like a link
+ // to the repository package search page ?
//
- s << TR_REPOSITORY (
- p->internal_repository.object_id ().canonical_name,
- root,
- tenant)
+ s << TR_REPOSITORY (rl, root, tenant)
<< TR_DEPENDS (p->dependencies, root, tenant)
<< TR_REQUIRES (p->requirements)
<< ~TBODY
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx
index 0faf7a2..90c33b1 100644
--- a/mod/mod-package-version-details.cxx
+++ b/mod/mod-package-version-details.cxx
@@ -214,8 +214,7 @@ handle (request& rq, response& rs)
<< TR_PRIORITY (pkg->priority)
<< TR_LICENSES (pkg->license_alternatives)
- << TR_REPOSITORY (rl.canonical_name (), root, tenant)
- << TR_LOCATION (rl);
+ << TR_REPOSITORY (rl, root, tenant);
if (rl.type () == repository_type::pkg)
{
diff --git a/mod/mod-packages.cxx b/mod/mod-packages.cxx
index 222b817..f09d7fa 100644
--- a/mod/mod-packages.cxx
+++ b/mod/mod-packages.cxx
@@ -170,8 +170,7 @@ handle (request& rq, response& rs)
<< TR_NAME (p->name, equery, root, p->tenant)
<< TR_SUMMARY (p->summary)
<< TR_LICENSE (p->license_alternatives)
- << TR_DEPENDS (p->dependencies, root, p->tenant)
- << TR_REQUIRES (p->requirements);
+ << TR_DEPENDS (p->dependencies, root, p->tenant);
// In the global view mode add the tenant packages link. Note that the
// global view (and the link) makes sense only in the multi-tenant mode.
diff --git a/mod/page.cxx b/mod/page.cxx
index 1e317f0..b9424dc 100644
--- a/mod/page.cxx
+++ b/mod/page.cxx
@@ -643,26 +643,15 @@ namespace brep
<< A
<< HREF
<< tenant_dir (root_, tenant_) << "?about#"
- << mime_url_encode (html_id (name_), false)
+ << mime_url_encode (html_id (location_.canonical_name ()), false)
<< ~HREF
- << name_
+ << location_
<< ~A
<< ~SPAN
<< ~TD
<< ~TR;
}
- // TR_LOCATION
- //
- void TR_LOCATION::
- operator() (serializer& s) const
- {
- s << TR(CLASS="location")
- << TH << "location" << ~TH
- << TD << SPAN(CLASS="value") << location_ << ~SPAN << ~TD
- << ~TR;
- }
-
// TR_LINK
//
void TR_LINK::
diff --git a/mod/page.hxx b/mod/page.hxx
index cc9840e..acfbe5b 100644
--- a/mod/page.hxx
+++ b/mod/page.hxx
@@ -424,32 +424,20 @@ namespace brep
class TR_REPOSITORY
{
public:
- TR_REPOSITORY (const string& n, const dir_path& r, const string& t)
- : name_ (n), root_ (r), tenant_ (t) {}
+ TR_REPOSITORY (const repository_location& l,
+ const dir_path& r,
+ const string& t)
+ : location_ (l), root_ (r), tenant_ (t) {}
void
operator() (xml::serializer&) const;
private:
- const string& name_;
+ const repository_location& location_;
const dir_path& root_;
const string& tenant_;
};
- // Generate repository location element.
- //
- class TR_LOCATION
- {
- public:
- TR_LOCATION (const repository_location& l): location_ (l) {}
-
- void
- operator() (xml::serializer&) const;
-
- private:
- const repository_location& location_;
- };
-
// Generate link element.
//
class TR_LINK