Additional fixes
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Lukáš Kucharczyk 2023-01-20 15:06:42 +01:00
parent 56e5dfaa03
commit 18e8f93261
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
6 changed files with 8 additions and 7 deletions

View File

@ -5,7 +5,7 @@
:8000 { :8000 {
handle_path /static/* { handle_path /static/* {
root * src/timetracker/static/ root * static/
file_server file_server
} }
handle { handle {

View File

@ -2,7 +2,7 @@ FROM node as css
WORKDIR /app WORKDIR /app
COPY . /app COPY . /app
RUN npm install && \ RUN npm install && \
npx tailwindcss -i ./src/input.css -o ./src/timetracker/games/static/base.css --minify npx tailwindcss -i ./common/input.css -o ./static/base.css --minify
FROM python:3.10.9-slim-bullseye FROM python:3.10.9-slim-bullseye
@ -26,7 +26,7 @@ RUN useradd -m --uid 1000 timetracker
WORKDIR /home/timetracker/app WORKDIR /home/timetracker/app
COPY . /home/timetracker/app/ COPY . /home/timetracker/app/
RUN chown -R timetracker:timetracker /home/timetracker/app RUN chown -R timetracker:timetracker /home/timetracker/app
COPY --from=css /app/src/timetracker/games/static/base.css /home/timetracker/app/src/timetracker/games/static/base.css COPY --from=css ./app/static/base.css /home/timetracker/app/static/base.css
COPY entrypoint.sh / COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh

View File

@ -2,10 +2,10 @@
# Apply database migrations # Apply database migrations
set -euo pipefail set -euo pipefail
echo "Apply database migrations" echo "Apply database migrations"
poetry run python src/timetracker/manage.py migrate poetry run python manage.py migrate
echo "Collect static files" echo "Collect static files"
poetry run python src/timetracker/manage.py collectstatic --clear --no-input poetry run python manage.py collectstatic --clear --no-input
echo "Starting server" echo "Starting server"
caddy start caddy start

View File

@ -85,7 +85,8 @@ def list_sessions(request, filter="", purchase_id="", platform_id="", game_id=""
# cannot use dataset[0] here because that might be only partial QuerySet # cannot use dataset[0] here because that might be only partial QuerySet
context["last"] = Session.objects.all().order_by("timestamp_start").last() context["last"] = Session.objects.all().order_by("timestamp_start").last()
# charts are always oldest->newest # charts are always oldest->newest
context["chart"] = playtime_over_time_chart(dataset.order_by("timestamp_start")) if Session.objects.count() >= 2:
context["chart"] = playtime_over_time_chart(dataset.order_by("timestamp_start"))
return render(request, "list_sessions.html", context) return render(request, "list_sessions.html", context)

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
darkMode: 'class', darkMode: 'class',
content: ["./src/**/*.{html,js}"], content: ["./**/*.{html,js}"],
theme: { theme: {
fontFamily: { fontFamily: {
sans: ['Inter', 'sans-serif'], sans: ['Inter', 'sans-serif'],