Compare commits
4 Commits
frontend
...
c2568c86ef
| Author | SHA1 | Date | |
|---|---|---|---|
| c2568c86ef | |||
|
|
13f6e2e3b9 | ||
|
|
9a007f504c | ||
|
|
b5fdbb3230 |
@@ -1,9 +1,11 @@
|
||||
from flask import session
|
||||
from lewy_db import baza as ldb
|
||||
from lewy_globals import colors as c
|
||||
import json
|
||||
import lewy_globals
|
||||
import requests
|
||||
import time
|
||||
from sqlalchemy import func
|
||||
|
||||
def safe_traverse(obj: dict, path: list, default=None):
|
||||
result = obj
|
||||
@@ -12,7 +14,7 @@ def safe_traverse(obj: dict, path: list, default=None):
|
||||
result = result[x]
|
||||
except KeyError:
|
||||
result = default
|
||||
# print(f"error reading: {' -> '.join(path)} - returning: {default}")
|
||||
print(f"safe_traverse: error reading {' -> '.join(path)} - returning: {default}")
|
||||
finally:
|
||||
return result
|
||||
|
||||
@@ -45,6 +47,17 @@ class scraper:
|
||||
else:
|
||||
return False
|
||||
|
||||
def to_iso_compatible_date(self, dmy_date: str):
|
||||
"""
|
||||
Zamienia datę z formatu DD.MM.YY na YYYY-MM-DD
|
||||
|
||||
:param dmy_date: Data w formacie DD.MM.YY
|
||||
:type dmy_date: str
|
||||
"""
|
||||
day, month, year = dmy_date.split(".")
|
||||
return f"{2000 + int(year)}-{month}-{day}"
|
||||
|
||||
|
||||
def czy_mecz_istnieje(self, zewnetrzne_id_meczu: str):
|
||||
# mecz = db.simple_select_all(ldb.mecze, zewnetrzne_id_meczu=zewnetrzne_id_meczu)
|
||||
# if mecz is not None and mecz != []:
|
||||
@@ -97,6 +110,9 @@ class scraper:
|
||||
# Jeśli nie, dodaj go w podobny sposób, jak
|
||||
# w sample_data_init() (w lewy_db.py).
|
||||
|
||||
id_zawodnika = self.db.get_id_zawodnika_by_zewnetrzne_id(zewnetrzne_id_sportowca)
|
||||
zawodnik = self.db.simple_select_all("sportowcy", zewnetrzne_id_zawodnika=zewnetrzne_id_sportowca)[0]
|
||||
|
||||
page = 0
|
||||
match_num = 0
|
||||
while not stop_scraping:
|
||||
@@ -141,8 +157,88 @@ class scraper:
|
||||
|
||||
# TODO: dodaj obiekt mecz do bazy (simple_insert_one(), simple_insert_many())
|
||||
print(f"{c.OKCYAN}Nowy mecz ({match_num}){c.ENDC}: {match}")
|
||||
|
||||
iso_converted_date = self.to_iso_compatible_date(safe_traverse(match, ["eventStartTime"], default="1970-01-01"))
|
||||
|
||||
self.db.simple_insert_one("mecze",
|
||||
zewnetrzne_id_meczu = safe_traverse(match, ["eventEncodedId"], default=""),
|
||||
data = iso_converted_date,
|
||||
gospodarze_id = home_club_id,
|
||||
gospodarze = self.db.simple_select_all("kluby", id_klubu=home_club_id)[0],
|
||||
goscie_id = away_club_id,
|
||||
goscie = self.db.simple_select_all("kluby", id_klubu=away_club_id)[0],
|
||||
gosp_wynik = safe_traverse(match, ["homeScore"], default=0),
|
||||
gosc_wynik = safe_traverse(match, ["awayScore"], default=0),
|
||||
sezon = safe_traverse(match, ["tournamentSeason"], default=""),
|
||||
nazwa_turnieju = safe_traverse(match, ["tournamentTitle"], default=""),
|
||||
skrocona_nazwa_turnieju = safe_traverse(match, ["tournamentTemplateShortCode"], default=""),
|
||||
flaga = safe_traverse(match, ["flagId"], default=0),
|
||||
)
|
||||
match_num += 1
|
||||
|
||||
stats = safe_traverse(match, ["stats"], default="")
|
||||
zewnetrzne_id_meczu = safe_traverse(match, ["eventEncodedId"], default="")
|
||||
|
||||
if stats != False: # gdy sportowiec był aktywny w meczu
|
||||
print("todo :)")
|
||||
# # TODO:
|
||||
# self.db.simple_insert_one("sportowcy_w_meczach",
|
||||
# id_zawodnika = id_zawodnika,
|
||||
# zawodnik = zawodnik,
|
||||
# zewnetrzne_id_meczu = zewnetrzne_id_meczu,
|
||||
# # ODTĄD SIĘ NIE POKRYWA!!! POLA POWINNY SIĘ ZGADZAĆ Z TYM, CO JEST W LEWY_DB (konkretnie klasie sportowcy_w_meczach)
|
||||
# ostatni_mecz = self.db.get_id_meczu_by_zewnetrzne_id(zewnetrzne_id_meczu),
|
||||
# ilosc_wystapien = 1 if int(safe_traverse(stats, ["595", "value"], default="0").rstrip("'")) > 0 else 0,
|
||||
# minut_gry = int(safe_traverse(stats, ["595", "value"], default="0").rstrip("'")),
|
||||
# gier_sum = 1 if int(safe_traverse(stats, ["595", "value"], default="0").rstrip("'")) > 0 else 0,
|
||||
# goli_sum = int(safe_traverse(stats, ["596", "value"], default="0")),
|
||||
# asyst_sum = int(safe_traverse(stats, ["541", "value"], default="0")),
|
||||
# interwencji_sum = 0,
|
||||
# nieobronionych_interwencji_sum = 0,
|
||||
# zoltych_kartek_sum = int(safe_traverse(stats, ["599", "value"], default="0")),
|
||||
# czerwonych_kartek_sum = int(safe_traverse(stats, ["600", "value"], default="0")),
|
||||
# wygranych_sum = 1 if safe_traverse(match, ["winLoseShort"], default="") == "Z" else 0,
|
||||
# wynik_sum = safe_traverse(match, ["rating"], default=0),
|
||||
# meczow_do_wynikow_sum = 1 if safe_traverse(match, ["rating"], default=0) not in (0, None) else None
|
||||
# )
|
||||
|
||||
# # analogicznie zinkrementuj statystyki_sportowcow:
|
||||
# # UWAGA! NIE ZADZIAŁA DLA NIKOGO INNEGO, NIŻ ROBERCIKA (bo nie mamy innych sportowców w bazie, trzeba dodać ich ręcznie w lewy_db sample_data_init())
|
||||
# self.db.simple_insert_one("statystyki_sportowcow",
|
||||
# sportowiec = zawodnik,
|
||||
# ostatni_mecz = self.db.get_id_meczu_by_zewnetrzne_id(zewnetrzne_id_meczu),
|
||||
# ilosc_wystapien = 1 if int(safe_traverse(stats, ["595", "value"], default="0").rstrip("'")) > 0 else 0,
|
||||
# minut_gry = int(safe_traverse(stats, ["595", "value"], default="0").rstrip("'")),
|
||||
# gier_sum = 1 if int(safe_traverse(stats, ["595", "value"], default="0").rstrip("'")) > 0 else 0,
|
||||
# goli_sum = int(safe_traverse(stats, ["596", "value"], default="0")),
|
||||
# asyst_sum = int(safe_traverse(stats, ["541", "value"], default="0")),
|
||||
# interwencji_sum = 0,
|
||||
# nieobronionych_interwencji_sum = 0,
|
||||
# zoltych_kartek_sum = int(safe_traverse(stats, ["599", "value"], default="0")),
|
||||
# czerwonych_kartek_sum = int(safe_traverse(stats, ["600", "value"], default="0")),
|
||||
# wygranych_sum = 1 if safe_traverse(match, ["winLoseShort"], default="") == "Z" else 0,
|
||||
# wynik_sum = safe_traverse(match, ["rating"], default=0),
|
||||
# meczow_do_wynikow_sum = 1 if safe_traverse(match, ["rating"], default=0) not in (0, None) else None
|
||||
# )
|
||||
|
||||
else:
|
||||
print("też todo :)")
|
||||
# # TODO: TU TEŻ TRZEBA POPRAWIĆ ANALOGICZNIE DO TEGO, CO JEST WEWNĄTRZ IF'A
|
||||
# self.db.simple_insert_one("sportowcy_w_meczach", id_zawodnika,
|
||||
# ostatni_mecz = self.db.get_id_meczu_by_zewnetrzne_id(zewnetrzne_id_meczu),
|
||||
# ilosc_wystapien = 0,
|
||||
# minut_gry = 0,
|
||||
# gier_sum = 0,
|
||||
# goli_sum = 0,
|
||||
# asyst_sum = 0,
|
||||
# interwencji_sum = 0,
|
||||
# nieobronionych_interwencji_sum = 0,
|
||||
# zoltych_kartek_sum = 0,
|
||||
# czerwonych_kartek_sum = 0,
|
||||
# wygranych_sum = 1 if safe_traverse(match, ["winLoseShort"], default="") == "Z" else 0,
|
||||
# wynik_sum = safe_traverse(match, ["rating"], default=0),
|
||||
# meczow_do_wynikow_sum = 1 if safe_traverse(match, ["rating"], default=0) not in (0, None) else None
|
||||
# )
|
||||
|
||||
# TODO: Zaktualizuj statystyki sportowca
|
||||
|
||||
@@ -155,7 +251,7 @@ class scraper:
|
||||
# rate limita. - sherl
|
||||
|
||||
page += 1
|
||||
time.sleep(15)
|
||||
#time.sleep(15)
|
||||
|
||||
|
||||
def aktualizuj_dane(self):
|
||||
|
||||
@@ -62,15 +62,12 @@ def setup():
|
||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||
|
||||
# Widoki widoczne dla "normalnego" użytkownika:
|
||||
app.add_url_rule('/', view_func=lewy_routes.index)
|
||||
app.add_url_rule('/index.html', view_func=lewy_routes.index)
|
||||
app.add_url_rule('/mecze', view_func=lewy_routes.mecze)
|
||||
app.add_url_rule('/statystyki', view_func=lewy_routes.statystyki)
|
||||
app.add_url_rule('/toggle_dark_mode', view_func=lewy_routes.toggle_dark_mode)
|
||||
app.add_url_rule('/club', view_func=lewy_routes.clubs)
|
||||
app.add_url_rule('/representation', view_func=lewy_routes.representation)
|
||||
app.add_url_rule('/compare', view_func=lewy_routes.compare)
|
||||
app.add_url_rule('/trophies', view_func=lewy_routes.trophies)
|
||||
app.add_url_rule('/', view_func=lewy_routes.index)
|
||||
app.add_url_rule('/index.html', view_func=lewy_routes.index)
|
||||
app.add_url_rule('/mecze', view_func=lewy_routes.mecze)
|
||||
app.add_url_rule('/statystyki', view_func=lewy_routes.statystyki)
|
||||
app.add_url_rule('/toggle_dark_mode', view_func=lewy_routes.toggle_dark_mode)
|
||||
app.add_url_rule('/historia', view_func=lewy_routes.historia)
|
||||
|
||||
# API:
|
||||
app.add_url_rule('/api/', view_func=lewy_api.api_greeting)
|
||||
|
||||
@@ -89,7 +89,12 @@ def get_matches(r):
|
||||
"""
|
||||
TODO: Zwraca mecze.
|
||||
"""
|
||||
pass
|
||||
response_json = []
|
||||
mecze = getDb().simple_select_all("mecze")
|
||||
for mecz in mecze:
|
||||
response_json.append(mecz.jsonify())
|
||||
print(response_json)
|
||||
return 200, "ok", response_json
|
||||
|
||||
# GET /api/v1/debugger_halt?token=XXX...
|
||||
@require_authentication
|
||||
@@ -142,7 +147,7 @@ def lookup(data, request):
|
||||
case 'halt':
|
||||
return debugger_halt(r = request)
|
||||
case 'matches':
|
||||
get_matches(r = request)
|
||||
return get_matches(r = request)
|
||||
case _:
|
||||
increment_bad_requests()
|
||||
return not_implemented(data)
|
||||
@@ -119,6 +119,8 @@ class baza():
|
||||
zoltych_kartek_sum: Mapped[ int] = mapped_column()
|
||||
czerwonych_kartek_sum: Mapped[ int] = mapped_column()
|
||||
wygranych_sum: Mapped[ int] = mapped_column()
|
||||
przegranych_sum: Mapped[ int] = mapped_column()
|
||||
remisow_sum: Mapped[ int] = mapped_column()
|
||||
wynik_sum: Mapped[ int] = mapped_column()
|
||||
meczow_do_wynikow_sum: Mapped[ int] = mapped_column()
|
||||
|
||||
@@ -155,6 +157,23 @@ class baza():
|
||||
def __repr__(self):
|
||||
return f"<Mecz #{self.id_meczu} ({self.zewnetrzne_id_meczu}, {self.gospodarze.skrocona_nazwa} vs. {self.goscie.skrocona_nazwa})>"
|
||||
|
||||
def jsonify(self):
|
||||
return {
|
||||
"id_meczu": self.id_meczu,
|
||||
"zewnetrzne_id_meczu": self.zewnetrzne_id_meczu,
|
||||
"data": self.data.strftime("%Y-%m-%d"),
|
||||
"gospodarze_id": self.gospodarze_id,
|
||||
"gospodarze": self.gospodarze.skrocona_nazwa,
|
||||
"goscie_id": self.goscie_id,
|
||||
"goscie": self.goscie.skrocona_nazwa,
|
||||
"gosp_wynik": self.gosp_wynik,
|
||||
"gosc_wynik": self.gosc_wynik,
|
||||
"sezon": self.sezon,
|
||||
"nazwa_turnieju": self.nazwa_turnieju,
|
||||
"skrocona_nazwa_turnieju": self.skrocona_nazwa_turnieju,
|
||||
"flaga": self.flaga
|
||||
}
|
||||
|
||||
self.entities = {
|
||||
'sportowcy': sportowcy,
|
||||
'trofea': trofea,
|
||||
@@ -236,7 +255,7 @@ class baza():
|
||||
special_args[arg] = kwargs[arg]
|
||||
del kwargs[arg]
|
||||
|
||||
print(f"[{round(time.time())}] SELECT")
|
||||
print(f"[{round(time.time())}] SELECT {entity_type}")
|
||||
|
||||
results = (
|
||||
self.session.
|
||||
@@ -283,7 +302,7 @@ class baza():
|
||||
f"Aby naprawić dodawanie z autoinkrementującym kluczem zobacz {c.WARNING}https://stackoverflow.com/a/8745101{c.ENDC}\n"
|
||||
f"Zostałeś ostrzeżony!")
|
||||
|
||||
print(f"[{round(time.time())}] INSERT")
|
||||
print(f"[{round(time.time())}] INSERT {entity_type}")
|
||||
|
||||
obj = self.entities[entity_type](**kwargs)
|
||||
#with Session(self.db.engine) as session:
|
||||
@@ -307,6 +326,131 @@ class baza():
|
||||
return 0
|
||||
#return 1
|
||||
|
||||
@exit_gracefully
|
||||
def increment_fields(self, entity_type, record_id, **increments):
|
||||
"""
|
||||
Dodaje wartości do istniejących pól (np. goli_sum += 2).
|
||||
|
||||
Użycie:
|
||||
increment_fields(ldb.statystyki_sportowcow, 123, goli_sum=2, asyst_sum=1)
|
||||
"""
|
||||
|
||||
if not isinstance(entity_type, str):
|
||||
entity_type = entity_type.__name__
|
||||
|
||||
if entity_type not in self.entities:
|
||||
print(f"Nieznany typ encji: {entity_type}")
|
||||
return -1
|
||||
|
||||
model_class = self.entities[entity_type]
|
||||
|
||||
print(f"[{round(time.time())}] INCREMENT {entity_type}")
|
||||
|
||||
record = self.session.get(model_class, record_id)
|
||||
if not record:
|
||||
print(f"Rekord z ID {record_id} nie istnieje w tabeli {entity_type}")
|
||||
return -1
|
||||
|
||||
for key, increment_value in increments.items():
|
||||
if hasattr(record, key):
|
||||
current_value = getattr(record, key, 0)
|
||||
setattr(record, key, current_value + increment_value)
|
||||
else:
|
||||
print(f"⚠️ Pole '{key}' nie istnieje w modelu '{entity_type}' - pomijam.")
|
||||
|
||||
self.session.commit()
|
||||
return 0
|
||||
|
||||
@exit_gracefully
|
||||
def get_id_meczu_by_zewnetrzne_id(self, external_id: str) -> int | None:
|
||||
"""
|
||||
Zwraca id_meczu na podstawie zewnetrzne_id_meczu.
|
||||
|
||||
:param external_id: zewnętrzne ID meczu
|
||||
:return: id_meczu lub None jeśli nie znaleziono
|
||||
"""
|
||||
stmt = select(mecze.id_meczu).where(mecze.zewnetrzne_id_meczu == external_id)
|
||||
result = self.session.execute(stmt).scalar_one_or_none()
|
||||
return result
|
||||
|
||||
@exit_gracefully
|
||||
def get_id_zawodnika_by_zewnetrzne_id(self, external_id: str) -> int | None:
|
||||
"""
|
||||
Zwraca id_zawodnika na podstawie zewnetrzne_id_zawodnika.
|
||||
|
||||
:param external_id: zewnętrzne ID meczu
|
||||
:return: id_zawodnika lub None jeśli nie znaleziono
|
||||
"""
|
||||
stmt = select(sportowcy.id_zawodnika).where(sportowcy.zewnetrzne_id_zawodnika == external_id)
|
||||
result = self.session.execute(stmt).scalar_one_or_none()
|
||||
return result
|
||||
|
||||
@exit_gracefully
|
||||
def simple_update_one(self, entity_type, record_id, **kwargs):
|
||||
"""
|
||||
Użycie:
|
||||
simple_update_one(ldb.kluby, "polska", pelna_nazwa="Nowa Nazwa", skrocona_nazwa="NN")
|
||||
|
||||
Aktualizuje pojedynczy rekord w bazie danych na podstawie ID.
|
||||
"""
|
||||
if not isinstance(entity_type, str):
|
||||
entity_type = entity_type.__name__
|
||||
|
||||
if entity_type not in self.entities:
|
||||
print(f"Nieznany typ encji: {entity_type}")
|
||||
return -1
|
||||
|
||||
model_class = self.entities[entity_type]
|
||||
|
||||
print(f"[{round(time.time())}] UPDATE {entity_type}")
|
||||
|
||||
record = self.session.get(model_class, record_id)
|
||||
if not record:
|
||||
print(f"Rekord z ID {record_id} nie istnieje w tabeli {entity_type}")
|
||||
return -1
|
||||
|
||||
for key, value in kwargs.items():
|
||||
if hasattr(record, key):
|
||||
setattr(record, key, value)
|
||||
else:
|
||||
print(f"⚠️ Pole '{key}' nie istnieje w modelu '{entity_type}' - pomijam.")
|
||||
|
||||
self.session.commit()
|
||||
return 0
|
||||
|
||||
@exit_gracefully
|
||||
def dodaj_sportowca_w_meczu(self, entity_type, record_id, **kwargs):
|
||||
"""
|
||||
Użycie:
|
||||
dodaj_sportowca_w_meczu(ldb.sportowcy_w_meczu, ...)
|
||||
|
||||
Dodaje pojedynczy rekord w bazie danych.
|
||||
"""
|
||||
if not isinstance(entity_type, str):
|
||||
entity_type = entity_type.__name__
|
||||
|
||||
if entity_type not in self.entities:
|
||||
print(f"Nieznany typ encji: {entity_type}")
|
||||
return -1
|
||||
|
||||
model_class = self.entities[entity_type]
|
||||
|
||||
print(f"[{round(time.time())}] INSERT {entity_type}")
|
||||
|
||||
record = self.session.get(model_class, record_id)
|
||||
if not record:
|
||||
print(f"Rekord z ID {record_id} nie istnieje w tabeli {entity_type}")
|
||||
return -1
|
||||
|
||||
for key, value in kwargs.items():
|
||||
if hasattr(record, key):
|
||||
setattr(record, key, value)
|
||||
else:
|
||||
print(f"⚠️ Pole '{key}' nie istnieje w modelu '{entity_type}' - pomijam.")
|
||||
|
||||
self.session.commit()
|
||||
return 0
|
||||
|
||||
@exit_gracefully
|
||||
def sample_data_init(self, override_safety_check=False):
|
||||
"""
|
||||
@@ -340,7 +484,7 @@ class baza():
|
||||
goscie_id="undefined",
|
||||
gosp_wynik=0,
|
||||
gosc_wynik=0,
|
||||
sezon="1970/1970",
|
||||
sezon="1970-1970",
|
||||
nazwa_turnieju="Nieznany turniej",
|
||||
skrocona_nazwa_turnieju="N/A",
|
||||
flaga=0)
|
||||
@@ -356,6 +500,8 @@ class baza():
|
||||
zoltych_kartek_sum=0,
|
||||
czerwonych_kartek_sum=0,
|
||||
wygranych_sum=0,
|
||||
przegranych_sum=0,
|
||||
remisow_sum=0,
|
||||
wynik_sum=0,
|
||||
meczow_do_wynikow_sum=0)
|
||||
|
||||
@@ -374,7 +520,7 @@ class baza():
|
||||
wycena=64_940_000)
|
||||
trofeum = trofea(
|
||||
nazwa="Nieznane trofeum",
|
||||
sezon="0000/0000",
|
||||
sezon="0000-0000",
|
||||
rok=1970)
|
||||
|
||||
session.add(sportowiec)
|
||||
@@ -386,6 +532,40 @@ class baza():
|
||||
trofeum.zawodnik = sportowiec
|
||||
sportowiec.ostatnie_trofeum = trofeum
|
||||
|
||||
# MIEJSCE NA DANE KOLEJNYCH SPORTOWCÓW
|
||||
# TRZEBA ZROBIĆ TO RĘCZNIE, ZGODNIE ZE SCHEMATEM:
|
||||
# self.simple_insert_one(statystyki_sportowcow,
|
||||
# ostatni_mecz=1,
|
||||
# ilosc_wystapien=0,
|
||||
# minut_gry=0,
|
||||
# gier_sum=0,
|
||||
# goli_sum=0,
|
||||
# asyst_sum=0,
|
||||
# interwencji_sum=0,
|
||||
# nieobronionych_interwencji_sum=0,
|
||||
# zoltych_kartek_sum=0,
|
||||
# czerwonych_kartek_sum=0,
|
||||
# wygranych_sum=0,
|
||||
# przegranych_sum=0,
|
||||
# remisow_sum=0,
|
||||
# wynik_sum=0,
|
||||
# meczow_do_wynikow_sum=0)
|
||||
|
||||
# self.simple_insert_one(sportowcy,
|
||||
# zewnetrzne_id_zawodnika="...",
|
||||
# imie="...",
|
||||
# nazwisko="...",
|
||||
# data_urodzenia="...",
|
||||
# czy_aktywny=True, # NIE WSZYSCY SĄ AKTYWNI!
|
||||
# klub_id="undefined",
|
||||
# narodowosc="...",
|
||||
# ilosc_trofeow=0,
|
||||
# pierwszy_mecz_id=1,
|
||||
# ostatni_gol_dla_id="undefined",
|
||||
# statystyki_id=2, # itd...
|
||||
# wycena=...) # w złotówkach
|
||||
|
||||
session.commit()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
return 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from git import Repo # hash ostatniego commitu
|
||||
#from git import Repo # hash ostatniego commitu
|
||||
import os
|
||||
import time
|
||||
import toml
|
||||
@@ -155,4 +155,4 @@ config = {}
|
||||
configfile = "config.toml"
|
||||
version = getCommitWithFailsafe()
|
||||
apiVersion = "1"
|
||||
randomly_generated_passcode = 0
|
||||
randomly_generated_passcode = 0
|
||||
|
||||
@@ -3,39 +3,6 @@ import lewy_api_v1
|
||||
import lewy_db
|
||||
import lewy_globals
|
||||
|
||||
def get_lewy_stats():
|
||||
return {
|
||||
'all_time_stats': {
|
||||
'goals': 380,
|
||||
'assists': 120,
|
||||
'matches': 450,
|
||||
},
|
||||
'club_stats': {
|
||||
'goals': 132,
|
||||
'assists': 112,
|
||||
'matches': 245,
|
||||
},
|
||||
'nation_stats': {
|
||||
'goals': 86,
|
||||
'assists': 52,
|
||||
'matches': 158,
|
||||
},
|
||||
'worldcup': {
|
||||
'goals': 7,
|
||||
'assists': 2,
|
||||
'matches': 11,
|
||||
},
|
||||
'euro': {
|
||||
'goals': 6,
|
||||
'assists': 2,
|
||||
'matches': 18,
|
||||
},
|
||||
'cards': {
|
||||
'yellow': 24,
|
||||
'red': 4,
|
||||
}
|
||||
}
|
||||
|
||||
def index():
|
||||
dark_mode = request.cookies.get('darkMode', 'disabled')
|
||||
# Przykładowe użycie endpointu last_goal_for():
|
||||
@@ -65,39 +32,20 @@ def mecze():
|
||||
return render_template('matches.html', matches=matches)
|
||||
|
||||
def statystyki():
|
||||
dane=get_lewy_stats()
|
||||
return render_template('stats.html', **dane)
|
||||
|
||||
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},
|
||||
]
|
||||
return render_template('club.html', clubs=clubs, selected_club=selected_club)
|
||||
|
||||
def representation():
|
||||
nation_stats = {
|
||||
'goals': 86,
|
||||
'assists': 52,
|
||||
'matches': 158,
|
||||
stats = {
|
||||
'goals': 38,
|
||||
'assists': 12,
|
||||
'matches': 45,
|
||||
}
|
||||
return render_template('representation.html', nation_stats=nation_stats)
|
||||
def compare():
|
||||
selected_player = request.args.get("player","Leo Messi")
|
||||
lewy=get_lewy_stats()
|
||||
player2 = [
|
||||
{'name':'Leo Messi','goals': 34,'assists': 12},
|
||||
return render_template('stats.html', stats=stats)
|
||||
|
||||
def historia():
|
||||
selected_club = request.args.get("club","FC Barcelona")
|
||||
history = [
|
||||
{'club': 'FC Barcelona', 'goals': 22},
|
||||
{'club': 'Bayern Monachium', 'goals': 132},
|
||||
]
|
||||
return render_template('compare.html',player2=player2, selected_player=selected_player,**lewy, )
|
||||
def trophies():
|
||||
trophy = [
|
||||
{'name': 'asdasd', 'year': 2023},
|
||||
{'name': 'ssss', 'sezon': '2022/2023'},
|
||||
]
|
||||
return render_template('trophies.html',trophy=trophy)
|
||||
return render_template('history.html', history=history, selected_club=selected_club)
|
||||
|
||||
def toggle_dark_mode():
|
||||
# Przełącz tryb i zapisz w ciasteczku
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 132 KiB |
@@ -24,7 +24,7 @@
|
||||
--polska-red: #E30B17;
|
||||
--polska-white: #FFFFFF;
|
||||
|
||||
--polska-section-color: #121623;
|
||||
--polska-section-color: #05204A;
|
||||
--section-color: #051839;
|
||||
--pink-highlight: #E1317E;
|
||||
--blue-highlight: #00B9BF;
|
||||
@@ -61,7 +61,6 @@ body {
|
||||
font-size: 15px;
|
||||
z-index: -2;
|
||||
position: relative;
|
||||
margin-top: 60px;
|
||||
/* box-shadow: 0px -5px 10px 2px rgba(0, 0, 0, 0.347); */
|
||||
}
|
||||
|
||||
@@ -83,7 +82,6 @@ body {
|
||||
width: 40%;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
.profile-image-cover {
|
||||
@@ -95,7 +93,6 @@ body {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
|
||||
.profile-image img {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
@@ -132,7 +129,7 @@ header button {
|
||||
|
||||
padding: 2.3rem 1rem;
|
||||
height: 1.5rem;
|
||||
position: fixed;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
@@ -184,7 +181,7 @@ header button {
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 10px;
|
||||
padding: 10px 20px;
|
||||
height: 100%;
|
||||
transition: 100ms ease;
|
||||
position: relative;
|
||||
@@ -221,17 +218,8 @@ header button {
|
||||
}
|
||||
|
||||
.nav-links li:nth-child(4) a::before {
|
||||
content: "🤝";
|
||||
}
|
||||
.nav-links li:nth-child(5) a::before {
|
||||
content: "⚽";
|
||||
}
|
||||
.nav-links li:nth-child(6) a::before {
|
||||
content: "🏆";
|
||||
}
|
||||
.nav-links li:nth-child(7) a::before {
|
||||
content: "🔎";
|
||||
}
|
||||
|
||||
.nav-links li {
|
||||
display: block;
|
||||
@@ -304,32 +292,21 @@ header button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (max-width: 1090px) {
|
||||
/* .base-header .navbar:not(:has(.show))
|
||||
{
|
||||
margin-bottom: 400px;
|
||||
} */
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.nav-links {
|
||||
position: absolute;
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
top: 57px;
|
||||
right: 0px;
|
||||
background-color: var(--barca-blue);
|
||||
position: absolute;
|
||||
top: 2.5rem;
|
||||
right: 0rem;
|
||||
padding: 0rem;
|
||||
gap: 0;
|
||||
height: auto;
|
||||
backdrop-filter: blur(4px);
|
||||
width: 30%;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 0px 5px 5px rgba(0, 0, 0, 0.105);
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.nav-links li {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-links li a,
|
||||
@@ -342,78 +319,16 @@ header button {
|
||||
border-radius: 0;
|
||||
/* brak zaokrągleń w mobilnym menu */
|
||||
}
|
||||
.nav-links li button
|
||||
{
|
||||
background-color: none;
|
||||
width: 45px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.nav-links li button::before,.nav-links li button::after
|
||||
{
|
||||
background-color: none
|
||||
;
|
||||
}
|
||||
.nav-links li button:hover
|
||||
{
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.nav-links.show {
|
||||
display: none;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.hamburger {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1000px)
|
||||
{
|
||||
.header-content
|
||||
{
|
||||
flex-direction: column;
|
||||
}
|
||||
.header-content .profile-image
|
||||
{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
.header-content .profile-image img{
|
||||
width: 100%;
|
||||
}
|
||||
.about-section-image
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (max-width: 600px){
|
||||
.section__matches
|
||||
{
|
||||
font-size: 10px;
|
||||
}
|
||||
.section__matches th{
|
||||
padding: 3px;
|
||||
}
|
||||
.club-stats-grid
|
||||
{
|
||||
grid-template-columns: 1fr 1fr !important;
|
||||
}
|
||||
.club-stats-grid .stat-box
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
.section-stats-center .section-stats .stats
|
||||
{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.section-stats-center .section-stats .stats .stat-box
|
||||
{
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -575,7 +490,6 @@ td {
|
||||
width: 80%;
|
||||
border-radius: var(--border-radius);
|
||||
max-width: 1000px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.section__matches h2
|
||||
{
|
||||
@@ -630,6 +544,7 @@ body.poland-mode .nav-links li a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
body.poland-mode .nav-links li a:hover {
|
||||
color: #220000;
|
||||
background-color: white;
|
||||
@@ -692,59 +607,28 @@ body.poland-mode .hamburger {
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
/* body.poland-mode .nav-links {
|
||||
body.poland-mode .nav-links {
|
||||
background-color: var(--polska-red);
|
||||
/*Ale oczopląs*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
body.poland-mode .section-stats {
|
||||
background: linear-gradient(to bottom, #bd4148, #dc1414);
|
||||
}
|
||||
|
||||
body.poland-mode .section-stats h2 {
|
||||
color: white;
|
||||
color: #220000
|
||||
}
|
||||
|
||||
body.poland-mode .stat-box {
|
||||
border-color: white;
|
||||
background: linear-gradient(to bottom, #ff0000,#231212);
|
||||
}
|
||||
|
||||
body.poland-mode .stat-box h3 {
|
||||
color: white;
|
||||
}
|
||||
body.poland-mode .club-stats h2{
|
||||
background: linear-gradient(to bottom, #ff0000,#231212);
|
||||
border: 4px solid white;
|
||||
color: white;
|
||||
}
|
||||
body.poland-mode .about-section {
|
||||
background-color: var(--polska-section-color);
|
||||
color: white;
|
||||
}
|
||||
|
||||
body.poland-mode .about-section article h3 {
|
||||
background-color: var(--polska-red-dark);
|
||||
color: white;
|
||||
}
|
||||
|
||||
body.poland-mode .about-section article h4 {
|
||||
background-color: #ffcaca;
|
||||
color: black;
|
||||
border-radius: 5px;
|
||||
}
|
||||
body.poland-mode .general-stats-section h2 {
|
||||
background: var(--polska-section-color);
|
||||
}
|
||||
body.poland-mode .general-stats-section .grid article:nth-child(1){background-color: var(--polska-red-dark);}
|
||||
body.poland-mode .general-stats-section .grid article:nth-child(2){background-color: var(--yellow-highlight);}
|
||||
body.poland-mode .general-stats-section .grid article:nth-child(3){background-color: var(--barca-blue);}
|
||||
body.poland-mode .about-section-image::after{
|
||||
background:var(--polska-red-dark);
|
||||
}
|
||||
/* Przyciski i elementy */
|
||||
|
||||
|
||||
@@ -757,24 +641,9 @@ body.poland-mode .about-section-image::after{
|
||||
padding: 2rem 2rem;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
.section-stats-center
|
||||
{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 30px;
|
||||
justify-content: center;
|
||||
}
|
||||
@media (max-width: 1400px) {
|
||||
|
||||
.section-stats-center
|
||||
{
|
||||
grid-template-columns: 1fr !important;
|
||||
}
|
||||
}
|
||||
|
||||
.section-stats h2 {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
@@ -786,6 +655,7 @@ body.poland-mode .about-section-image::after{
|
||||
justify-content: space-around;
|
||||
text-align: center;
|
||||
margin-top: 2rem;
|
||||
flex-wrap: wrap;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
@@ -813,70 +683,21 @@ body.poland-mode .about-section-image::after{
|
||||
.stat-box p {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
.choose-club
|
||||
{
|
||||
margin: 10px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.choose-club button {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
background-color: white;
|
||||
border: none;
|
||||
|
||||
background-color:transparent;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.choose-club button img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color:transparent;
|
||||
transition: transform 100ms ease;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.choose-club button img:hover {
|
||||
transform: scale(1.3,1.3) translateY(-10px);
|
||||
}
|
||||
.club-stats h2{
|
||||
color: var(--barca-gold);
|
||||
text-align: center;
|
||||
border: 5px solid var(--barca-red);
|
||||
background-color: var(--barca-blue);
|
||||
padding: 20px;
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
.stat-box
|
||||
{
|
||||
padding: 20px;
|
||||
background-color: var(--barca-blue);
|
||||
display: grid;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
text-align: center;
|
||||
}
|
||||
.stat-box-special
|
||||
{text-align: center;
|
||||
display: block;
|
||||
font-size: 40px;
|
||||
color: var(--barca-gold);
|
||||
}
|
||||
.club-stats-grid
|
||||
{
|
||||
display: grid;
|
||||
margin-bottom: 50px;
|
||||
gap: 10px;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-rows: 1fr 1fr 1fr;
|
||||
}
|
||||
select
|
||||
{
|
||||
color: white;
|
||||
padding: 20px;
|
||||
margin: 10px;
|
||||
font-size: 24px;
|
||||
background-color: var(--barca-blue);
|
||||
border-radius: 10px;
|
||||
border: 2px solid white;
|
||||
height: 45px;
|
||||
width: 45px;
|
||||
background-color: #ffffff7e;
|
||||
}
|
||||
@@ -23,10 +23,7 @@
|
||||
<li><a href="/">Strona główna</a></li>
|
||||
<li><a href="/mecze">Mecze</a></li>
|
||||
<li><a href="/statystyki">Statystyki</a></li>
|
||||
<li><a href="/club">Kluby</a></li>
|
||||
<li><a href="/representation">Reprezentacja</a></li>
|
||||
<li><a href="/trophies">Trofea</a></li>
|
||||
<li><a href="/compare">Porównaj</a></li>
|
||||
<li><a href="/historia">Osiągnięcia</a></li>
|
||||
<li><button id="theme-toggle" onclick="toggleTheme()"></button></li>
|
||||
</ul>
|
||||
<div class="hamburger">☰</div>
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Strona Główna{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="choose-club">
|
||||
<a href="{{ url_for('clubs', club='FC Barcelona') }}">
|
||||
<button><img src="{{ url_for('static', filename='FC_Barcelona.png') }}"></button>
|
||||
</a>
|
||||
<a href="{{ url_for('clubs', club='Bayern Monachium') }}">
|
||||
<button><img src="{{ url_for('static', filename='FC_Bayern.png') }}"></button>
|
||||
</a>
|
||||
<a href="{{ url_for('clubs', club='Borussia Dortmund') }}">
|
||||
<button><img src="{{ url_for('static', filename='Borussia_Dortmund.png') }}"></button>
|
||||
</a>
|
||||
<!--Jak nie będzie statysytk dla lecha to usunać-->
|
||||
<a href="{{ url_for('clubs', club='Lech Poznan') }}">
|
||||
<button><img src="{{ url_for('static', filename='Lech_Poznan.png') }}"></button>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<!-- Wyświetlanie danych tylko dla wybranego klubu -->
|
||||
{% for stats in clubs %}
|
||||
{% if stats.club == selected_club %}
|
||||
<section class="club-stats">
|
||||
<h2>Statystyki dla {{selected_club}}</h2>
|
||||
<div class="wybrany{{selected_club}}"></div>
|
||||
<div class="club-stats-grid">
|
||||
<div class="stat-box">
|
||||
<p>Gole:</p> <span class="stat-box-special"> {{ stats.goals }} </span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Asysty:</p> <span class="stat-box-special"> {{ stats.assist }} </span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Występy:</p> <span class="stat-box-special"> {{ stats.goals }} </span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Łączny czas gry:</p> <span class="stat-box-special"> {{ stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Hat-tricki:</p> <span class="stat-box-special"> {{ stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Zwycięstwa:</p> <span class="stat-box-special"> {{ stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Porażki:</p> <span class="stat-box-special"> {{ stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Żółte kartki:</p> <span class="stat-box-special"> {{ stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Czerwone kartki:</p> <span class="stat-box-special"> {{ stats.goals }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{{ commit_in_html | safe }}
|
||||
{% endblock %}
|
||||
@@ -1,68 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Statystyki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<select onchange="location = this.value;">
|
||||
<option disabled selected>Wybierz zawodnika</option>
|
||||
<option value="{{ url_for('compare', player='Leo Messi') }}">Leo Messi</option>
|
||||
<option value="{{ url_for('compare', player='Ronaldo') }}">Cristiano Ronaldo</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">Neymar</option>
|
||||
</select>
|
||||
|
||||
{%for player in player2 %}
|
||||
{% if player.name == selected_player %}
|
||||
<section class="section-stats">
|
||||
<h2>Gole</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ all_time_stats.goals }}</h3>
|
||||
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ player.goals}}</h3>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Asysty</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ all_time_stats.assists }}</h3>
|
||||
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ player.assists}}</h3>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Wystąpienia</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ all_time_stats.assists }}</h3>
|
||||
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ player.assists}}</h3>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Minuty zagrane</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ all_time_stats.assists }}</h3>
|
||||
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ player.assists}}</h3>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor%}
|
||||
|
||||
{% endblock %}
|
||||
30
FlaskWebProject/FlaskWebProject/templates/history.html
Normal file
30
FlaskWebProject/FlaskWebProject/templates/history.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Strona Główna{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="choose-club">
|
||||
<a href="{{ url_for('historia', club='FC Barcelona') }}">
|
||||
<button><img src="{{ url_for('static', filename='FC_Barcelona.png') }}"></button>
|
||||
</a>
|
||||
<a href="{{ url_for('historia', club='Bayern Monachium') }}">
|
||||
<button><img src="{{ url_for('static', filename='FC_Bayern.png') }}"></button>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<!-- Wyświetlanie danych tylko dla wybranego klubu -->
|
||||
{% for stats in history %}
|
||||
{% if stats.club == selected_club %}
|
||||
<section class="club-stats">
|
||||
<h2>{{ stats.club }} - All time stats</h2>
|
||||
<div class="stats">
|
||||
Gole: {{ stats.goals }}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{{ commit_in_html | safe }}
|
||||
{% endblock %}
|
||||
@@ -30,10 +30,10 @@
|
||||
<article>
|
||||
<h3>Osiągnięcia</h3>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quod dicta veritatis quibusdam eligendi corrupti. Expedita delectus assumenda ipsum illum molestias a voluptates, voluptas quia reprehenderit, quod non, eum veritatis tenetur!</p>
|
||||
<a href="/club">Zobacz osiągnięcia</a>
|
||||
<a href="/historia">Zobacz osiągnięcia</a>
|
||||
</article>
|
||||
</section>
|
||||
<!--
|
||||
|
||||
<section class="general-stats-section">
|
||||
<h2>Ogólne statystyki:</h3>
|
||||
<div class="grid">
|
||||
@@ -52,7 +52,7 @@
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
-->
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -3,18 +3,6 @@
|
||||
{% block title %}Lista meczów{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<select>
|
||||
<option disabled selected>Wybierz rok</option>
|
||||
<option value="{{ url_for('compare', player='Leo Messi') }}">2024/2025</option>
|
||||
<option value="{{ url_for('compare', player='Ronaldo') }}">2023/2024</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">2022/2023</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">2021/2022</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">2020/2021</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">2019/2020</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">2018/2019</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">2017/2018</option>
|
||||
<option value="{{ url_for('compare', player='Neymar') }}">2016/2017</option>
|
||||
</select>
|
||||
<section class="section__matches">
|
||||
<h2>📅 Mecze Roberta</h2>
|
||||
<table>
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Statystyki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="club-stats club-stats-poland">
|
||||
<h2>Statystyki w reprezentacji Polski</h2>
|
||||
<div class="wybrany{{selected_club}}"></div>
|
||||
<div class="club-stats-grid">
|
||||
<div class="stat-box">
|
||||
<p>Gole:</p> <span class="stat-box-special"> {{ nation_stats.goals }} </span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Asysty:</p> <span class="stat-box-special"> {{ nation_stats.assist }} </span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Występy:</p> <span class="stat-box-special"> {{ nation_stats.goals }} </span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Łączny czas gry:</p> <span class="stat-box-special"> {{ nation_stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Hat-tricki:</p> <span class="stat-box-special"> {{ nation_stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Zwycięstwa:</p> <span class="stat-box-special"> {{ nation_stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Porażki:</p> <span class="stat-box-special"> {{ nation_stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Żółte kartki:</p> <span class="stat-box-special"> {{ nation_stats.goals }}</span>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<p>Czerwone kartki:</p> <span class="stat-box-special"> {{ nation_stats.goals }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -3,104 +3,38 @@
|
||||
{% block title %}Statystyki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="section-stats-center">
|
||||
|
||||
<section class="section-stats">
|
||||
<h2>Ogólne statystyki</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ all_time_stats.goals }}</h3>
|
||||
<p>Gole</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ all_time_stats.assists }}</h3>
|
||||
<p>Asysty</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ all_time_stats.matches }}</h3>
|
||||
<p>Występy</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="section-stats">
|
||||
<h2>Klubowe statystyki</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ club_stats.goals }}</h3>
|
||||
<p>Gole</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ club_stats.assists }}</h3>
|
||||
<p>Asysty</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ club_stats.matches }}</h3>
|
||||
<p>Występy</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="section-stats">
|
||||
<h2>Reprezentacja statystyki</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ nation_stats.goals }}</h3>
|
||||
<p>Gole</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ nation_stats.assists }}</h3>
|
||||
<p>Asysty</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ nation_stats.matches }}</h3>
|
||||
<p>Występy</p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="section-stats">
|
||||
<h2>Mistrzostwa świata</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ worldcup.goals }}</h3>
|
||||
<p>Gole</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ worldcup.assists }}</h3>
|
||||
<p>Asysty</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ worldcup.matches }}</h3>
|
||||
<p>Występy</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="section-stats">
|
||||
<h2>EURO</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ euro.goals }}</h3>
|
||||
<p>Gole</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ euro.assists }}</h3>
|
||||
<p>Asysty</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ euro.matches }}</h3>
|
||||
<p>Występy</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="section-stats">
|
||||
<h2>Kartki</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ cards.yellow }}</h3>
|
||||
<p>Żółte</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ cards.red }}</h3>
|
||||
<p>Czerwone</p>
|
||||
</div>
|
||||
</div>
|
||||
<section class="section-stats">
|
||||
<h2>All time stats</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ stats.goals }}</h3>
|
||||
<p>Goals</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ stats.assists }}</h3>
|
||||
<p>Assists</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ stats.matches }}</h3>
|
||||
<p>Apps</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
<section class="section-stats">
|
||||
<h2>All time stats</h2>
|
||||
<div class="stats">
|
||||
<div class="stat-box">
|
||||
<h3>{{ stats.goals }}</h3>
|
||||
<p>Goals</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ stats.assists }}</h3>
|
||||
<p>Assists</p>
|
||||
</div>
|
||||
<div class="stat-box">
|
||||
<h3>{{ stats.matches }}</h3>
|
||||
<p>Apps</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Statystyki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section__matches">
|
||||
<h2>📅 Trofea</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Nazwa</th>
|
||||
<th>Data/Sezon</th>
|
||||
</tr>
|
||||
{% for trophy in trophy %}
|
||||
|
||||
<tr>
|
||||
<td>{{ trophy.name }}</td>
|
||||
{% if trophy.year == NULL %}
|
||||
<td>{{ trophy.sezon }}</td>
|
||||
{% endif %}
|
||||
{% if trophy.sezon == NULL %}
|
||||
<td>{{ trophy.year }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
BIN
FlaskWebProject/instance/lewangoalski.sqlite
Normal file
BIN
FlaskWebProject/instance/lewangoalski.sqlite
Normal file
Binary file not shown.
Reference in New Issue
Block a user