From cf46fdfbb71d64d61627a4835fb6b37305a99097 Mon Sep 17 00:00:00 2001 From: Kamil Date: Thu, 5 Jun 2025 18:47:30 +0200 Subject: [PATCH] data for stats --- .../FlaskWebProject/lewy_routes.py | 75 ++++++++++++------- .../FlaskWebProject/templates/club.html | 14 ++-- .../templates/representation.html | 14 ++-- .../FlaskWebProject/templates/stats.html | 16 ++-- 4 files changed, 72 insertions(+), 47 deletions(-) diff --git a/FlaskWebProject/FlaskWebProject/lewy_routes.py b/FlaskWebProject/FlaskWebProject/lewy_routes.py index babb9b9..9a09fde 100644 --- a/FlaskWebProject/FlaskWebProject/lewy_routes.py +++ b/FlaskWebProject/FlaskWebProject/lewy_routes.py @@ -6,33 +6,33 @@ import lewy_globals def get_lewy_stats(): return { 'all_time_stats': { - 'goals': 380, - 'assists': 120, - 'matches': 450, + 'goals': 589+78, + 'assists':154+21, + 'matches': 791+136, }, 'club_stats': { - 'goals': 132, - 'assists': 112, - 'matches': 245, + 'goals': 589, + 'assists': 154, + 'matches': 791, }, 'nation_stats': { - 'goals': 86, - 'assists': 52, - 'matches': 158, + 'goals': 78, + 'assists': 21, + 'matches': 136, }, - 'worldcup': { - 'goals': 7, - 'assists': 2, - 'matches': 11, + 'international_cups': { + 'goals': 110, + 'assists': 19, + 'matches': 152, }, - 'euro': { - 'goals': 6, - 'assists': 2, - 'matches': 18, + 'national_cups': { + 'goals': 58, + 'assists': 4, + 'matches': 74, }, 'cards': { - 'yellow': 24, - 'red': 4, + 'yellow': 86, + 'red': 2, } } @@ -58,9 +58,28 @@ def index(): def mecze(): # Możesz dostarczyć szczegóły dotyczące meczów + selected_date = request.args.get("date", 2024) matches = [ {'date': '2024-10-12', 'opponent': 'Real Madrid', 'goals': 2, 'assists': 1, 'minutes': 90}, {'date': '2024-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2023-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2023-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2023-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2022-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2022-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2022-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2022-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2021-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2021-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2021-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2021-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2020-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2020-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2020-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2019-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2019-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + {'date': '2019-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85}, + ] return render_template('matches.html', matches=matches) @@ -71,18 +90,24 @@ def statystyki(): def clubs(): selected_club = request.args.get("club","FC Barcelona") clubs = [ - {'club': 'FC Barcelona', 'goals': 22,'assist':12}, - {'club': 'Bayern Monachium', 'goals': 132,'assist':12}, - {'club': 'Borussia Dortmund', 'goals': 132,'assist':12}, - {'club': 'Lech Poznan', 'goals': 132,'assist':12}, + {'club': 'FC Barcelona', 'goals': 101,'assist':20, 'matches':147,'minutes_played': 11684,'yellow_card':12,'red_card': 1, 'wins':101, 'draws': 14,'lost': 32}, + {'club': 'Bayern Monachium', 'goals': 344,'assist':73,'matches':375,'minutes_played': 31759,'yellow_card':36,'red_card': 0, 'wins':307, 'draws': 35,'lost': 33}, + {'club': 'Borussia Dortmund', 'goals': 103,'assist':42,'matches':187,'minutes_played': 14374,'yellow_card':19,'red_card': 1, 'wins':120, 'draws': 40,'lost': 27}, + {'club': 'Lech Poznan', 'goals': 41,'assist':19,'matches':82,'minutes_played': 6858,'yellow_card':9,'red_card': 0, 'wins':'-', 'draws': '-','lost': '-'}, ] return render_template('club.html', clubs=clubs, selected_club=selected_club) def representation(): nation_stats = { - 'goals': 86, - 'assists': 52, + 'goals': 85, + 'assists': 35, 'matches': 158, + 'minutes_played': 12108, + 'yellow_card':10, + 'red_card': 0, + 'wins':75, + 'draws': 35, + 'lost': 48 } return render_template('representation.html', nation_stats=nation_stats) def compare(): diff --git a/FlaskWebProject/FlaskWebProject/templates/club.html b/FlaskWebProject/FlaskWebProject/templates/club.html index b4826b4..1000f31 100644 --- a/FlaskWebProject/FlaskWebProject/templates/club.html +++ b/FlaskWebProject/FlaskWebProject/templates/club.html @@ -33,25 +33,25 @@

Asysty:

{{ stats.assist }}
-

Występy:

{{ stats.goals }} +

Występy:

{{ stats.matches }}
-

Łączny czas gry:

{{ stats.goals }} +

Łączny czas gry:

{{ stats.minutes_played }}
-

Hat-tricki:

{{ stats.goals }} +

Żółte kartki:

{{ stats.yellow_card }}
-

Zwycięstwa:

{{ stats.goals }} +

Czerwone kartki:

{{ stats.red_card }}
-

Porażki:

{{ stats.goals }} +

Zwycięstwa:

{{ stats.wins }}
-

Żółte kartki:

{{ stats.goals }} +

Remisy:

{{ stats.draws }}
-

Czerwone kartki:

{{ stats.goals }} +

Porażki:

{{ stats.lost }}
diff --git a/FlaskWebProject/FlaskWebProject/templates/representation.html b/FlaskWebProject/FlaskWebProject/templates/representation.html index 8d28182..8248b62 100644 --- a/FlaskWebProject/FlaskWebProject/templates/representation.html +++ b/FlaskWebProject/FlaskWebProject/templates/representation.html @@ -11,28 +11,28 @@

Gole:

{{ nation_stats.goals }}
-

Asysty:

{{ nation_stats.assist }} +

Asysty:

{{ nation_stats.assists }}

Występy:

{{ nation_stats.goals }}
-

Łączny czas gry:

{{ nation_stats.goals }} +

Łączny czas gry:

{{ nation_stats.minutes_played }}
-

Hat-tricki:

{{ nation_stats.goals }} +

Żółte kartki:

{{ nation_stats.yellow_card }}
-

Zwycięstwa:

{{ nation_stats.goals }} +

Czerwone kartki:

{{ nation_stats.red_card }}
-

Porażki:

{{ nation_stats.goals }} +

Zwycięstwa:

{{ nation_stats.wins }}
-

Żółte kartki:

{{ nation_stats.goals }} +

Remisy:

{{ nation_stats.draws }}
-

Czerwone kartki:

{{ nation_stats.goals }} +

Porażki:

{{ nation_stats.lost }}
diff --git a/FlaskWebProject/FlaskWebProject/templates/stats.html b/FlaskWebProject/FlaskWebProject/templates/stats.html index 8485fa6..eb263cf 100644 --- a/FlaskWebProject/FlaskWebProject/templates/stats.html +++ b/FlaskWebProject/FlaskWebProject/templates/stats.html @@ -56,35 +56,35 @@
-

Mistrzostwa świata

+

Puchary międzynarodowe

-

{{ worldcup.goals }}

+

{{ international_cups.goals }}

Gole

-

{{ worldcup.assists }}

+

{{ international_cups.assists }}

Asysty

-

{{ worldcup.matches }}

+

{{ international_cups.matches }}

Występy

-

EURO

+

Puchary krajowe

-

{{ euro.goals }}

+

{{ national_cups.goals }}

Gole

-

{{ euro.assists }}

+

{{ national_cups.assists }}

Asysty

-

{{ euro.matches }}

+

{{ national_cups.matches }}

Występy