2022-07-21 12:45:44 +00:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
|
|
from django.shortcuts import render
|
|
|
|
from django.urls import reverse_lazy
|
|
|
|
from django.views import View
|
|
|
|
from django.views.generic.edit import CreateView
|
|
|
|
|
|
|
|
from core.forms import NewUserForm
|
|
|
|
|
|
|
|
# Create your views here
|
|
|
|
|
|
|
|
|
2022-07-21 12:45:57 +00:00
|
|
|
class Drilldown(LoginRequiredMixin, View):
|
|
|
|
template_name = "ui/drilldown.html"
|
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
|
|
if not request.user.has_plan("drilldown"):
|
|
|
|
return render(request, "denied.html")
|
|
|
|
return render(request, self.template_name)
|
|
|
|
|
|
|
|
|
|
|
|
class Home(View):
|
2022-07-21 12:45:44 +00:00
|
|
|
template_name = "index.html"
|
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
|
|
return render(request, self.template_name)
|
|
|
|
|
|
|
|
|
|
|
|
class Profile(LoginRequiredMixin, View):
|
|
|
|
template_name = "profile.html"
|
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
|
|
return render(request, self.template_name)
|
|
|
|
|
|
|
|
|
|
|
|
class Signup(CreateView):
|
|
|
|
form_class = NewUserForm
|
|
|
|
success_url = reverse_lazy("login")
|
|
|
|
template_name = "registration/signup.html"
|