Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
more tablet vs. mobile frolicking (bug 823984)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Dec 31, 2012
1 parent 1c0c01c commit 59f0188
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mkt/detail/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def detail(request, addon):
reviewed_filter = dict(user=request.user.id)
if addon.is_packaged:
reviewed_filter['version'] = addon.current_version
num_reviews = 2 if request.MOBILE else 6
num_reviews = 6 if request.TABLET or not request.MOBILE else 2
ctx = {
'product': addon,
'reviews': reviews[:num_reviews],
Expand Down
6 changes: 4 additions & 2 deletions mkt/home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ def home(request):
"""The home page."""
if not getattr(request, 'can_view_consumer', True):
return jingo.render(request, 'home/home_walled.html')
MOBILE = request.MOBILE and not request.TABLET
region = getattr(request, 'REGION', mkt.regions.WORLDWIDE)
featured = Webapp.featured(region=region, cat=None, mobile=False,
limit=6 if request.MOBILE else 12)
limit=6 if MOBILE else 12)

featured_cnt = len(featured)

# Show featured apps in multiples of three.
if request.MOBILE:
if MOBILE:
if featured_cnt >= 9:
featured = featured[:9]
elif featured_cnt >= 6:
Expand Down
2 changes: 1 addition & 1 deletion mkt/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _app_search(request, category=None, browse=None):

# If we're mobile, leave no witnesses. (i.e.: hide "Applied Filters:
# Mobile")
if request.MOBILE:
if request.MOBILE and not request.TABLET:
del query['device']

pager = amo.utils.paginate(request, qs)
Expand Down

0 comments on commit 59f0188

Please sign in to comment.