14 Commits

Author SHA1 Message Date
c86a93c153 fix: i forgor to add some waiting time to avoid rate limiting 2025-06-05 19:22:05 +02:00
43eb1d421d Merge branch 'ScraperTest' 2025-06-05 19:18:49 +02:00
cf46fdfbb7 data for stats 2025-06-05 18:47:30 +02:00
791d20139d chore: offload some shared functionality to other methods
should also fix unexpected db behavior (hangs and disconnects)
2025-06-05 16:31:45 +02:00
c3a6626d6f fix: display commit info properly 2025-06-05 11:40:56 +02:00
5960e44b17 Merge pull request 'merge new front-end' (#3) from frontend into master
Reviewed-on: #3
2025-06-05 10:30:28 +02:00
919d64ca5e Merge branch 'master' into frontend 2025-06-05 10:30:04 +02:00
2cfa5f1fa4 poland-style changes 2025-06-05 10:27:11 +02:00
9b45a3f26f polandmode statbox color 2025-06-05 00:47:59 +02:00
3dfc40cdb0 trophies update and hamburger fix 2025-06-05 00:40:47 +02:00
be951d296f representation changes 2025-06-04 17:02:57 +02:00
6e1e8ccc7d stats maches club style changes 2025-06-04 16:55:31 +02:00
03463905ef fixing responsive 2025-06-04 15:32:03 +02:00
f65a174089 skeleton to all sites (i hope) 2025-06-03 23:26:30 +02:00
16 changed files with 652 additions and 134 deletions

View File

@@ -251,7 +251,7 @@ class scraper:
# rate limita. - sherl
page += 1
#time.sleep(15)
time.sleep(5)
def aktualizuj_dane(self):

View File

@@ -58,16 +58,21 @@ def setup():
sanity_string += f" If you're running a reverse proxy, set {c.OKCYAN}is_proxied{c.ENDC} to true to silence this message.\n"
print(sanity_string)
# Should fix disconnects: https://stackoverflow.com/a/61739721
app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {"pool_pre_ping": True}
app.config['SQLALCHEMY_DATABASE_URI'] = f"{config['general']['db_path_url']}"
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('/historia', view_func=lewy_routes.historia)
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)
# API:
app.add_url_rule('/api/', view_func=lewy_api.api_greeting)

View File

