diff options
-rw-r--r-- | gentoobrowse/.htaccess | 1 | ||||
-rw-r--r-- | gentoobrowse/browse.xslt | 5 | ||||
-rw-r--r-- | gentoobrowse/datasources/postgres.xml | 2 | ||||
-rw-r--r-- | gentoobrowse/present/package.xml | 4 | ||||
-rw-r--r-- | gentoobrowse/search.xslt | 4 | ||||
-rw-r--r-- | gentoobrowse/style.css | 9 | ||||
-rw-r--r-- | gentoobrowse/views/package.xml | 77 |
7 files changed, 93 insertions, 9 deletions
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 @@ <xsl:apply-templates select="deps" /> </xsl:template> <xsl:template match="/gentoo/summary/package/packageUrls"> - <ul> + <div class="urls"> <xsl:apply-templates match="url" /> - </ul> + </div> </xsl:template> <xsl:template match="/gentoo/summary/package/packageUrls/url"> <a target="_blank"> @@ -106,6 +106,7 @@ <h3>Dependencies</h3> <ul> <xsl:apply-templates match="/gentoo/summary/package/deps/package" /> + <li><i>@system</i></li> </ul> </xsl:template> </xsl:stylesheet> 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 @@ <dsn>Driver=postgresql;Readonly=yes;ServerName=firebrand.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;</dsn> <dsn>Driver=postgresql;Readonly=yes;ServerName=defiant.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;</dsn> </readonly> - <masterdsn>Driver=postgresql;Readonly=no;ServerName=postgresql.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;</masterdsn> + <masterdsn>Driver=postgresql;Readonly=no;ServerName=postgresql.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;CPTimeOut=60</masterdsn> </rdbmsdatasource> 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 @@ +<?xml version="1.0"?> +<view name="package" root="gentoo" style="browse.xslt" xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="../views/package.xml" /> +</view> 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 @@ <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:project2="http://project2.randomdan.homeip.net/"> + xmlns:project2="http://project2.randomdan.homeip.net/" exclude-result-prefixes="project2" > <xsl:import href="base.xslt" /> <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" doctype-system="http://www.w3.org/TR/html4/loose.dtd" @@ -8,7 +8,7 @@ <xsl:template name="content"> <h2>Search</h2> <form action="/search" method="get"> - <input type="textbox" name="criteria"> + <input type="text" name="criteria"> <xsl:attribute name="value"> <xsl:value-of select="/gentoo/project2:params/project2:param[@name='criteria']" /> </xsl:attribute> 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 @@ +<?xml version="1.0"?> +<block xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="../datasources/postgres.xml" /> + <sqlview name="summary" recordname="package" datasource="postgres"> + <sql> + 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 + </sql> + <parameters> + <param bind="0" id="1" source="uri" /> + <param bind="1" id="2" source="uri" /> + </parameters> + <sqlview name="versions" recordname="version" datasource="postgres"> + <sql> + SELECT e.ebuildid, e.version + FROM ebuilds e + WHERE e.packageid = ? + ORDER BY versioninst desc + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="packageUrls" recordname="url" datasource="postgres"> + <sql> + SELECT pu.url + FROM package_urls pu + WHERE pu.packageid = ? + ORDER BY pu.url + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="versionUses" recordname="use" datasource="postgres"> + <sql> + SELECT u.* + FROM ebuilds e, ebuild_uses u + WHERE e.packageid = ? + AND e.ebuildid = u.ebuildid + ORDER BY version + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="versionArchs" recordname="arch" datasource="postgres"> + <sql> + SELECT a.* + FROM ebuilds e, ebuild_archs a + WHERE e.packageid = ? + AND e.ebuildid = a.ebuildid + ORDER BY version + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="deps" recordname="package" datasource="postgres"> + <sql> + 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 + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + </sqlview> +</block> |