Compare commits

...

7 Commits

10 changed files with 53 additions and 11694 deletions

8
.gitignore vendored
View File

@ -28,10 +28,10 @@ venv
package-lock.json
staticfiles/*
!staticfiles/.gitkeep
!staticfiles/.gitkeep
.vscode/symbols.json
apps/static/assets/node_modules
apps/static/assets/yarn.lock
apps/static/assets/.temp
apps/static/node_modules
apps/static/yarn.lock
apps/static/.temp

View File

@ -1,18 +1,27 @@
FROM python:3.9
FROM python:3.12
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV DJANGO_SETTINGS_MODULE core.settings
WORKDIR /website
COPY requirements.txt .
# install python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
COPY . /website/
# running migrations
# collect static files
RUN python manage.py collectstatic --noinput
# run migrations
RUN python manage.py migrate
# Port that the site runs on
EXPOSE 4411
# gunicorn
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]
CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:4411"]

View File

@ -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"),

View File

@ -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):

View File

@ -1,4 +1,5 @@
$(document).ready(function() {
// Activate all tooltips
$('[data-bs-toggle="tooltip"]').tooltip();

View File

@ -396,6 +396,20 @@ function createTicketContent(ticket) {
template.find(".ticket-content-badges").append(tagTemplate);
});
var departmentElem = template.find(".ticket-content-department");
if (ticket.author.department === null) {
template.find(".ticket-content-department").hide();
}
else {
}
var priorityElem = template.find(".ticket-content-priority");
priorityElem.css({"color": ticket.priority.colour, "background-color": ticket.priority.backgroundcolour});
priorityElem.attr("data-bs-title", ticket.priority.title);
priorityElem.tooltip();
return template;
}

View File

@ -447,9 +447,12 @@
<!-- <small class="ticket-content-datetime"></small> -->
<h5 class="ticket-content-author mb-0"></h5>
<div class="peers mt-2">
<div class="peer badge bgc-orange-100 c-orange-700">
<div class="ticket-content-department peer badge bgc-orange-100 c-orange-700" data-bs-toggle="tooltip">
<i class="fa fa-users"></i>
</div>
<div class="ticket-content-priority peer badge rounded" data-bs-toggle="tooltip">
<i class="fa fa-folder"></i>
</div>
</div>
<div class="ticket-content-badges"></div>
</div>

View File

@ -128,12 +128,12 @@ LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': LOGGING_DIR / f'{timezone.now()}.log',
"formatter": "verbose",
},
# 'file': {
# 'level': 'DEBUG',
# 'class': 'logging.FileHandler',
# 'filename': LOGGING_DIR / f'{timezone.now()}.log',
# "formatter": "verbose",
# },
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
@ -163,7 +163,7 @@ LOGGING = {
},
"django.request": {
"handlers": ["timed_file", "console"],
"level": "ERROR",
"level": "DEBUG",
"propagate": True
}
},

File diff suppressed because it is too large Load Diff

View File