2013-09-28 12:06:26 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from django.views.generic import TemplateView
|
2013-09-28 13:04:21 +02:00
|
|
|
from django.http import HttpResponse
|
2013-09-28 16:25:19 +02:00
|
|
|
from django.conf import settings
|
2013-09-28 13:04:21 +02:00
|
|
|
import json
|
2013-09-28 12:06:26 +02:00
|
|
|
|
2013-09-28 16:46:33 +02:00
|
|
|
|
2013-09-28 12:06:26 +02:00
|
|
|
class HomeView(TemplateView):
|
|
|
|
template_name = "base.html"
|
|
|
|
|
|
|
|
def get_context_data(self, *args, **kwargs):
|
|
|
|
context = super(HomeView, self).get_context_data(*args, **kwargs)
|
|
|
|
context['nav_home'] = True
|
|
|
|
return context
|
2013-09-28 13:04:21 +02:00
|
|
|
|
2013-09-28 16:46:33 +02:00
|
|
|
|
2013-09-28 13:56:54 +02:00
|
|
|
class OverviewView(TemplateView):
|
2013-09-28 14:26:00 +02:00
|
|
|
template_name = "main/overview.html"
|
2013-09-28 13:56:54 +02:00
|
|
|
|
|
|
|
def get_context_data(self, *args, **kwargs):
|
|
|
|
context = super(OverviewView, self).get_context_data(*args, **kwargs)
|
|
|
|
context['nav_overview'] = True
|
2013-09-28 16:25:19 +02:00
|
|
|
context['ipv4'] = settings.WWW_IPV4_HOST
|
|
|
|
context['ipv6'] = settings.WWW_IPV6_HOST
|
2013-09-28 13:56:54 +02:00
|
|
|
return context
|
|
|
|
|
|
|
|
|
2013-09-28 13:04:21 +02:00
|
|
|
def MyIpView(request):
|
2013-09-28 16:50:13 +02:00
|
|
|
return HttpResponse(
|
|
|
|
json.dumps({'ip': request.META['REMOTE_ADDR']}),
|
|
|
|
content_type="application/json")
|
2013-09-28 16:46:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
class UserProfileView(TemplateView):
|
|
|
|
template_name = "main/user_profile.html"
|
|
|
|
|
|
|
|
def get_context_data(self, *args, **kwargs):
|
|
|
|
context = super(UserProfileView, self).get_context_data(*args, **kwargs)
|
|
|
|
context['nav_user_profile'] = True
|
|
|
|
return context
|
2013-09-28 16:56:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
class PasswordChangeView(TemplateView):
|
|
|
|
template_name = "registration/password_change.html"
|
|
|
|
|
|
|
|
def get_context_data(self, *args, **kwargs):
|
|
|
|
context = super(PasswordChangeView, self).get_context_data(*args, **kwargs)
|
|
|
|
context['nav_change_password'] = True
|
|
|
|
return context
|