Merge lp:~michael.nelson/ubuntu-webcatalog/bigger-stars into lp:ubuntu-webcatalog

Proposed by Michael Nelson
Status: Merged
Approved by: David Owen
Approved revision: 53
Merged at revision: 49
Proposed branch: lp:~michael.nelson/ubuntu-webcatalog/bigger-stars
Merge into: lp:ubuntu-webcatalog
Diff against target: 112 lines (+12/-8)
6 files modified
.bzrignore (+1/-0)
src/webcatalog/static/css/webcatalog.css (+3/-0)
src/webcatalog/templates/webcatalog/application_detail.html (+1/-1)
src/webcatalog/templates/webcatalog/rating_summary.html (+2/-2)
src/webcatalog/templatetags/webcatalog.py (+2/-2)
src/webcatalog/tests/test_views.py (+3/-3)
To merge this branch: bzr merge lp:~michael.nelson/ubuntu-webcatalog/bigger-stars
Reviewer Review Type Date Requested Status
David Owen (community) Approve
Review via email: mp+71547@code.launchpad.net

Commit message

Use bigger star images for ratings (from recent USC tree).

Description of the change

Overview
========

This branch updates the images used for the rating summary (the stars):

http://people.canonical.com/~michaeln/tmp/bigger-stars-list.png

and enables large stars to be used for the detail view:

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

Details
=======
Turns out, since I did the first version of the stars on webcat, softwarecenter had the new qml interface added to trunk, which includes png's of the small and large stars (which I've used here).

To test:
`fab test`

To post a comment you must log in.
Revision history for this message
David Owen (dsowen) wrote :

