diff options
-rw-r--r-- | gentoobrowse/home.xslt | 28 | ||||
-rw-r--r-- | gentoobrowse/views/newebuilds.xml | 10 |
2 files changed, 17 insertions, 21 deletions
diff --git a/gentoobrowse/home.xslt b/gentoobrowse/home.xslt index 368d481..35fd4ef 100644 --- a/gentoobrowse/home.xslt +++ b/gentoobrowse/home.xslt @@ -11,26 +11,18 @@ <h2>Newest ebuilds</h2> <table class="newebuilds"> <tr> - <th>Today</th> - <th>Yesterday</th> - <th>The day before</th> + <xsl:for-each select="/gentoo/syncs/sync"> + <th><xsl:value-of select="synctime" /></th> + </xsl:for-each> </tr> <tr> - <td valign="top"> - <ul> - <xsl:apply-templates select="/gentoo/newebuilds/ebuild[age=0]" /> - </ul> - </td> - <td valign="top"> - <ul> - <xsl:apply-templates select="/gentoo/newebuilds/ebuild[age=1]" /> - </ul> - </td> - <td valign="top"> - <ul> - <xsl:apply-templates select="/gentoo/newebuilds/ebuild[age=2]" /> - </ul> - </td> + <xsl:for-each select="/gentoo/syncs/sync"> + <td valign="top"> + <ul> + <xsl:apply-templates select="/gentoo/newebuilds/ebuild[sync = current()/synctime]" /> + </ul> + </td> + </xsl:for-each> </tr> </table> </xsl:template> diff --git a/gentoobrowse/views/newebuilds.xml b/gentoobrowse/views/newebuilds.xml index 93d7286..1476533 100644 --- a/gentoobrowse/views/newebuilds.xml +++ b/gentoobrowse/views/newebuilds.xml @@ -3,14 +3,18 @@ <xi:include href="../datasources/postgres.xml" /> <project2:sqlview name="newebuilds" recordname="ebuild" datasource="postgres"> <sql> - SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, - EXTRACT('day' FROM ((SELECT MAX(fm.firstseen) FROM files fm) - (f.firstseen - interval '1hour'))) AS age + SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, f.firstseen sync FROM ebuilds e, files f, packages p, categories c WHERE e.ebuildid = f.fileid AND e.packageid = p.packageid AND p.categoryid = c.categoryid - AND f.firstseen > (SELECT MAX(fm.firstseen) - INTERVAL '2.1 days' FROM files fm) + AND f.firstseen > (SELECT DISTINCT f.firstseen FROM files f ORDER BY f.firstseen DESC LIMIT 1 OFFSET 3) ORDER BY c.name, p.name, e.versioninst </sql> </project2:sqlview> + <project2:sqlview name="syncs" recordname="sync" datasource="postgres"> + <sql> + SELECT DISTINCT f.firstseen AS synctime FROM files f ORDER BY f.firstseen DESC LIMIT 3 + </sql> + </project2:sqlview> </block> |