1 # -*- coding: utf-8 -*-
2 from django.contrib.flatpages.views import flatpage
3 from django.views.defaults import page_not_found
4 from django.views.generic import TemplateView
5 from pybb.views import ProfileEditView
7 from .forms import AvatarlessEditProfileForm
10 class HomeView(TemplateView):
11 template_name = "home.html"
14 def mil_home_view(request):
15 return flatpage(request, url='/' if request.LANGUAGE_CODE == 'pl' else '/en/')
18 def mil_404_view(request):
19 return page_not_found(request, '404_mil.html')
22 def mil_contact_view(request):
23 return flatpage(request, url='/kontakt_mil/' if request.LANGUAGE_CODE == 'pl' else '/contact_mil/')
26 def mil_knowledge_base_view(request, url):
27 return flatpage(request, url='bazawiedzy/' + url)
30 class AvatarlessProfileEditView(ProfileEditView):
31 form_class = AvatarlessEditProfileForm