bodhi/controllers.py | 2 +- bodhi/rss.py | 10 +++++++++- bodhi/templates/master.kid | 8 ++++++-- bodhi/templates/user.kid | 11 ++++++++++- 4 files changed, 26 insertions(+), 5 deletions(-)
New commits: commit 8ea082155833c0f0399d647275b2605411e88228 Author: Till Maas opensource@till.name Date: Fri Feb 12 19:32:42 2010 +0100
rss: allow feed selection by build
diff --git a/bodhi/rss.py b/bodhi/rss.py index 17b1227..decea86 100644 --- a/bodhi/rss.py +++ b/bodhi/rss.py @@ -25,7 +25,7 @@ log = logging.getLogger(__name__) class Feed(FeedController):
def get_feed_data(self, release=None, type=None, status=None, - comments=False, submitter=None, *args, **kw): + comments=False, submitter=None, builds=None, *args, **kw): query = [] entries = [] date = lambda update: update.date_pushed @@ -61,6 +61,10 @@ class Feed(FeedController): query.append(PackageUpdate.q.submitter == submitter) title.append("submitted by %s" % submitter)
+ if builds: + query.append(PackageUpdate.q.builds == builds) + title.append("for %s" % builds) + updates = PackageUpdate.select(AND(*query), orderBy=order).reversed()[:20]
for update in updates:
commit 2235679c44e1b0ac9c895bfdbf646d38d16800d4 Author: Till Maas opensource@till.name Date: Tue Dec 16 14:19:15 2008 +0100
- add RSS feed URLs to html metadata - add update feeds for a certain user to the user page
diff --git a/bodhi/controllers.py b/bodhi/controllers.py index 516d7cb..e3156e7 100644 --- a/bodhi/controllers.py +++ b/bodhi/controllers.py @@ -1221,7 +1221,7 @@ class Root(controllers.RootController): orderBy=PackageUpdate.q.date_submitted) num_items = updates.count() return dict(updates=updates.reversed(), - title="%s's %d updates" % (username, num_items), + username=username, num_items=num_items)
@expose(allow_json=True) diff --git a/bodhi/templates/master.kid b/bodhi/templates/master.kid index 61f67d2..a9815a9 100644 --- a/bodhi/templates/master.kid +++ b/bodhi/templates/master.kid @@ -1,5 +1,7 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<?python import sitetemplate ?> +<?python import sitetemplate +from bodhi.model import Release, PackageUpdate, Releases +?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#" py:extends="sitetemplate">
<head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'" py:attrs="item.items()"> @@ -7,6 +9,9 @@ <meta name="robots" content="noindex,nofollow" /> <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="${tg.url('/static/images/favicon.ico')}" /> <link rel="shortcut icon" type="image/x-icon" href="${tg.url('/static/images/favicon.ico')}" /> + <link py:for="release_name in [release['name'] for release in Releases().data]" py:strip="True"> + <link py:for="status in ('pending', 'testing', 'stable')" href="${tg.url('/rss/rss2.0?release=%s&status=%s' % (release_name, status))}" rel="alternate" type="application/rss+xml" title="${'%s %s updates' % (release_name, status)}" /> + </link> <title py:replace="''">Your title goes here</title> <script type="text/javascript" charset="utf-8" src="${tg.url('/static/js/jquery.js')}"></script> <script type="text/javascript" charset="utf-8" src="${tg.url('/static/js/jquery.corner.js')}"></script> @@ -22,7 +27,6 @@
<?python from bodhi import version, hostname -from bodhi.model import Release, PackageUpdate, Releases from bodhi.search import search_form from sqlobject.sqlbuilder import AND ?> diff --git a/bodhi/templates/user.kid b/bodhi/templates/user.kid index 24f5502..2244e3c 100644 --- a/bodhi/templates/user.kid +++ b/bodhi/templates/user.kid @@ -2,13 +2,22 @@ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#" py:extends="'master.kid'">
+<?python +from bodhi.model import Release, PackageUpdate, Releases +?> <head> <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> + <!-- copy&pasted from master.kid with username added --> + <link py:for="release_name in [release['name'] for release in Releases().data]" py:strip="True"> + <link py:for="status in ('pending', 'testing', 'stable')" href="${tg.url('/rss/rss2.0?release=%s&status=%s&submitter=%s' % (release_name, status, username))}" rel="alternate" type="application/rss+xml" title="${'%s %s updates submitted by %s' % (release_name, status, username)}" /> + </link> + <!-- Feed for all updates by one user --> + <link href="${tg.url('/rss/rss2.0?submitter=%s' % (username))}" rel="alternate" type="application/rss+xml" title="${'All updates submitted by %s' % (username)}" /> <title>Fedora Updates</title> </head>
<body> - <b>${title}</b> + <b>${"%s's %d updates" % (username, num_items)}</b> <div py:if="num_items" class="list"> <span py:for="page in tg.paginate.pages"> <a py:if="page != tg.paginate.current_page"
commit 9ea27aaaa54400362d02c504670753217de8a679 Author: Till Maas opensource@till.name Date: Tue Dec 16 12:45:03 2008 +0100
- allow update selection for rss feeds by submitter
diff --git a/bodhi/rss.py b/bodhi/rss.py index 3e715b7..17b1227 100644 --- a/bodhi/rss.py +++ b/bodhi/rss.py @@ -25,7 +25,7 @@ log = logging.getLogger(__name__) class Feed(FeedController):
def get_feed_data(self, release=None, type=None, status=None, - comments=False, *args, **kw): + comments=False, submitter=None, *args, **kw): query = [] entries = [] date = lambda update: update.date_pushed @@ -57,6 +57,10 @@ class Feed(FeedController): else: query.append(PackageUpdate.q.pushed == True)
+ if submitter: + query.append(PackageUpdate.q.submitter == submitter) + title.append("submitted by %s" % submitter) + updates = PackageUpdate.select(AND(*query), orderBy=order).reversed()[:20]
for update in updates: