Ejemplo n.º 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')
Ejemplo n.º 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')