summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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>