summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2012-01-31 00:30:49 +0000
committerrandomdan <randomdan@localhost>2012-01-31 00:30:49 +0000
commita2696979b4f8347f7e0f19712c300ca8796fe66c (patch)
treeb7b8ff00c4a7e15bf298afde75e296b0434e89cc
parentFixes for recents changes (diff)
downloadgentoobrowse-a2696979b4f8347f7e0f19712c300ca8796fe66c.tar.bz2
gentoobrowse-a2696979b4f8347f7e0f19712c300ca8796fe66c.tar.xz
gentoobrowse-a2696979b4f8347f7e0f19712c300ca8796fe66c.zip
Add support for aggregates in row views
Add a few aggregates implementations (min, max, distinct) Use distinct to get the GB homepage in a single DB trip Fix lessthan operation on variable types to be the right way round as it now matters
-rw-r--r--gentoobrowse/present/index.xml8
-rw-r--r--gentoobrowse/xslt/home.xslt11
2 files changed, 9 insertions, 10 deletions
diff --git a/gentoobrowse/present/index.xml b/gentoobrowse/present/index.xml
index f040d4b..5f5408b 100644
--- a/gentoobrowse/present/index.xml
+++ b/gentoobrowse/present/index.xml
@@ -4,14 +4,12 @@
<xi:include href="../views/newebuilds.xml" />
<xi:include href="../views/webcommon.xml" />
<project2:view name="newebuilds" source="newebuilds" rootname="newebuilds" recordname="ebuild" filter="syncCount">
+ <project2:distinct name="syncs">
+ <value source="parent" depth="1" name="sync" />
+ </project2:distinct>
<parameters>
<count value="3" />
<userID source="session" name="loggedInUserID"><default value="0" type="int" /></userID>
</parameters>
</project2:view>
- <project2:view name="syncs" source="syncs" rootname="syncs" recordname="sync" filter="syncCount">
- <parameters>
- <count value="3" />
- </parameters>
- </project2:view>
</view>
diff --git a/gentoobrowse/xslt/home.xslt b/gentoobrowse/xslt/home.xslt
index b40b44b..3ec24bb 100644
--- a/gentoobrowse/xslt/home.xslt
+++ b/gentoobrowse/xslt/home.xslt
@@ -12,17 +12,18 @@
</xsl:template>
<xsl:template match="/gentoo/newebuilds">
<h2>Newest ebuilds</h2>
- <xsl:for-each select="/gentoo/syncs/sync">
+ <xsl:for-each select="syncs/value">
+ <xsl:sort select="position()" data-type="number" order="descending"/>
<section class="newebuilds">
<h3>
<time>
- <xsl:attribute name="datetime"><xsl:value-of select="synctime" /></xsl:attribute>
- <span class="syncdate"><xsl:value-of select="synctime/@date" /></span>
- <span class="synctime"><xsl:value-of select="synctime/@time" /></span>
+ <xsl:attribute name="datetime"><xsl:value-of select="current()" /></xsl:attribute>
+ <span class="syncdate"><xsl:value-of select="current()/@date" /></span>
+ <span class="synctime"><xsl:value-of select="current()/@time" /></span>
</time>
</h3>
<ul>
- <xsl:apply-templates select="/gentoo/newebuilds/ebuild[sync = current()/synctime]" />
+ <xsl:apply-templates select="/gentoo/newebuilds/ebuild[sync = current()]" />
</ul>
</section>
</xsl:for-each>