Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
7d408193f9 | |||
2e4eff5f3a | |||
fc992c75a6 | |||
fc8cea1d0a | |||
92c6cda583 | |||
75531f872b | |||
c9e47e3e9e |
8
.gitignore
vendored
8
.gitignore
vendored
@ -28,10 +28,10 @@ venv
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
staticfiles/*
|
staticfiles/*
|
||||||
!staticfiles/.gitkeep
|
!staticfiles/.gitkeep
|
||||||
.vscode/symbols.json
|
.vscode/symbols.json
|
||||||
|
|
||||||
apps/static/assets/node_modules
|
apps/static/node_modules
|
||||||
apps/static/assets/yarn.lock
|
apps/static/yarn.lock
|
||||||
apps/static/assets/.temp
|
apps/static/.temp
|
||||||
|
|
||||||
|
21
Dockerfile
21
Dockerfile
@ -1,18 +1,27 @@
|
|||||||
FROM python:3.9
|
FROM python:3.12
|
||||||
|
|
||||||
# set environment variables
|
# set environment variables
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
ENV DJANGO_SETTINGS_MODULE core.settings
|
||||||
|
|
||||||
|
WORKDIR /website
|
||||||
|
|
||||||
COPY requirements.txt .
|
|
||||||
# install python dependencies
|
# install python dependencies
|
||||||
|
COPY requirements.txt .
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
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
|
RUN python manage.py migrate
|
||||||
|
|
||||||
|
# Port that the site runs on
|
||||||
|
EXPOSE 4411
|
||||||
|
|
||||||
# gunicorn
|
# gunicorn
|
||||||
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]
|
CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:4411"]
|
@ -4,14 +4,14 @@ from django.urls import path, include
|
|||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
|
|
||||||
from apps.home import views
|
from apps.home import views
|
||||||
from .views import TicketView
|
from .views import DashboardView, TicketView
|
||||||
|
|
||||||
def reverse_to_index(reqeust):
|
def reverse_to_index(reqeust):
|
||||||
return redirect("dashboard")
|
return redirect("dashboard")
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", reverse_to_index, name="index"),
|
path("", reverse_to_index, name="index"),
|
||||||
path('dashboard/', views.dashboard, name="dashboard"),
|
path('dashboard/', DashboardView.as_view(), name="dashboard"),
|
||||||
path('tickets/', include([
|
path('tickets/', include([
|
||||||
path('', TicketView.as_view(), name="tickets"),
|
path('', TicketView.as_view(), name="tickets"),
|
||||||
path('new/', views.new_ticket, name="ticket-new"),
|
path('new/', views.new_ticket, name="ticket-new"),
|
||||||
|
@ -19,9 +19,12 @@ from ..authentication.models import Department
|
|||||||
from .models import Ticket, TicketPriority, TicketTag
|
from .models import Ticket, TicketPriority, TicketTag
|
||||||
|
|
||||||
|
|
||||||
@login_required()
|
class DashboardView(TemplateView):
|
||||||
def dashboard(request):
|
template_name = "home/dashboard.html"
|
||||||
return render(request, "home/dashboard.html")
|
|
||||||
|
@method_decorator(login_required)
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
return render(request, self.template_name)
|
||||||
|
|
||||||
|
|
||||||
class TicketView(TemplateView):
|
class TicketView(TemplateView):
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// Activate all tooltips
|
// Activate all tooltips
|
||||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||||
|
|
||||||
|
@ -396,6 +396,20 @@ function createTicketContent(ticket) {
|
|||||||
template.find(".ticket-content-badges").append(tagTemplate);
|
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;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,9 +447,12 @@
|
|||||||
<!-- <small class="ticket-content-datetime"></small> -->
|
<!-- <small class="ticket-content-datetime"></small> -->
|
||||||
<h5 class="ticket-content-author mb-0"></h5>
|
<h5 class="ticket-content-author mb-0"></h5>
|
||||||
<div class="peers mt-2">
|
<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>
|
<i class="fa fa-users"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ticket-content-priority peer badge rounded" data-bs-toggle="tooltip">
|
||||||
|
<i class="fa fa-folder"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ticket-content-badges"></div>
|
<div class="ticket-content-badges"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -128,12 +128,12 @@ LOGGING = {
|
|||||||
'version': 1,
|
'version': 1,
|
||||||
'disable_existing_loggers': False,
|
'disable_existing_loggers': False,
|
||||||
'handlers': {
|
'handlers': {
|
||||||
'file': {
|
# 'file': {
|
||||||
'level': 'DEBUG',
|
# 'level': 'DEBUG',
|
||||||
'class': 'logging.FileHandler',
|
# 'class': 'logging.FileHandler',
|
||||||
'filename': LOGGING_DIR / f'{timezone.now()}.log',
|
# 'filename': LOGGING_DIR / f'{timezone.now()}.log',
|
||||||
"formatter": "verbose",
|
# "formatter": "verbose",
|
||||||
},
|
# },
|
||||||
'console': {
|
'console': {
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
'class': 'logging.StreamHandler',
|
'class': 'logging.StreamHandler',
|
||||||
@ -163,7 +163,7 @@ LOGGING = {
|
|||||||
},
|
},
|
||||||
"django.request": {
|
"django.request": {
|
||||||
"handlers": ["timed_file", "console"],
|
"handlers": ["timed_file", "console"],
|
||||||
"level": "ERROR",
|
"level": "DEBUG",
|
||||||
"propagate": True
|
"propagate": True
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user