From 4b350ff5c6a33d5f45a4c029609312a6a07a08ca Mon Sep 17 00:00:00 2001 From: Matthias Nagel Date: Thu, 2 Oct 2025 16:38:50 +0200 Subject: [PATCH] feat: Scoreboard-Layout-Verbesserungen und automatische Ergebnisberechnung --- calendars/__pycache__/forms.cpython-313.pyc | Bin 5345 -> 5585 bytes calendars/forms.py | 4 +- .../templates/calendars/record_results.html | 40 +++++++++++++++++- db.sqlite3 | Bin 311296 -> 311296 bytes templates/base.html | 4 ++ 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/calendars/__pycache__/forms.cpython-313.pyc b/calendars/__pycache__/forms.cpython-313.pyc index 3152b2e87f9351883dc2d630905e3a280dc8870f..33e203bce811bfb4d85d66eb1d116d7ee466ada3 100644 GIT binary patch delta 474 zcmaE;c~P79GcPX}0}!n3zL#--BX1EuHz$zC55%8sm?od*HlDnf{|jq714AC$WC20V z$@c{~d7_0tIzS*uZ1M$GQEm2M4gYX5X>`~OV9$t zfO_H$;5BAe2b$~K$-uzPpumvMpvmWVizPiVH?@cbC|Qff{S$lXO^ljjM_F!D~` zEf~mqi`%a>Hz~Eq6Qq7Jk5E2S0ORCZp(*BH7#M089hts^C|{;e5b6U1Lnu=W6Of8y zDgsd6_^%8?jO9#4+CV=50PuQk Aj{pDw delta 211 zcmcbp{ZNzlGcPX}0}xc?-OGsG$XmqE%>m@`1M%kv0F&tx;9z{yjD@)=)DmgH5NtR@&#dY=8O8J wlkG$rIm#G6Gw`yOF-|@%(#u#fIaD-LxQuZ^==AuB@n0E)7|R%ow1HLu0FKZ%=l}o! diff --git a/calendars/forms.py b/calendars/forms.py index 092d222..af669f9 100644 --- a/calendars/forms.py +++ b/calendars/forms.py @@ -50,5 +50,5 @@ class GameResultForm(forms.ModelForm): guest_team = game.team.name for i in range(1, game.number_of_innings + 1): - self.fields[f'inning_{i}_home'] = forms.IntegerField(label=f'Inning {i} ({home_team})', required=False) - self.fields[f'inning_{i}_guest'] = forms.IntegerField(label=f'Inning {i} ({guest_team})', required=False) + self.fields[f'inning_{i}_home'] = forms.IntegerField(label=f'Inning {i} ({home_team})', required=False, widget=forms.NumberInput(attrs={'class': 'inning-score-input'})) + self.fields[f'inning_{i}_guest'] = forms.IntegerField(label=f'Inning {i} ({guest_team})', required=False, widget=forms.NumberInput(attrs={'class': 'inning-score-input'})) diff --git a/calendars/templates/calendars/record_results.html b/calendars/templates/calendars/record_results.html index 6f2a46c..7940ac0 100644 --- a/calendars/templates/calendars/record_results.html +++ b/calendars/templates/calendars/record_results.html @@ -17,10 +17,11 @@ {% for item in form_fields_by_inning %} {{ item.inning }} {% endfor %} + Total - + {% if game.is_home_game %} {{ game.team.name }} (Home) @@ -31,8 +32,9 @@ {% for item in form_fields_by_inning %} {{ item.home }} {% endfor %} + 0 - + {% if not game.is_home_game %} {{ game.team.name }} (Guest) @@ -43,6 +45,7 @@ {% for item in form_fields_by_inning %} {{ item.guest }} {% endfor %} + 0 @@ -53,3 +56,36 @@ {% endblock %} + +{% block javascript %} + +{% endblock %} \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 95ffddaf48896eae126ed5016e238e02eaed32b3..5098404bba7d56aa055358f15a2d273d6b4e0b1e 100644 GIT binary patch delta 39 vcmZo@5N>D?o*>QGJWD?o*>QGG*QNxv8gekHG#1;fvGitd20eo={iQE?bp_^XbA!U2&oN6 diff --git a/templates/base.html b/templates/base.html index 4abc5c9..f311321 100644 --- a/templates/base.html +++ b/templates/base.html @@ -19,6 +19,10 @@ background-color: #fff3cd; /* light yellow background */ border-color: #ffc107; /* yellow border */ } + .inning-score-input { + width: 50px; /* Adjust as needed */ + text-align: center; + }