aboutsummaryrefslogtreecommitdiff
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
parent46ab16e599d4d0725526b70a0024d33429908e94 (diff)
Make some web interface cleanups
-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
-rw-r--r--www/package-details-body.css1
-rw-r--r--www/package-version-details-body.css1
-rw-r--r--www/packages-body.css1
8 files changed, 14 insertions, 53 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
diff --git a/www/package-details-body.css b/www/package-details-body.css
index 940b493..1083c54 100644
--- a/www/package-details-body.css
+++ b/www/package-details-body.css
@@ -184,7 +184,6 @@ table.version th {width: 7.6em;}
table.version tr.version td .value,
table.version tr.priority td .value,
-table.version tr.repository td .value,
table.version tr.depends td .value,
table.version tr.requires td .value
{
diff --git a/www/package-version-details-body.css b/www/package-version-details-body.css
index 524e5bd..34445df 100644
--- a/www/package-version-details-body.css
+++ b/www/package-version-details-body.css
@@ -145,7 +145,6 @@ h1, h2, h3
#version tr.version td .value,
#version tr.priority td .value,
-#version tr.repository td .value
{
/* <code> style. */
font-family: monospace;
diff --git a/www/packages-body.css b/www/packages-body.css
index 79911d4..986308f 100644
--- a/www/packages-body.css
+++ b/www/packages-body.css
@@ -33,7 +33,6 @@
.package tr.name td .value,
.package tr.depends td .value,
-.package tr.requires td .value,
.package tr.tenant td .value
{
/* <code> style. */