예제 #1
0
파일: views.py 프로젝트: Bahusson/e-sks
def pagemap(request):
    pe_i = pe(In)
    pe_b = pe(B)
    pe_f = pe(F)
    api = ActivePageItems(request, B, pytz, datetime)
    active_blogs = api.active_items
    api = ActivePageItems(request, In, pytz, datetime)
    active_infos = api.active_items
    api = ActivePageItems(request, F, pytz, datetime)
    active_files = api.active_items
    if request.user.is_authenticated:
        userlevel = request.user.role_council
        if userlevel > 0:
            active_blogs = pe_b.listed
            active_infos = pe_i.listed
            active_files = pe_f.listed
    context = {
        'blogs': active_blogs,
        'infos': active_infos,
        'files': active_files,
    }
    pl = PageLoad(P, L)
    context_lazy = pl.lazy_context(skins=S, context=context)
    template = 'strona/pagemap.html'
    return render(request, template, context_lazy)
예제 #2
0
파일: views.py 프로젝트: Bahusson/e-sks
def allfiles(request):
    # pe_f = pe(F)
    api = ActivePageItems(request, F, pytz, datetime)
    active_files = api.active_items
    context = {
        'files': active_files,
    }
    pl = PageLoad(P, L)
    context_lazy = pl.lazy_context(skins=S, context=context)
    template = 'strona/allfiles.html'
    return render(request, template, context_lazy)
예제 #3
0
파일: views.py 프로젝트: Bahusson/e-sks
def allinfos(request):
    # pe_i = pe(In)
    api = ActivePageItems(request, In, pytz, datetime)
    active_infos = api.active_items
    context = {
        'infos': active_infos,
    }
    pl = PageLoad(P, L)
    context_lazy = pl.lazy_context(skins=S, context=context)
    template = 'strona/allinfos.html'
    return render(request, template, context_lazy)
예제 #4
0
파일: views.py 프로젝트: Bahusson/e-sks
def allblogs(request):
    # pe_b = pe(B)
    api = ActivePageItems(request, B, pytz, datetime)
    active_blogs = api.active_items
    context = {
        'blogs': active_blogs,
    }
    pl = PageLoad(P, L)
    context_lazy = pl.lazy_context(skins=S, context=context)
    template = 'strona/allblogs.html'
    return render(request, template, context_lazy)
예제 #5
0
파일: views.py 프로젝트: Bahusson/e-sks
def blog(request, blog_id):
    pe_b = pe(B)
    pe_b_id = pe_b.by_id(G404=G404, id=blog_id)
    pe_i = pe(In)
    pe_f = pe(F)
    context = {
        'blog': pe_b_id,
        'infos': pe_i.elements,
        'files': pe_f.elements,
    }
    pl = PageLoad(P, L)
    context_lazy = pl.lazy_context(skins=S, context=context)
    template = 'strona/blog.html'
    return render(request, template, context_lazy)
예제 #6
0
파일: views.py 프로젝트: Bahusson/e-sks
def home(request):
    api = ActivePageItems(request, B, pytz, datetime)
    active_blogs = api.active_items
    api = ActivePageItems(request, In, pytz, datetime)
    active_infos = api.active_items
    api = ActivePageItems(request, F, pytz, datetime)
    active_files = api.active_items
    context = {
        'blogs': active_blogs,
        'infos': active_infos,
        'files': active_files,
    }
    pl = PageLoad(P, L)
    context_lazy = pl.lazy_context(skins=S, context=context)
    template = 'strona/home.html'
    return render(request, template, context_lazy)
예제 #7
0
def initial(request):
    if request.method == 'POST':
        uid = User.objects.get(id=request.user.id)
        form = IniForm(request.POST, instance=uid)
        if form.is_valid():
            form.save()
            return redirect('userdatapersonal')

    else:
        form = IniForm()
        pl = PageLoad(P, L)
        locations = list(Sito.objects.all())
        sitos = locations[0]
        context = {
            'form': form,
            'sitos': sitos,
            'items': pl.items,
            'langs': pl.langs,
        }
        template = 'registration/initial.html'
        return render(request, template, context)