2012-04-06 02:48:54 +04:00
|
|
|
import jingo
|
|
|
|
|
2012-04-25 06:22:59 +04:00
|
|
|
from django.shortcuts import redirect
|
|
|
|
|
|
|
|
from amo.urlresolvers import reverse
|
|
|
|
|
2012-04-08 04:27:18 +04:00
|
|
|
from mkt.webapps.models import Webapp
|
2012-04-06 02:48:54 +04:00
|
|
|
|
2012-04-11 12:29:56 +04:00
|
|
|
|
2012-04-06 02:48:54 +04:00
|
|
|
def home(request):
|
|
|
|
"""The home page."""
|
2012-04-25 06:22:59 +04:00
|
|
|
if not getattr(request, 'can_view_consumer', True):
|
|
|
|
return redirect(reverse('mkt.developers.index'))
|
2012-04-25 04:35:33 +04:00
|
|
|
featured = Webapp.featured('home')[:3]
|
2012-04-24 07:58:32 +04:00
|
|
|
popular = Webapp.popular()[:6]
|
2012-04-13 00:55:12 +04:00
|
|
|
return jingo.render(request, 'home/home.html', {
|
|
|
|
'featured': featured,
|
2012-04-21 02:34:10 +04:00
|
|
|
'popular': popular
|
2012-04-13 00:55:12 +04:00
|
|
|
})
|