Dashboard view to template
This commit is contained in:
parent
2691380f81
commit
c9e47e3e9e
@ -4,14 +4,14 @@ from django.urls import path, include
|
||||
from django.shortcuts import redirect
|
||||
|
||||
from apps.home import views
|
||||
from .views import TicketView
|
||||
from .views import DashboardView, TicketView
|
||||
|
||||
def reverse_to_index(reqeust):
|
||||
return redirect("dashboard")
|
||||
|
||||
urlpatterns = [
|
||||
path("", reverse_to_index, name="index"),
|
||||
path('dashboard/', views.dashboard, name="dashboard"),
|
||||
path('dashboard/', DashboardView.as_view(), name="dashboard"),
|
||||
path('tickets/', include([
|
||||
path('', TicketView.as_view(), name="tickets"),
|
||||
path('new/', views.new_ticket, name="ticket-new"),
|
||||
|
@ -19,9 +19,12 @@ from ..authentication.models import Department
|
||||
from .models import Ticket, TicketPriority, TicketTag
|
||||
|
||||
|
||||
@login_required()
|
||||
def dashboard(request):
|
||||
return render(request, "home/dashboard.html")
|
||||
class DashboardView(TemplateView):
|
||||
template_name = "home/dashboard.html"
|
||||
|
||||
@method_decorator(login_required)
|
||||
def get(self, request, *args, **kwargs):
|
||||
return render(request, self.template_name)
|
||||
|
||||
|
||||
class TicketView(TemplateView):
|
||||
|
Loading…
x
Reference in New Issue
Block a user