Merge lp:~michael.nelson/ubuntu-webcatalog/8133346-depend-on-rnr-client into lp:ubuntu-webcatalog

Proposed by Michael Nelson
Status: Merged
Approved by: Łukasz Czyżykowski
Approved revision: 46
Merged at revision: 45
Proposed branch: lp:~michael.nelson/ubuntu-webcatalog/8133346-depend-on-rnr-client
Merge into: lp:ubuntu-webcatalog
Diff against target: 61 lines (+18/-1)
4 files modified
debian/control (+2/-1)
src/webcatalog/static/css/webcatalog.css (+5/-0)
src/webcatalog/templates/webcatalog/application_detail.html (+1/-0)
src/webcatalog/tests/test_views.py (+10/-0)
To merge this branch: bzr merge lp:~michael.nelson/ubuntu-webcatalog/8133346-depend-on-rnr-client
Reviewer Review Type Date Requested Status
Canonical ISD hackers Pending
Review via email: mp+69415@code.launchpad.net

Commit message

Adds dependency on rnrclient package and adds star ratings to detail pages.

Description of the change

Overview
========

This branch adds the dependency on python-ubuntu-rnr-client. I've added a packaging branch with the build recipe at:

https://code.launchpad.net/~rnr-developers/+recipe/rnr-client-lucid

and build/published the result to our canonical-isd-hackers PPA.

While I was there, I also took the chance to add the start ratings to the details page:

http://people.canonical.com/~michaeln/tmp/8133346-stars-on-detail.png

It's not perfect - to match USC the stars on the details page should be larger - but we can tweak that later (IMO).

Tests: `fab bootstrap` followed by `fab test`.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2011-07-05 16:09:31 +0000
3+++ debian/control 2011-07-27 09:24:40 +0000
4@@ -24,6 +24,7 @@
5 python-django-south,
6 python-django-openid-auth,
7 python-wsgi-oops,
8- python-apt
9+ python-apt,
10+ python-ubuntu-rnr-client
11 Description: Ubuntu Web Catalog
12 Providing web access to the Ubuntu Software Center.
13
14=== modified file 'src/webcatalog/static/css/webcatalog.css'
15--- src/webcatalog/static/css/webcatalog.css 2011-07-21 13:38:37 +0000
16+++ src/webcatalog/static/css/webcatalog.css 2011-07-27 09:24:40 +0000
17@@ -202,6 +202,11 @@
18 }
19 .star-rating {
20 width: 100px;
21+ float: right;
22+}
23+#sc-mockup .star-rating img {
24+ margin: 0;
25+ float: none;
26 }
27
28 /* Breadcrumbs styles */
29
30=== modified file 'src/webcatalog/templates/webcatalog/application_detail.html'
31--- src/webcatalog/templates/webcatalog/application_detail.html 2011-07-04 14:47:05 +0000
32+++ src/webcatalog/templates/webcatalog/application_detail.html 2011-07-27 09:24:40 +0000
33@@ -24,6 +24,7 @@
34 </div>
35 <div id="sc-mockup">
36 <div class="header">
37+ {% rating_summary application %}
38 {% if application.icon %}
39 <img class="icon64" src="{{ application.icon.url }}"/>
40 {% else %}
41
42=== modified file 'src/webcatalog/tests/test_views.py'
43--- src/webcatalog/tests/test_views.py 2011-07-21 13:38:37 +0000
44+++ src/webcatalog/tests/test_views.py 2011-07-27 09:24:40 +0000
45@@ -166,6 +166,16 @@
46 self.assertContains(response, '<td>Proprietary</td>')
47 self.assertNotContains(response, '<td>Open Source</td>')
48
49+ def test_response_includes_rating_summary(self):
50+ distro = self.factory.make_distroseries(code_name='lucid')
51+ self.factory.make_application(package_name='foo', distroseries=distro,
52+ ratings_average=Decimal('3.5'), ratings_total=23)
53+
54+ url = reverse('wc-package-detail', args=['lucid', 'foo'])
55+ response = self.client.get(url)
56+
57+ self.assertContains(response, 'images/star-1.png', 3)
58+ self.assertContains(response, '23 Ratings', 1)
59
60
61 class ApplicationDetailNoSeriesTestCase(TestCaseWithFactory):

Subscribers

People subscribed via source and target branches