3defe5bbf1f1f0401d180c9f7a3fd53fc8585dc0
[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 pybb.views import ProfileEditView
6 from .forms import AvatarlessEditProfileForm
7
8
9 class HomeView(TemplateView):
10     template_name="home.html"
11
12     def get_context_data(self, **kwargs):
13         context = super(HomeView, self).get_context_data(**kwargs)
14         context['package_url'] = os.path.join(settings.MEDIA_URL, settings.CATALOGUE_PACKAGE)
15         context['package_student_url'] = os.path.join(settings.MEDIA_URL, settings.CATALOGUE_PACKAGE_STUDENT)
16         return context
17
18
19 class MILHomeView(TemplateView):
20     template_name = 'base_mil.html'
21
22 def mil_404_view(request):
23     return page_not_found(request, '404_mil.html')
24
25 class AvatarlessProfileEditView(ProfileEditView):
26     form_class = AvatarlessEditProfileForm