Exemple #1
0
def mobile_get_one_thread(request, postid):
    '''' get a single thread page '''
    ctx = get_basic_context(request, True)
    ctx['in_thread_view'] = True
    if not ctx.get('loc', None):
        return HttpResponseRedirect("/m/first?next=%s" % urllib.quote(request.path))
    update_onepost_context(ctx, postid)
    return render_with_cookie(request, ctx, 'mobile/main.html')
Exemple #2
0
def mobile_mainpage(request):
    ''' get the start page (if loc is unset) or the main page '''
    ctx = get_basic_context(request, True)

    ctx['postform'] = PostForm(request.POST, request.FILES)
    if request.GET.get('force_change', None) or not ctx.get('loc', None):
        # redirect to first.html if loc is unset
        return HttpResponseRedirect("/m/first")
        #return render_to_response('mobile/first.html', ctx)
    add_latest_to_context(request, ctx)
    #ctx['postboxtemplate'] = 'mobile/mobile_postbox.html'
    return render_with_cookie(request, ctx, 'mobile/main.html')
Exemple #3
0
def mobile_prefs(request):
    ''' get the prefs page. note that all the smarts are in js '''
    if request.POST.get("set", None) == "1":
        resp = HttpResponse(content="Preferences set! Redirecting...", 
                            status=303)
        resp["Location"] = "/m/" 
        #resp.set_cookie('round', get_current_rounding(request),
        #                max_age = c.OWNER_TOKEN_EXPIRES,
        #                expires = c.OWNER_TOKEN_EXPIRES)
        resp.set_cookie('radius', get_current_radius(request),
                        max_age = c.OWNER_TOKEN_EXPIRES,
                        expires = c.OWNER_TOKEN_EXPIRES)
        return resp

    ctx = get_basic_context(request, True)
    return render_to_response('mobile/prefs.html', ctx)
Exemple #4
0
def mobile_first(request):
    """ show the first page of the app """
    ctx = get_basic_context(request, True)
    import_next_into_context(request, ctx)
    return render_to_response('mobile/first.html', ctx)
Exemple #5
0
def mobile_select_address(request):
    ''' get the select-address page. note that all the smarts are in js '''
    ctx = get_basic_context(request, True)
    import_next_into_context(request, ctx)
    return render_to_response('mobile/selectaddress.html', ctx)
Exemple #6
0
def mobile_map(request):
    ''' get the map page. note that all the smarts are in js '''
    return render_to_response('mobile/map.html', 
                              get_basic_context(request, True))