From b42d4caefedb7eeb8dd5d605daebb14c66b85785 Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 29 Jul 2010 23:54:14 +0000 Subject: Allow users to track specific packages of their choice Highlight them on the home page Change the atom feed to only show these packages Minor tweaks to work with changes for default values --- gentoobrowse/browse.xslt | 27 ++++++++++++++++++++++++++- gentoobrowse/home.xslt | 3 +++ gentoobrowse/present/atom.xml | 2 +- gentoobrowse/request/track.xml | 26 ++++++++++++++++++++++++++ gentoobrowse/request/untrack.xml | 17 +++++++++++++++++ gentoobrowse/style.css | 8 ++++++++ gentoobrowse/views/newebuilds.xml | 12 +++++++++--- gentoobrowse/views/newebuildsatom.xml | 23 +++++++++++++++++++++++ gentoobrowse/views/package.xml | 12 ++++++++++++ gentoobrowse/views/search.xml | 4 ++-- 10 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 gentoobrowse/request/track.xml create mode 100644 gentoobrowse/request/untrack.xml create mode 100644 gentoobrowse/views/newebuildsatom.xml diff --git a/gentoobrowse/browse.xslt b/gentoobrowse/browse.xslt index 26d5e25..db3f4f6 100644 --- a/gentoobrowse/browse.xslt +++ b/gentoobrowse/browse.xslt @@ -1,5 +1,6 @@ - + + + +
+ /untrack// + + + + + + +
+
+ +
+ /track// + + + + + + +
+
+

diff --git a/gentoobrowse/home.xslt b/gentoobrowse/home.xslt index 35fd4ef..0363a81 100644 --- a/gentoobrowse/home.xslt +++ b/gentoobrowse/home.xslt @@ -29,6 +29,9 @@
  • + + tracked + (updated ) diff --git a/gentoobrowse/present/atom.xml b/gentoobrowse/present/atom.xml index 1bd5d24..72c1695 100644 --- a/gentoobrowse/present/atom.xml +++ b/gentoobrowse/present/atom.xml @@ -1,4 +1,4 @@ - + diff --git a/gentoobrowse/request/track.xml b/gentoobrowse/request/track.xml new file mode 100644 index 0000000..c5e62e4 --- /dev/null +++ b/gentoobrowse/request/track.xml @@ -0,0 +1,26 @@ + + + + + Package already tracked + + SELECT COUNT(*) + FROM user_packages + WHERE packageid = ? + AND userid = ? + + + + + + + + INSERT INTO user_packages(packageid, userid, trackedsince) VALUES(?, ?, NOW()) + + + + + + + diff --git a/gentoobrowse/request/untrack.xml b/gentoobrowse/request/untrack.xml new file mode 100644 index 0000000..93c5108 --- /dev/null +++ b/gentoobrowse/request/untrack.xml @@ -0,0 +1,17 @@ + + + + + + DELETE FROM user_packages + WHERE packageid = ? + AND userid = ? + + + + + + + + diff --git a/gentoobrowse/style.css b/gentoobrowse/style.css index 8cfccbb..d0e558c 100644 --- a/gentoobrowse/style.css +++ b/gentoobrowse/style.css @@ -99,3 +99,11 @@ form.generalForm td input { border: 1px solid #aaaaff; width: 98%; } +form.tracker { + float: right; + margin-right: 30px; + margin-left: 30px; +} +.tracked { + font-weight: bold; +} diff --git a/gentoobrowse/views/newebuilds.xml b/gentoobrowse/views/newebuilds.xml index 7e26b37..a95fa3c 100644 --- a/gentoobrowse/views/newebuilds.xml +++ b/gentoobrowse/views/newebuilds.xml @@ -3,14 +3,20 @@ - SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, f.firstseen sync - FROM ebuilds e, files f, packages p, categories c + SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, f.firstseen sync, + up.trackedsince IS NOT NULL AS tracked + FROM ebuilds e, files f, categories c, packages p LEFT OUTER JOIN user_packages up + ON up.userid = ? + AND up.packageid = p.packageid WHERE e.ebuildid = f.fileid AND e.packageid = p.packageid AND p.categoryid = c.categoryid AND f.firstseen IN (SELECT DISTINCT f.firstseen FROM files f ORDER BY f.firstseen DESC LIMIT 3) - ORDER BY c.name, p.name, e.versioninst + ORDER BY tracked DESC, c.name, p.name, e.versioninst + + + diff --git a/gentoobrowse/views/newebuildsatom.xml b/gentoobrowse/views/newebuildsatom.xml new file mode 100644 index 0000000..fba9e2b --- /dev/null +++ b/gentoobrowse/views/newebuildsatom.xml @@ -0,0 +1,23 @@ + + + + + + SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, f.firstseen sync + FROM ebuilds e, files f, categories c, packages p, user_packages up, users u + WHERE e.ebuildid = f.fileid + AND e.packageid = p.packageid + AND p.categoryid = c.categoryid + AND up.userid = u.userid + AND u.username = ? + AND up.packageid = p.packageid + AND f.firstseen >= up.trackedsince + ORDER BY f.firstseen DESC, c.name, p.name, e.versioninst + LIMIT 50 + + + + + + + diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml index 28aff03..6ec12ec 100644 --- a/gentoobrowse/views/package.xml +++ b/gentoobrowse/views/package.xml @@ -14,6 +14,18 @@ + + + SELECT trackedsince + FROM user_packages up + WHERE up.packageid = ? + AND up.userid = ? + + + + + + SELECT e.ebuildid, e.version diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml index 65db6b8..3d6a72d 100644 --- a/gentoobrowse/views/search.xml +++ b/gentoobrowse/views/search.xml @@ -13,8 +13,8 @@ order by rank desc, p.name - - + + -- cgit v1.2.3