summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-06-10 09:35:14 +0000
committerrandomdan <randomdan@localhost>2010-06-10 09:35:14 +0000
commite7da7ef903e42eb59eca27226f488deee2620682 (patch)
treecfda1f8e394abc049a0ef0d093229dd2abd88da5
parentPort of gentoobrowse to project, WIP (diff)
downloadgentoobrowse-e7da7ef903e42eb59eca27226f488deee2620682.tar.bz2
gentoobrowse-e7da7ef903e42eb59eca27226f488deee2620682.tar.xz
gentoobrowse-e7da7ef903e42eb59eca27226f488deee2620682.zip
Add top level browse page
-rw-r--r--gentoobrowse/present/categories.xml4
-rw-r--r--gentoobrowse/views/categories.xml13
2 files changed, 17 insertions, 0 deletions
diff --git a/gentoobrowse/present/categories.xml b/gentoobrowse/present/categories.xml
new file mode 100644
index 0000000..5b886a5
--- /dev/null
+++ b/gentoobrowse/present/categories.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<view name="categories" root="gentoo" style="browse.xslt" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="../views/categories.xml" />
+</view>
diff --git a/gentoobrowse/views/categories.xml b/gentoobrowse/views/categories.xml
new file mode 100644
index 0000000..ed53caa
--- /dev/null
+++ b/gentoobrowse/views/categories.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<block xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="../datasources/postgres.xml" />
+ <sqlview name="categories" recordname="category" datasource="postgres">
+ <sql>
+ SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages
+ FROM categories c, packages p
+ WHERE c.categoryid = p.categoryid
+ GROUP BY c.categoryid
+ ORDER BY MIN(c.name)
+ </sql>
+ </sqlview>
+</block>