From bf61326c1813a72774bc5cd2ebdcd43fc0d35edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 4 Jan 2023 17:23:34 +0100 Subject: [PATCH] Make it possible to add a new platform --- CHANGELOG.md | 1 + src/web/tracker/forms.py | 8 +++++++- src/web/tracker/templates/base.html | 1 + src/web/tracker/urls.py | 1 + src/web/tracker/views.py | 14 +++++++++++++- 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7499672..1ac4a6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,3 +2,4 @@ * Hide navigation bar items if there are no games/purchases/sessions * Set default version to "git-main" to indicate development environment * Add homepage, link to it from the logo +* Make it possible to add a new platform diff --git a/src/web/tracker/forms.py b/src/web/tracker/forms.py index ad35efd..13f0165 100644 --- a/src/web/tracker/forms.py +++ b/src/web/tracker/forms.py @@ -1,5 +1,5 @@ from django import forms -from .models import Session, Purchase, Game +from .models import Session, Purchase, Game, Platform class SessionForm(forms.ModelForm): @@ -24,3 +24,9 @@ class GameForm(forms.ModelForm): class Meta: model = Game fields = ["name", "wikidata"] + + +class PlatformForm(forms.ModelForm): + class Meta: + model = Platform + fields = ["name", "group"] diff --git a/src/web/tracker/templates/base.html b/src/web/tracker/templates/base.html index 495b840..dcd7d4a 100644 --- a/src/web/tracker/templates/base.html +++ b/src/web/tracker/templates/base.html @@ -23,6 +23,7 @@