From 05258c58f8a2c2da3db7cd0e476d4a2dad6af26b Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 11 Jun 2010 12:27:20 +0000 Subject: Add package page using subqueries Minor HTML and CSS fixes --- gentoobrowse/.htaccess | 1 - gentoobrowse/browse.xslt | 5 ++- gentoobrowse/datasources/postgres.xml | 2 +- gentoobrowse/present/package.xml | 4 ++ gentoobrowse/search.xslt | 4 +- gentoobrowse/style.css | 9 ++-- gentoobrowse/views/package.xml | 77 +++++++++++++++++++++++++++++++++++ 7 files changed, 93 insertions(+), 9 deletions(-) create mode 100644 gentoobrowse/present/package.xml create mode 100644 gentoobrowse/views/package.xml diff --git a/gentoobrowse/.htaccess b/gentoobrowse/.htaccess index 19986cc..eb74b34 100644 --- a/gentoobrowse/.htaccess +++ b/gentoobrowse/.htaccess @@ -8,4 +8,3 @@ RewriteCond %{REQUEST_URI} !^/env RewriteRule ^(.*) /p2web/\1 [L] AddOutputFilterByType XSLT text/xml-xslt - diff --git a/gentoobrowse/browse.xslt b/gentoobrowse/browse.xslt index c62e886..26d5e25 100644 --- a/gentoobrowse/browse.xslt +++ b/gentoobrowse/browse.xslt @@ -82,9 +82,9 @@ -
    +
    -
+
@@ -106,6 +106,7 @@

Dependencies

    +
  • @system
diff --git a/gentoobrowse/datasources/postgres.xml b/gentoobrowse/datasources/postgres.xml index 221b05d..0bb95f2 100644 --- a/gentoobrowse/datasources/postgres.xml +++ b/gentoobrowse/datasources/postgres.xml @@ -4,5 +4,5 @@ Driver=postgresql;Readonly=yes;ServerName=firebrand.random.lan;Username=gentoo;Database=gentoo;Password=gentoo; Driver=postgresql;Readonly=yes;ServerName=defiant.random.lan;Username=gentoo;Database=gentoo;Password=gentoo; - Driver=postgresql;Readonly=no;ServerName=postgresql.random.lan;Username=gentoo;Database=gentoo;Password=gentoo; + Driver=postgresql;Readonly=no;ServerName=postgresql.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;CPTimeOut=60 diff --git a/gentoobrowse/present/package.xml b/gentoobrowse/present/package.xml new file mode 100644 index 0000000..ba625d9 --- /dev/null +++ b/gentoobrowse/present/package.xml @@ -0,0 +1,4 @@ + + + + diff --git a/gentoobrowse/search.xslt b/gentoobrowse/search.xslt index 74a791d..ec8f9dd 100644 --- a/gentoobrowse/search.xslt +++ b/gentoobrowse/search.xslt @@ -1,6 +1,6 @@ + xmlns:project2="http://project2.randomdan.homeip.net/" exclude-result-prefixes="project2" >

Search

- + diff --git a/gentoobrowse/style.css b/gentoobrowse/style.css index 195a109..efa2810 100644 --- a/gentoobrowse/style.css +++ b/gentoobrowse/style.css @@ -45,10 +45,10 @@ p { .versions { border-collapse: collapse; -width: 95%; + width: 95%; } .versions td { -border: 1px solid gray; + border: 1px solid gray; } .versions .row1 td { border-top: 2px solid black; @@ -62,7 +62,10 @@ border: 1px solid gray; white-space: nowrap; } .versions .use, .versions .archs { -padding: 10px 5px; + padding: 10px 5px; +} +.urls { + margin: 8px 50px; } table.grps { diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml new file mode 100644 index 0000000..8544123 --- /dev/null +++ b/gentoobrowse/views/package.xml @@ -0,0 +1,77 @@ + + + + + + SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname + FROM packages p, categories c + WHERE c.name = ? + AND p.name = ? + AND p.categoryid = c.categoryid + + + + + + + + SELECT e.ebuildid, e.version + FROM ebuilds e + WHERE e.packageid = ? + ORDER BY versioninst desc + + + + + + + + SELECT pu.url + FROM package_urls pu + WHERE pu.packageid = ? + ORDER BY pu.url + + + + + + + + SELECT u.* + FROM ebuilds e, ebuild_uses u + WHERE e.packageid = ? + AND e.ebuildid = u.ebuildid + ORDER BY version + + + + + + + + SELECT a.* + FROM ebuilds e, ebuild_archs a + WHERE e.packageid = ? + AND e.ebuildid = a.ebuildid + ORDER BY version + + + + + + + + SELECT distinct cd.name AS catname, pd.name AS pkgname, pd.description + FROM ebuilds e, ebuild_deps d, packages pd, categories cd + WHERE e.packageid = ? + AND d.ebuildid = e.ebuildid + AND pd.packageid = d.packageid + AND pd.categoryid = cd.categoryid + ORDER BY cd.name, pd.name + + + + + + + -- cgit v1.2.3