Skip to content

Commit

Permalink
show adu on mobile details pages (bug 692299)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Oct 14, 2011
1 parent 553e359 commit f588aa0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 3 additions & 3 deletions apps/addons/templates/addons/mobile/details.html
Expand Up @@ -66,9 +66,9 @@ <h4 class="author">{{ _('by') }} {{ users_list(addon.listed_authors) }}</h4>
<td>{{ addon.compatible_apps[APP] }}</td>
</tr>
{% endif %}
<tr>
<th>{{ _('Downloads', 'list_sortby_downloads') }}</th>
<td>{{ addon.total_downloads|numberfmt }}</td>
<tr class="adu">
<th>{{ _('Users') }}</th>
<td>{{ addon.average_daily_users|numberfmt }}</td>
</tr>
{% set version = addon.current_version if not addon.is_webapp() else None %}
{% if version %}
Expand Down
11 changes: 10 additions & 1 deletion apps/addons/tests/test_views.py
Expand Up @@ -21,7 +21,7 @@

import amo
import amo.tests
from amo.helpers import absolutify
from amo.helpers import absolutify, numberfmt
from amo.tests.test_helpers import get_image_path
from amo.urlresolvers import reverse
from abuse.models import AbuseReport
Expand Down Expand Up @@ -915,6 +915,11 @@ def setUp(self):
self.url = self.addon.get_url_path()
self.more_url = self.addon.get_url_path(more=True)

def test_adu(self):
doc = pq(self.client.get(self.url).content)
eq_(doc('#daily-users').text().split()[0],
numberfmt(self.addon.average_daily_users))

def test_perf_warning(self):
eq_(self.addon.ts_slowness, None)
doc = pq(self.client.get(self.url).content)
Expand Down Expand Up @@ -1386,6 +1391,10 @@ def test_extension_release_notes(self):
self.client.get(version_url, follow=True)
eq_(r.status_code, 200)

def test_extension_adu(self):
doc = pq(self.client.get(self.url).content)
eq_(doc('.adu td').text(), numberfmt(self.ext.average_daily_users))

def test_button_caching(self):
"""The button popups should be cached for a long time."""
# Get the url from a real page so it includes the build id.
Expand Down
10 changes: 9 additions & 1 deletion media/css/zamboni/mobile.css
Expand Up @@ -193,6 +193,10 @@ html {
table {
width: 100%;
}
table th,
table td {
vertical-align: top;
}
table th {
text-align: right;
padding: 0 8px 8px 0;
Expand Down Expand Up @@ -901,7 +905,10 @@ a.listview:before {

td .versions li a {
display: block;
padding: 4px 0;
margin: 0 0 8px;
}
td .versions li:last-child a {
margin: 0;
}

.author,
Expand Down Expand Up @@ -1367,6 +1374,7 @@ li.persona-previewer {
.badges .warning {
background-color: #fef9d7;
border-color: #bebaa1;
cursor: pointer;
}
.install .privacy-policy {
display: block;
Expand Down

0 comments on commit f588aa0

Please sign in to comment.