add submodule librarian
[edumed.git] / edumed / views.py
1 import os.path
2 from django.conf import settings
3 from django.views.generic import TemplateView
4 from django.views.defaults import page_not_found
5 from django.contrib.flatpages.views import flatpage
6 from pybb.views import ProfileEditView
7 from .forms import AvatarlessEditProfileForm
8
9
10 class HomeView(TemplateView):
11     template_name="home.html"
12
13 def mil_home_view(request):
14     return flatpage(request, url = '/' if request.LANGUAGE_CODE == 'pl' else '/en/')
15
16 def mil_404_view(request):
17     return page_not_found(request, '404_mil.html')
18
19 def mil_contact_view(request):
20     return flatpage(request, url = '/kontakt_mil/' if request.LANGUAGE_CODE == 'pl' else '/contact_mil/')
21
22 def mil_knowledge_base_view(request, url):
23     return flatpage(request, url = 'bazawiedzy/' + url)
24
25 class AvatarlessProfileEditView(ProfileEditView):
26     form_class = AvatarlessEditProfileForm