Nice use of parameters on the template tag (nice use of template tags, even).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-07-19 15:44:09 +0000
3+++ .bzrignore 2011-08-15 11:39:22 +0000
4@@ -11,3 +11,4 @@
5 sourcecode/framework/
6 sourcecode/django/
7 django_project/rnrclient.py
8+django_project/adminaudit
9
10=== modified file 'src/webcatalog/static/css/webcatalog.css'
11--- src/webcatalog/static/css/webcatalog.css 2011-08-09 19:48:37 +0000
12+++ src/webcatalog/static/css/webcatalog.css 2011-08-15 11:39:22 +0000
13@@ -210,6 +210,9 @@
14 width: 100px;
15 float: right;
16 }
17+.star-rating.large {
18+ width: 175px;
19+}
20 #sc-mockup .star-rating img {
21 margin: 0;
22 float: none;
23
24=== added file 'src/webcatalog/static/images/star-large-0.5.png'
25Binary files src/webcatalog/static/images/star-large-0.5.png 1970-01-01 00:00:00 +0000 and src/webcatalog/static/images/star-large-0.5.png 2011-08-15 11:39:22 +0000 differ
26=== added file 'src/webcatalog/static/images/star-large-0.png'
27Binary files src/webcatalog/static/images/star-large-0.png 1970-01-01 00:00:00 +0000 and src/webcatalog/static/images/star-large-0.png 2011-08-15 11:39:22 +0000 differ
28=== added file 'src/webcatalog/static/images/star-large-1.png'
29Binary files src/webcatalog/static/images/star-large-1.png 1970-01-01 00:00:00 +0000 and src/webcatalog/static/images/star-large-1.png 2011-08-15 11:39:22 +0000 differ
30=== renamed file 'src/webcatalog/static/images/star-0.5.png' => 'src/webcatalog/static/images/star-small-0.5.png'
31Binary files src/webcatalog/static/images/star-0.5.png 2011-07-21 12:57:52 +0000 and src/webcatalog/static/images/star-small-0.5.png 2011-08-15 11:39:22 +0000 differ
32=== renamed file 'src/webcatalog/static/images/star-0.png' => 'src/webcatalog/static/images/star-small-0.png'
33Binary files src/webcatalog/static/images/star-0.png 2011-07-21 12:57:52 +0000 and src/webcatalog/static/images/star-small-0.png 2011-08-15 11:39:22 +0000 differ
34=== renamed file 'src/webcatalog/static/images/star-1.png' => 'src/webcatalog/static/images/star-small-1.png'
35Binary files src/webcatalog/static/images/star-1.png 2011-07-21 12:57:52 +0000 and src/webcatalog/static/images/star-small-1.png 2011-08-15 11:39:22 +0000 differ
36=== modified file 'src/webcatalog/templates/webcatalog/application_detail.html'
37--- src/webcatalog/templates/webcatalog/application_detail.html 2011-08-09 19:48:37 +0000
38+++ src/webcatalog/templates/webcatalog/application_detail.html 2011-08-15 11:39:22 +0000
39@@ -24,7 +24,7 @@
40 </div>
41 <div id="sc-mockup">
42 <div class="header">
43- {% rating_summary application %}
44+ {% rating_summary application 'large' %}
45 {% if application.icon %}
46 <img class="icon64" src="{{ application.icon.url }}"/>
47 {% else %}
48
49=== modified file 'src/webcatalog/templates/webcatalog/rating_summary.html'
50--- src/webcatalog/templates/webcatalog/rating_summary.html 2011-07-21 11:31:10 +0000
51+++ src/webcatalog/templates/webcatalog/rating_summary.html 2011-08-15 11:39:22 +0000
52@@ -1,8 +1,8 @@
53 {% load i18n %}
54 {% if total %}
55-<div class="star-rating">
56+<div class="star-rating {{ size }}">
57 {% for star in stars %}
58- <img src="{{ STATIC_URL }}images/star-{{ star }}.png" />
59+ <img src="{{ STATIC_URL }}images/star-{{ size }}-{{ star }}.png" />
60 {% endfor %}
61 <p>{% blocktrans %}{{ total }} Ratings{% endblocktrans %}</p>
62 </div>
63
64=== modified file 'src/webcatalog/templatetags/webcatalog.py'
65--- src/webcatalog/templatetags/webcatalog.py 2011-07-21 13:38:37 +0000
66+++ src/webcatalog/templatetags/webcatalog.py 2011-08-15 11:39:22 +0000
67@@ -183,7 +183,7 @@
68
69
70 @register.inclusion_tag("webcatalog/rating_summary.html")
71-def rating_summary(app):
72+def rating_summary(app, size='small'):
73 stars = []
74 if not app.ratings_average:
75 return {}
76@@ -198,4 +198,4 @@
77 stars.append(0)
78
79 return dict(stars=stars, total=app.ratings_total,
80- STATIC_URL=settings.STATIC_URL)
81+ STATIC_URL=settings.STATIC_URL, size=size)
82
83=== modified file 'src/webcatalog/tests/test_views.py'
84--- src/webcatalog/tests/test_views.py 2011-08-09 19:48:37 +0000
85+++ src/webcatalog/tests/test_views.py 2011-08-15 11:39:22 +0000
86@@ -181,7 +181,7 @@
87 url = reverse('wc-package-detail', args=['lucid', 'foo'])
88 response = self.client.get(url)
89
90- self.assertContains(response, 'images/star-1.png', 3)
91+ self.assertContains(response, 'images/star-large-1.png', 3)
92 self.assertContains(response, '23 Ratings', 1)
93
94
95@@ -312,7 +312,7 @@
96
97 response = self.client.get(url, data={'q': query})
98
99- self.assertContains(response, 'images/star-1.png', 3)
100+ self.assertContains(response, 'images/star-small-1.png', 3)
101 self.assertContains(response, '23 Ratings', 1)
102
103 def test_response_shows_number_of_apps_found(self):
104@@ -476,7 +476,7 @@
105 url = reverse('wc-department', args=['lucid', dept.id])
106 response = self.client.get(url)
107
108- self.assertContains(response, 'images/star-1.png', 3)
109+ self.assertContains(response, 'images/star-small-1.png', 3)
110 self.assertContains(response, '23 Ratings', 1)
111
112 def test_invalid_distroseries_returns_404(self):

Subscribers

People subscribed via source and target branches