summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-04-12 00:20:07 +0000
committerrandomdan <randomdan@localhost>2014-04-12 00:20:07 +0000
commitf5678211d00d05a4b545d360c2b7f17d1b4beea5 (patch)
tree5baef74c53b9bdb7a5619e3cb76128ce98dd94a9
parentNew email template (diff)
downloadgentoobrowse-f5678211d00d05a4b545d360c2b7f17d1b4beea5.tar.bz2
gentoobrowse-f5678211d00d05a4b545d360c2b7f17d1b4beea5.tar.xz
gentoobrowse-f5678211d00d05a4b545d360c2b7f17d1b4beea5.zip
Use the new autotree view to create nicer xml and thus a much less insane email template
-rw-r--r--gentoobrowse/emails/newpackageversions.xml20
-rw-r--r--gentoobrowse/emails/newpackageversions.xslt36
2 files changed, 37 insertions, 19 deletions
diff --git a/gentoobrowse/emails/newpackageversions.xml b/gentoobrowse/emails/newpackageversions.xml
index a44ad10..92889b9 100644
--- a/gentoobrowse/emails/newpackageversions.xml
+++ b/gentoobrowse/emails/newpackageversions.xml
@@ -18,13 +18,17 @@
order by ut.cname, ut.pname, ut.version
</sql>
</project2:sqlrows>
- <project2:view name="newpackageversionsforuser" source="newpackageversions" rootname="newpackageversions" recordname="version">
- <parameters>
- <userid source="parent" name="userid" depth="1" />
- </parameters>
- <project2:distinct name="pkgs">
- <value><a source="parent" name="cname" />/<b source="parent" name="pname" /></value>
- </project2:distinct>
- </project2:view>
+ <project2:autotree name="newpackageversionsforuser" source="newpackageversions">
+ <tree rootname="categories" objectname="category">
+ <key source="parent" name="cname" />
+ <tree rootname="packages" objectname="package">
+ <key source="parent" name="pname" />
+ <include source="parent" name="description" />
+ <tree rootname="versions">
+ <key source="parent" name="version" />
+ </tree>
+ </tree>
+ </tree>
+ </project2:autotree>
</view>
diff --git a/gentoobrowse/emails/newpackageversions.xslt b/gentoobrowse/emails/newpackageversions.xslt
index 3eb6c32..928edd5 100644
--- a/gentoobrowse/emails/newpackageversions.xslt
+++ b/gentoobrowse/emails/newpackageversions.xslt
@@ -8,26 +8,40 @@
</xsl:template>
<xsl:template name="content">
- <div class="span9">
- <xsl:for-each select="newpackageversions/pkgs/value">
- <div class="container">
- <xsl:variable name="versions" select="../../version[cname = fn:tokenize(current(),'/')[1] and pname = fn:tokenize(current(),'/')[2]]"/>
+ <div class="span3 bs-docs-sidebar">
+ <ul class="nav nav-list bs-docs-sidenav">
+ <xsl:for-each select="categories/category">
+ <li>
+ <a>
+ <xsl:attribute name="href">#<xsl:value-of select="cname" /></xsl:attribute>
+ <i class="icon-chevron-right"></i> <xsl:value-of select="cname" />
+ </a>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </div>
+ <div class="span9">
+ <xsl:for-each select="categories//package">
+ <section>
+ <xsl:if test="count(preceding-sibling::package) = 0">
+ <xsl:attribute name="id"><xsl:value-of select="../../cname" /></xsl:attribute>
+ </xsl:if>
<h3>
- <xsl:value-of select="$versions[1]/cname"/> /
+ <xsl:value-of select="../../cname"/> /
<a>
- <xsl:attribute name="href">http://gentoobrowse.randomdan.homeip.net/package/<xsl:value-of select="$versions[1]/cname"/>/<xsl:value-of select="$versions[1]/pname"/></xsl:attribute>
- <xsl:value-of select="$versions[1]/pname"/>
+ <xsl:attribute name="href">http://gentoobrowse.randomdan.homeip.net/package/<xsl:value-of select="../../cname"/>/<xsl:value-of select="pname"/></xsl:attribute>
+ <xsl:value-of select="pname"/>
</a>
</h3>
<p>
- <xsl:value-of select="$versions[1]/description"/>
+ <xsl:value-of select="description"/>
</p>
<ul>
- <xsl:for-each select="$versions">
- <li><xsl:value-of select="cname"/>/<xsl:value-of select="pname"/>-<xsl:value-of select="version"/></li>
+ <xsl:for-each select="versions/version">
+ <li><xsl:value-of select="../../../../cname"/>/<xsl:value-of select="../../pname"/>-<xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
- </div>
+ </section>
</xsl:for-each>
</div>
</xsl:template>