Add IntelliJ IDEA project configuration files
This commit adds IntelliJ IDEA-specific configuration files for the project, including module setup, version control integration, inspection profiles, and workspace settings. These files facilitate development environment configuration for contributors using IntelliJ IDEA.
This commit is contained in:
+7
-5
@@ -1,10 +1,12 @@
|
||||
from django.urls import path
|
||||
from django.urls import path, include
|
||||
from common import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.IndexView.as_view(), name='index'),
|
||||
path('client/dashboard/', views.ClientDashboardView.as_view(), name='client_dashboard'),
|
||||
path('barrier/dashboard/', views.BarrierDashboardView.as_view(), name='barrier_dashboard'),
|
||||
|
||||
path('dashboard/', views.DashboardRedirectView.as_view(), name='dashboard'),
|
||||
path('dashboard/', include([
|
||||
path('', views.DashboardRedirectView.as_view(), name='dashboard'),
|
||||
path('client/', views.ClientDashboardView.as_view(), name='client_dashboard'),
|
||||
path('barrier/', views.BarrierDashboardView.as_view(), name='barrier_dashboard'),
|
||||
path('employee/', views.EmployeeDashboardView.as_view(), name='employee_dashboard'),
|
||||
]))
|
||||
]
|
||||
|
||||
+28
-3
@@ -2,6 +2,11 @@ from django.urls import reverse_lazy
|
||||
from django.views.generic import TemplateView, RedirectView
|
||||
from django.shortcuts import render
|
||||
|
||||
from accounts.models import DepotUser
|
||||
from booking.models import Booking
|
||||
from containers.models import Container
|
||||
from preinfo.models import Preinfo
|
||||
|
||||
|
||||
# Create your views here.
|
||||
class IndexView(TemplateView):
|
||||
@@ -21,12 +26,16 @@ class DashboardRedirectView(RedirectView):
|
||||
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
# if self.request.user.is_authenticated:
|
||||
if self.request.user.username == 'client':
|
||||
if self.request.user.user_type == DepotUser.UserType.COMPANY_ADMIN:
|
||||
return reverse_lazy('client_dashboard')
|
||||
elif self.request.user.username == 'clientadmin':
|
||||
elif self.request.user.user_type == DepotUser.UserType.CLIENT:
|
||||
return reverse_lazy('client_dashboard')
|
||||
elif self.request.user.username == 'barrier':
|
||||
elif self.request.user.user_type == DepotUser.UserType.BARRIER_STAFF:
|
||||
return reverse_lazy('barrier_dashboard')
|
||||
elif self.request.user.user_type == DepotUser.UserType.EMPLOYEE:
|
||||
return reverse_lazy('employee_dashboard')
|
||||
elif self.request.user.user_type == DepotUser.UserType.ADMIN:
|
||||
return reverse_lazy('employee_dashboard')
|
||||
return reverse_lazy('index')
|
||||
|
||||
|
||||
@@ -47,10 +56,26 @@ class BarrierDashboardView(TemplateView):
|
||||
'description': 'This is the client dashboard page.',
|
||||
}
|
||||
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
return render(request, self.template_name, self.extra_context)
|
||||
|
||||
class EmployeeDashboardView(TemplateView):
|
||||
template_name = 'employee-dashboard-content.html'
|
||||
extra_context = {
|
||||
'title': 'Employee Dashboard',
|
||||
'description': 'This is the depot employee dashboard page.',
|
||||
}
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
containers = Container.objects.filter(expedited=False).count()
|
||||
preinfos = Preinfo.objects.filter(received=False).count()
|
||||
bookings = Booking.objects.filter(status='active').count()
|
||||
context['containers'] = containers
|
||||
context['preinfos'] = preinfos
|
||||
context['bookings'] = bookings
|
||||
return context
|
||||
|
||||
# class ClientPreinfoView(TemplateView):
|
||||
# template_name = 'client-preinfo-content.html'
|
||||
|
||||
Reference in New Issue
Block a user