예제 #1
0
파일: views.py 프로젝트: yoyo2011/kitsune
def home(request):
    """The home page."""
    if request.MOBILE:
        return redirect_to(request, 'products', permanent=False)

    return render(request, 'landings/home.html',
                  {'products': Product.objects.filter(visible=True)})
예제 #2
0
파일: views.py 프로젝트: 1234-/kitsune
def home(request):
    """The home page."""
    if request.MOBILE:
        return redirect_to(request, 'products', permanent=False)

    return render(request, 'landings/home.html', {
        'products': Product.objects.filter(visible=True)
    })
예제 #3
0
파일: views.py 프로젝트: Cherpak/kitsune
def home(request):
    """The home page."""
    if request.MOBILE:
        return redirect_to(request, 'products', permanent=False)

    products = Product.objects.filter(visible=True)
    moz_news = get_object_fallback(
        Document, MOZILLA_NEWS_DOC, request.LANGUAGE_CODE)

    return render(request, 'landings/home.html', {
        'products': products,
        'moz_news': moz_news})
예제 #4
0
파일: views.py 프로젝트: KhAMER3000/kitsune
def home(request):
    """The home page."""
    if request.MOBILE:
        return redirect_to(request, 'products', permanent=False)

    products = Product.objects.filter(visible=True)
    moz_news = get_object_fallback(Document, MOZILLA_NEWS_DOC,
                                   request.LANGUAGE_CODE)

    return render(request, 'landings/home.html', {
        'products': products,
        'moz_news': moz_news
    })
예제 #5
0
파일: views.py 프로젝트: KhAMER3000/kitsune
def desktop_or_mobile(request):
    """Redirect mobile browsers to /mobile and others to /home."""
    mobile = 'products'
    url_name = mobile if request.MOBILE else 'home'
    return redirect_to(request, url_name, permanent=False)
예제 #6
0
 def test_redirect_kwargs(self):
     resp = redirect_to(self.rf.get('/'),
                        url='users.confirm_email',
                        activation_key='1234')
     eq_(reverse('users.confirm_email', args=['1234']), resp['location'])
예제 #7
0
 def test_redirect_permanent(self):
     resp = redirect_to(self.rf.get('/'), url='home')
     assert isinstance(resp, HttpResponsePermanentRedirect)
     eq_(reverse('home'), resp['location'])
예제 #8
0
파일: views.py 프로젝트: Cherpak/kitsune
def desktop_or_mobile(request):
    """Redirect mobile browsers to /mobile and others to /home."""
    mobile = 'products'
    url_name = mobile if request.MOBILE else 'home'
    return redirect_to(request, url_name, permanent=False)
예제 #9
0
 def test_redirect_kwargs(self):
     resp = redirect_to(self.rf.get('/'), url='users.confirm_email',
                        activation_key='1234')
     eq_(reverse('users.confirm_email', args=['1234']),
         resp['location'])
예제 #10
0
 def test_redirect_permanent(self):
     resp = redirect_to(self.rf.get('/'), url='home')
     assert isinstance(resp, HttpResponsePermanentRedirect)
     eq_(reverse('home'), resp['location'])
예제 #11
0
 def test_redirect_permanent(self):
     resp = redirect_to(self.rf.get("/"), url="home")
     assert isinstance(resp, HttpResponsePermanentRedirect)
     eq_(reverse("home"), resp["location"])