@@ -36,6 +36,9 @@ class baza():
self.db = self.initDB(self.app, config)
self.refresh_session()
def __repr__(self):
return f"<Obiekt bazodanowy baza ({len(self.entities)} encji)>"
def initDB(self, app, config):
global sportowcy, trofea, sportowcy_w_meczach, statystyki_sportowcow, kluby, mecze
tnp = config['general']['db_prefix'] + "_lewangoalski_"
@@ -220,8 +223,10 @@ class baza():
:param string: Zapis tekstowy
:type string: str
"""
table_str = string[:string.find('.')]
column_str = string[string.find('.') + 1:]
try:
table_str, column_str = string.split('.')
except:
raise ValueError("Nieprawidłowe dane - podaj zarówno tabelę, jak i kolumnę, np.: \"kluby.id_klubu\".")
if hasattr(self.entities[table_str], column_str):
return getattr(self.entities[table_str], column_str)
return None
@@ -241,28 +246,61 @@ class baza():
if not isinstance(entity_type, str):
entity_type = entity_type.__name__
# Save special arguments received with kwargs,
# that are meant for SQL operations to special_args,
# and delete from the rest, that will be passed
# directly to filter_by().
# They will not be passed as search query, but serve
# as an additional search parameter.
special_keywords = ("ORDER_BY", "ORDER_BY_DESC", "LIMIT")
special_args = {}
for arg in special_keywords:
if arg in kwargs:
special_args[arg] = kwargs[arg]
del kwargs[arg]
query_params, special_args = self.extract_special_args(kwargs)
print(f"[{round(time.time())}] SELECT {entity_type}")
results = (
self.session.
query(self.entities[entity_type]).
filter_by(**kwargs)
filter_by(**query_params)
)
# Obsługuje "ORDER_BY", "LIMIT", itp. itd.
results = self.manipulate_results(results, special_args)
results_objs = results.all()
print(f"[{round(time.time())}] SELECT RESULTS: {results_objs}")
return results_objs
def extract_special_args(self, dictionary: dict):
"""
Zwraca krotkę składającą się ze słowników z:
- parametrami wyszukiwania
- specjalnymi argumentami
:param dictionary: Słownik wejściowy
:type dictionary: dict
"""
# Save special arguments received with kwargs,
# that are meant for SQL operations to special_args,
# and delete from the rest, that will be passed
# directly to filter_by().
# They will not be passed as search query, but serve
# as an additional search parameter.
dictionary = dictionary.copy()
special_keywords = ("ORDER_BY", "ORDER_BY_DESC", "LIMIT")
special_args = {}
for arg in special_keywords:
if arg in dictionary:
special_args[arg] = dictionary[arg]
del dictionary[arg]
return dictionary, special_args
def manipulate_results(self, results, special_args: dict):
"""
Wykonuje specjalne operacje na rezultatach wyszukiwania.
:param results: Wyniki wyszukiwania (ORM)
:param special_args: Specjalne operacje
:type special_args: dict
"""
if "ORDER_BY" in special_args:
column = self.str_to_column(special_args["ORDER_BY"])
if column is not None:
@@ -276,10 +314,7 @@ class baza():
if "LIMIT" in special_args:
results = results.limit(special_args["LIMIT"])
results_objs = results.all()
print(f"[{round(time.time())}] SELECT RESULTS: {results_objs}")
return results_objs
return results
@exit_gracefully
def simple_insert_one(self, entity_type, **kwargs):

View File

@@ -36,11 +36,11 @@ def getCommit() -> str | None:
return None
def getCommitInFormattedHTML():
repo = "<p>Brak informacji o wersji skryptu</p>"
repo = "<center><p style=\"color: white;\">Brak informacji o wersji skryptu</p></center>"
commit = getCommit()
if commit is not None:
repo = f"<p>Commit: <a href='https://gitea.7o7.cx/roberteam/lewangoalski/commit/{commit}'>{commit[:11]}</a></p>"
repo = f"<center><p style=\"color: white;\">Commit: <a href='https://gitea.7o7.cx/roberteam/lewangoalski/commit/{commit}'>{commit[:11]}</a></p></center>"
return repo

View File

@@ -3,6 +3,39 @@ import lewy_api_v1
import lewy_db
import lewy_globals
def get_lewy_stats():
return {
'all_time_stats': {
'goals': 589+78,
'assists':154+21,
'matches': 791+136,
},
'club_stats': {
'goals': 589,
'assists': 154,
'matches': 791,
},
'nation_stats': {
'goals': 78,
'assists': 21,
'matches': 136,
},
'international_cups': {
'goals': 110,
'assists': 19,
'matches': 152,
},
'national_cups': {
'goals': 58,
'assists': 4,
'matches': 74,
},
'cards': {
'yellow': 86,
'red': 2,
}
}
def index():
dark_mode = request.cookies.get('darkMode', 'disabled')
# Przykładowe użycie endpointu last_goal_for():
@@ -25,27 +58,71 @@ 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)
def statystyki():
stats = {
'goals': 38,
'assists': 12,
'matches': 45,
}
return render_template('stats.html', stats=stats)
dane=get_lewy_stats()
return render_template('stats.html', **dane)
def historia():
def clubs():
selected_club = request.args.get("club","FC Barcelona")
history = [
{'club': 'FC Barcelona', 'goals': 22},
{'club': 'Bayern Monachium', 'goals': 132},
clubs = [
{'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('history.html', history=history, selected_club=selected_club)
return render_template('club.html', clubs=clubs, selected_club=selected_club)
def representation():
nation_stats = {
'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():
selected_player = request.args.get("player","Leo Messi")
lewy=get_lewy_stats()
player2 = [
{'name':'Leo Messi','goals': 34,'assists': 12},
]
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)
def toggle_dark_mode():
# Przełącz tryb i zapisz w ciasteczku

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@@ -24,7 +24,7 @@
--polska-red: #E30B17;
--polska-white: #FFFFFF;
--polska-section-color: #05204A;
--polska-section-color: #121623;
--section-color: #051839;
--pink-highlight: #E1317E;
--blue-highlight: #00B9BF;
@@ -61,6 +61,7 @@ body {
font-size: 15px;
z-index: -2;
position: relative;
margin-top: 60px;
/* box-shadow: 0px -5px 10px 2px rgba(0, 0, 0, 0.347); */
}
@@ -82,6 +83,7 @@ body {
width: 40%;
padding: 20px;
position: relative;
}
.profile-image-cover {
@@ -93,6 +95,7 @@ body {
top: 0;
}
.profile-image img {
width: 100%;
max-width: 600px;
@@ -129,7 +132,7 @@ header button {
padding: 2.3rem 1rem;
height: 1.5rem;
position: sticky;
position: fixed;
top: 0;
left: 0;
width: 100%;
@@ -181,7 +184,7 @@ header button {
align-items: center;
text-decoration: none;
border-radius: var(--border-radius);
padding: 10px 20px;
padding: 10px;
height: 100%;
transition: 100ms ease;
position: relative;
@@ -218,8 +221,17 @@ 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;
@@ -292,21 +304,32 @@ header button {
cursor: pointer;
}
@media (max-width: 768px) {
@media (max-width: 1090px) {
/* .base-header .navbar:not(:has(.show))
{
margin-bottom: 400px;
} */
.nav-links {
display: none;
flex-direction: column;
background-color: var(--barca-blue);
position: absolute;
top: 2.5rem;
right: 0rem;
flex-direction: column;
top: 57px;
right: 0px;
padding: 0rem;
gap: 0;
width: 200px;
height: auto;
backdrop-filter: blur(4px);
width: 30%;
justify-content: center;
box-shadow: 0px 0px 5px 5px rgba(0, 0, 0, 0.105);
}
.nav-links li {
width: 100%;
margin: 0;
display: flex;
justify-content: center;
}
.nav-links li a,
@@ -319,16 +342,50 @@ 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: flex;
display: none;
}
.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;
}
}
@@ -490,6 +547,7 @@ td {
width: 80%;
border-radius: var(--border-radius);
max-width: 1000px;
margin-bottom: 50px;
}
.section__matches h2
{
@@ -544,7 +602,6 @@ body.poland-mode .nav-links li a {
color: white;
}
body.poland-mode .nav-links li a:hover {
color: #220000;
background-color: white;
@@ -607,28 +664,59 @@ 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: #220000
color: white;
}
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 */
@@ -641,9 +729,24 @@ body.poland-mode .stat-box h3 {
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;
@@ -655,7 +758,6 @@ body.poland-mode .stat-box h3 {
justify-content: space-around;
text-align: center;
margin-top: 2rem;
flex-wrap: wrap;
gap: 2rem;
}
@@ -683,21 +785,70 @@ body.poland-mode .stat-box h3 {
.stat-box p {
font-size: 1.1rem;
}
.choose-club
{
margin: 10px;
padding: 20px;
display: flex;
gap: 20px;
justify-content: space-around;
}
.choose-club button {
height: 50px;
width: 50px;
background-color: white;
width: 100px;
border: none;
background-color:transparent;
border-radius: 50%;
}
.choose-club button img {
height: 40px;
width: 40px;
width: 100%;
height: 100%;
background-color:transparent;
transition: transform 100ms ease;
}
.choose-club button img:hover {
height: 45px;
width: 45px;
background-color: #ffffff7e;
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;
}

View File

@@ -23,7 +23,10 @@
<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="/historia">Osiągnięcia</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><button id="theme-toggle" onclick="toggleTheme()"></button></li>
</ul>
<div class="hamburger"></div>

View File

@@ -0,0 +1,64 @@
{% 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.matches }} </span>
</div>
<div class="stat-box">
<p>Łączny czas gry:</p> <span class="stat-box-special"> {{ stats.minutes_played }}</span>
</div>
<div class="stat-box">
<p>Żółte kartki:</p> <span class="stat-box-special"> {{ stats.yellow_card }}</span>
</div>
<div class="stat-box">
<p>Czerwone kartki:</p> <span class="stat-box-special"> {{ stats.red_card }}</span>
</div>
<div class="stat-box">
<p>Zwycięstwa:</p> <span class="stat-box-special"> {{ stats.wins }}</span>
</div>
<div class="stat-box">
<p>Remisy:</p> <span class="stat-box-special"> {{ stats.draws }}</span>
</div>
<div class="stat-box">
<p>Porażki:</p> <span class="stat-box-special"> {{ stats.lost }}</span>
</div>
</div>
</section>
{% endif %}
{% endfor %}
{% endblock %}
{% block footer %}
{{ commit_in_html | safe }}
{% endblock %}

View File

@@ -0,0 +1,68 @@
{% 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 %}

View File

@@ -1,30 +0,0 @@
{% 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 %}

View File

@@ -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="/historia">Zobacz osiągnięcia</a>
<a href="/club">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 %}

View File

@@ -3,6 +3,18 @@
{% 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>

View File

@@ -0,0 +1,39 @@
{% 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.assists }} </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.minutes_played }}</span>
</div>
<div class="stat-box">
<p>Żółte kartki:</p> <span class="stat-box-special"> {{ nation_stats.yellow_card }}</span>
</div>
<div class="stat-box">
<p>Czerwone kartki:</p> <span class="stat-box-special"> {{ nation_stats.red_card }}</span>
</div>
<div class="stat-box">
<p>Zwycięstwa:</p> <span class="stat-box-special"> {{ nation_stats.wins }}</span>
</div>
<div class="stat-box">
<p>Remisy:</p> <span class="stat-box-special"> {{ nation_stats.draws }}</span>
</div>
<div class="stat-box">
<p>Porażki:</p> <span class="stat-box-special"> {{ nation_stats.lost }}</span>
</div>
</div>
</section>
{% endblock %}

View File

@@ -3,38 +3,104 @@
{% block title %}Statystyki{% endblock %}
{% block content %}
<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>
<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 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>Puchary międzynarodowe</h2>
<div class="stats">
<div class="stat-box">
<h3>{{ international_cups.goals }}</h3>
<p>Gole</p>
</div>
<div class="stat-box">
<h3>{{ international_cups.assists }}</h3>
<p>Asysty</p>
</div>
<div class="stat-box">
<h3>{{ international_cups.matches }}</h3>
<p>Występy</p>
</div>
</div>
</section>
<section class="section-stats">
<h2>Puchary krajowe</h2>
<div class="stats">
<div class="stat-box">
<h3>{{ national_cups.goals }}</h3>
<p>Gole</p>
</div>
<div class="stat-box">
<h3>{{ national_cups.assists }}</h3>
<p>Asysty</p>
</div>
<div class="stat-box">
<h3>{{ national_cups.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>
</div>
</section>
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% 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 %}