Merge lp:~zematynnad/ubuntu-webcatalog/icons_944232 into lp:ubuntu-webcatalog

Proposed by Danny Tamez
Status: Merged
Approved by: Anthony Lenton
Approved revision: 71
Merged at revision: 73
Proposed branch: lp:~zematynnad/ubuntu-webcatalog/icons_944232
Merge into: lp:ubuntu-webcatalog
Diff against target: 46 lines (+14/-3)
2 files modified
src/webcatalog/templates/webcatalog/application_overview_snippet.html (+2/-2)
src/webcatalog/tests/test_views.py (+12/-1)
To merge this branch: bzr merge lp:~zematynnad/ubuntu-webcatalog/icons_944232
Reviewer Review Type Date Requested Status
Michael Nelson (community) Approve
Review via email: mp+96650@code.launchpad.net

Commit message

Add links to icons in search results and directory browsing.

Description of the change

OVERVIEW
========
This branch adds links to the icons already being displayed for applications in search results and category browsing.

DETAILS
========
The same link being used for the application name is being used for the icons. The change only needed to be made in one snippet since both pages use the same snippet.

TO TEST
=======
fab bootstrap test

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Hi Danny,

We should at some point start using an html/xml parser to check out tests... but for the moment, updating the test to check for '<a href="...."' will pick up the small typo you've got on line 9 (<a eref="..) Otherwise, great stuff! I'll add an approve vote now so you can land it with the typo fixed.

review: Approve
Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/webcatalog/templates/webcatalog/application_overview_snippet.html'
2--- src/webcatalog/templates/webcatalog/application_overview_snippet.html 2011-09-15 10:53:40 +0000
3+++ src/webcatalog/templates/webcatalog/application_overview_snippet.html 2012-03-09 16:53:23 +0000
4@@ -4,9 +4,9 @@
5 <tr>
6 <td class="app-icon">
7 {% if app.icon %}
8- <img src="{{ app.icon.url }}" width="32" height="32" />
9+ <a href="{% url wc-package-detail app.distroseries.code_name app.package_name %}"><img src="{{ app.icon.url }}" width="32" height="32"/></a>
10 {% else %}
11- <img src="{{ STATIC_URL }}images/applications-other.png"/>
12+ <a href="{% url wc-package-detail app.distroseries.code_name app.package_name %}"><img src="{{ STATIC_URL }}images/applications-other.png"/></a>
13 {% endif %}
14 </td>
15 <td class="app-description">
16
17=== modified file 'src/webcatalog/tests/test_views.py'
18--- src/webcatalog/tests/test_views.py 2012-03-08 21:50:03 +0000
19+++ src/webcatalog/tests/test_views.py 2012-03-09 16:53:23 +0000
20@@ -373,6 +373,17 @@
21 self.assertEquals(
22 expected[q], set(response.context['page'].object_list))
23
24+ def test_search_includes_link_to_app(self):
25+ distro = self.factory.make_distroseries(code_name='lucid')
26+ app = self.factory.make_application(name='foo',
27+ distroseries=distro)
28+ url = reverse('wc-search', args=[distro.code_name])
29+
30+ response = self.client.get(url, data={'q': 'foo'})
31+
32+ self.assertContains(response, reverse('wc-package-detail',
33+ args=[app.distroseries.code_name, app.package_name]), count=2)
34+
35 def test_search_no_apps_found_says_so(self):
36 distro = self.factory.make_distroseries(code_name='lucid')
37 url = reverse('wc-search', args=[distro.code_name])
38@@ -535,7 +546,7 @@
39 app.distroseries.code_name, dept.id]))
40
41 self.assertContains(response, reverse('wc-package-detail',
42- args=[app.distroseries.code_name, app.package_name]))
43+ args=[app.distroseries.code_name, app.package_name]), count=2)
44
45 def test_department_with_no_subdepts_doesnt_contain_header(self):
46 dept = self.factory.make_department('bar')

Subscribers

People subscribed via source and target branches