fix banner
[edumed.git] / edumed / views.py
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
6
7 from .forms import AvatarlessEditProfileForm
8
9
10 class HomeView(TemplateView):
11     template_name = "home.html"
12
13
14 def mil_home_view(request):
15     return flatpage(request, url='/' if request.LANGUAGE_CODE == 'pl' else '/en/')
16
17
18 def mil_404_view(request):
19     return page_not_found(request, '404_mil.html')
20
21
22 def mil_contact_view(request):
23     return flatpage(request, url='/kontakt_mil/' if request.LANGUAGE_CODE == 'pl' else '/contact_mil/')
24
25
26 def mil_knowledge_base_view(request, url):
27     return flatpage(request, url='bazawiedzy/' + url)
28
29
30 class AvatarlessProfileEditView(ProfileEditView):
31     form_class = AvatarlessEditProfileForm