summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse/emails/base.xslt69
-rw-r--r--gentoobrowse/emails/newpackageversions.xml7
-rw-r--r--gentoobrowse/emails/newpackageversions.xslt54
3 files changed, 104 insertions, 26 deletions
diff --git a/gentoobrowse/emails/base.xslt b/gentoobrowse/emails/base.xslt
new file mode 100644
index 0000000..a8ceaac
--- /dev/null
+++ b/gentoobrowse/emails/base.xslt
@@ -0,0 +1,69 @@
+<?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" exclude-result-prefixes="project2" >
+ <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" />
+
+ <xsl:template match="/*">
+ <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;&#10;</xsl:text>
+ <html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <link href="http://gentoobrowse.randomdan.homeip.net/css/bootstrap.min.css" rel="stylesheet" media="screen" />
+ <link href="http://gentoobrowse.randomdan.homeip.net/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen" />
+ <link href="http://gentoobrowse.randomdan.homeip.net/css/general.css" rel="stylesheet" media="screen" />
+ <xsl:call-template name="head" />
+ </head>
+ <body data-spy="scroll" data-target=".bs-docs-sidebar">
+ <!-- nav -->
+ <nav class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="brand" href="http://gentoobrowse.randomdan.homeip.net/">Gentoo Browse</a>
+ <div class="nav-collapse collapse">
+ <ul class="nav">
+ <li><a href="http://gentoobrowse.randomdan.homeip.net/">Home</a></li>
+ <li><a href="http://gentoobrowse.randomdan.homeip.net/categories">Browse</a></li>
+ <li><a href="http://gentoobrowse.randomdan.homeip.net/popular">Popular</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </nav>
+
+ <!-- page content -->
+ <header class="jumbotron subhead">
+ <div class="container">
+ <xsl:call-template name="header" />
+ </div>
+ </header>
+ <div class="container">
+ <article class="row">
+ <xsl:call-template name="content" />
+ </article>
+ </div>
+
+ <!-- footer -->
+ <footer class="footer">
+ <div class="container">
+ <p>Gentoo Browse is not an official Gentoo website. The name "Gentoo" and the "g" logo are trademarks of the Gentoo Foundation, Inc.</p>
+ </div>
+ </footer>
+
+ <script src="http://code.jquery.com/jquery-latest.js"></script>
+ <script src="http://gentoobrowse.randomdan.homeip.net/js/bootstrap.min.js"></script>
+ <script src="http://gentoobrowse.randomdan.homeip.net/js/js.js"></script>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="head">
+ </xsl:template>
+
+ <xsl:template name="header">
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/gentoobrowse/emails/newpackageversions.xml b/gentoobrowse/emails/newpackageversions.xml
index 679641c..a44ad10 100644
--- a/gentoobrowse/emails/newpackageversions.xml
+++ b/gentoobrowse/emails/newpackageversions.xml
@@ -3,9 +3,9 @@
xmlns:project2="http://project2.randomdan.homeip.net">
<project2:sqlrows name="newpackageversions" datasource="postgres">
<sql>
- select ut.cname, ut.pname, ut.version
+ select ut.cname, ut.pname, ut.version, ut.description
from (
- select e.ebuildid, up.userid, u.useremail, p.name as pname, c.name as cname, e.version
+ select e.ebuildid, up.userid, u.useremail, p.name as pname, c.name as cname, e.version, p.description
from ebuilds e, user_packages up, users u, packages p, categories c
where e.packageid = up.packageid
and u.userid = up.userid
@@ -22,6 +22,9 @@
<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>
</view>
diff --git a/gentoobrowse/emails/newpackageversions.xslt b/gentoobrowse/emails/newpackageversions.xslt
index e5e23be..3eb6c32 100644
--- a/gentoobrowse/emails/newpackageversions.xslt
+++ b/gentoobrowse/emails/newpackageversions.xslt
@@ -1,28 +1,34 @@
-<?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" exclude-result-prefixes="project2" >
- <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes"
- doctype-system="http://www.w3.org/TR/html4/loose.dtd"
- doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
- <xsl:template match="/newpackageversions">
- <html>
- <head>
- <title>Welcome to Gentoo Browse</title>
- </head>
- <body>
- <p>All new shiny ebuilds available!</p>
- <ul>
- <xsl:for-each select="newpackageversions/version">
- <li>
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://exslt.org/strings" xmlns:project2="http://project2.randomdan.homeip.net" version="1.0" exclude-result-prefixes="project2 fn">
+ <xsl:import href="base.xslt"/>
+ <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes"/>
+
+ <xsl:template name="header">
+ <h2>New versions of packages you're tracking.</h2>
+ </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]]"/>
+ <h3>
+ <xsl:value-of select="$versions[1]/cname"/> /
<a>
- <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="cname"/>/<xsl:value-of select="pname"/>-<xsl:value-of select="version"/>
+ <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"/>
</a>
- </li>
- </xsl:for-each>
- </ul>
- </body>
- </html>
+ </h3>
+ <p>
+ <xsl:value-of select="$versions[1]/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>
+ </ul>
+ </div>
+ </xsl:for-each>
+ </div>
</xsl:template>
</xsl:stylesheet>
-