14 Commits

19 changed files with 1329 additions and 300 deletions

View File

@@ -61,6 +61,34 @@ class scraper:
# return False
return self.__czy_x_istnieje("kluby", id_klubu=id_klubu)
def id_na_imie_nazwisko_urodziny(self, zewnetrzne_id_sportowca: str = "MVC8zHZD"):
"""
Scraper z dykty xD
Pobiera imiona, nazwiska i dni urodzin sportowców z zewnętrznego id.
Działa na słowo honoru.
:param zewnetrzne_id_sportowca: Zewnętrzne id sportowca
:type zewnetrzne_id_sportowca: str
"""
if len(zewnetrzne_id_sportowca) != 8:
raise ValueError("Zewnętrzne ID sportowca powinno być długości 8!")
r = requests.get(f'https://www.flashscore.pl/?r=4:{zewnetrzne_id_sportowca}')
page = r.text
name_start_pos = page.find("data-testid=\"wcl-scores-heading-02\">") + 36
name_end_pos = page.find("</", name_start_pos)
name = page[name_start_pos:name_end_pos].strip().split(' ')
# Tak wiem... można by było użyć beautifulsoup4, ale nie ma sensu dodawać nowych zależności dla tylko jednej metody.
birthday_start_pos_1 = page.find("data-testid=\"wcl-scores-simpleText-01\">", name_end_pos) + 39
birthday_start_pos_2 = page.find("data-testid=\"wcl-scores-simpleText-01\">", birthday_start_pos_1) + 39
birthday_start_pos_3 = page.find("data-testid=\"wcl-scores-simpleText-01\">", birthday_start_pos_2) + 39
birthday_start_pos = page.find("data-testid=\"wcl-scores-simpleText-01\">", birthday_start_pos_3) + 39
birthday_end_pos = page.find("</", birthday_start_pos) - 1
birthday = None if birthday_end_pos - birthday_start_pos > 20 else page[birthday_start_pos:birthday_end_pos].strip(" ()")
return name, birthday
def aktualizuj_dane_sportowca(self, zewnetrzne_id_sportowca: str = "MVC8zHZD"):
stop_scraping = False
matches_to_add = []

View File

@@ -62,12 +62,15 @@ 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('/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

@@ -10,6 +10,18 @@ import traceback
global db
class c:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
ENDL = '\n'
class baza():
# global sportowcy, trofea, sportowcy_w_meczach, statystyki_sportowcow, kluby, mecze
@@ -168,9 +180,9 @@ class baza():
try:
return_val = func(self, *args, **kwargs)
except:
print( "\033[91m"
print(f"{c.FAIL}"
f"Wystąpił błąd podczas wykonywania zapytania SQL:"
"\033[0m"
f"{c.ENDC}"
"\n"
f"{traceback.format_exc()}")
self.session.rollback()
@@ -263,6 +275,14 @@ class baza():
if not isinstance(entity_type, str):
entity_type = entity_type.__name__
if "id" in kwargs:
print(f"{c.FAIL}UWAGA!{c.ENDC}")
print(f"Próbujesz dodać obiekt do tabeli, który ma już identyfikator.\n"
f"To spowoduje problemy w przyszłości, gdy będziesz chciał dodać nowy obiekt do bazy bez ustawiania id na sztywno\n"
f"(id klucza głównego nie zostanie zaktualizowane w sekwencji, przez co baza będzie próbowała dodać obiekt z id już istniejącego rekordu!).\n"
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")
obj = self.entities[entity_type](**kwargs)

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': 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():
@@ -32,20 +65,39 @@ def mecze():
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': 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('history.html', history=history, selected_club=selected_club)
return render_template('club.html', clubs=clubs, selected_club=selected_club)
def representation():
nation_stats = {
'goals': 86,
'assists': 52,
'matches': 158,
}
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: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -1,47 +1,57 @@
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Lewandowski Stats{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<meta property="og:title" content="Robert Lewandowski Stats">
<meta property="og:type" content="website" >
<meta property="og:url" content="https://lewy.7o7.cx/" >
<meta property="og:type" content="website">
<meta property="og:url" content="https://lewy.7o7.cx/">
<meta property="og:description" content="Najnowsze informacje o meczach, golach, asystach i innych statystykach">
<meta property="og:image" content="{{ url_for('static', filename='lewandowski.jpg') }}" >
<meta property="og:image:height" content = "143">
<meta property="og:image:width" content = "100">
<meta property="og:image" content="{{ url_for('static', filename='lewandowski.jpg') }}">
<meta property="og:image:height" content="143">
<meta property="og:image:width" content="100">
</head>
<body>
<nav class="navbar">
<div class="logo">Robert Lewandowski</div>
<ul class="nav-links">
<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><button id="theme-toggle" onclick="toggleTheme()">🌙 / 🌞</button></li>
</ul>
<div class="hamburger"></div>
</nav>
<header>
<body>
<header class="base-header">
<nav class="navbar">
<a class="logo-link" href="/"><div class="logo-text">Robert Lewandowski</div></a>
<ul class="nav-links">
<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><button id="theme-toggle" onclick="toggleTheme()"></button></li>
</ul>
<div class="hamburger"></div>
</nav>
<div class="header-content">
<center><img src="{{ url_for('static', filename='lewandowski.jpg') }}" alt="Robert Lewandowski" class="profile-image"></center>
<h1>Statystyki Roberta Lewandowskiego</h1>
<div class="profile-image">
<img src="{{ url_for('static', filename='lewandowski_no_bg.png') }}" alt="Robert Lewandowski">
<div class="profile-image-cover"></div>
</div>
<h1>Statystyki <br><span class="header-content-special"> Roberta <br> Lewandowskiego</span></h1>
</div>
<div></div>
</header>
<main>
{% block content %}{% endblock %}
</main>
<script>
const hamburger = document.querySelector('.hamburger');
const navLinks = document.querySelector('.nav-links');
hamburger.addEventListener('click', () => {
navLinks.classList.toggle('show');});
</script>
<script>
const hamburger = document.querySelector('.hamburger');
const navLinks = document.querySelector('.nav-links');
hamburger.addEventListener('click', () => {
navLinks.classList.toggle('show');
});
</script>
<script>
function toggleTheme() {
const currentMode = document.body.classList.contains('poland-mode') ? 'poland' : 'fcb';
@@ -59,8 +69,9 @@
</script>
<!--!>Footer<-->
<hr style='width: 50%'/>
<hr style='width: 50%' />
{% block footer %}{% endblock %}
</body>
</html>
</html>

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.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 %}

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

@@ -3,13 +3,56 @@
{% block title %}Strona Główna{% endblock %}
{% block content %}
<h2>Witaj na stronie poświęconej statystykom Roberta Lewandowskiego!</h2>
<p>Tu znajdziesz najnowsze informacje o meczach, golach, asystach i innych statystykach.</p>
<div>
<h3>Ogólne statystyki:</h3>
<p>Gole: {{ goals }}</p>
<p>Asysty: {{ assists }}</p>
<p>Liczba meczów: {{ matches }}</p>
<div class="main-index">
<h2>Witaj na stronie poświęconej <br> statystykom Roberta Lewandowskiego!</h2>
<p>Tu znajdziesz najnowsze informacje o meczach, golach, asystach i innych statystykach.</p>
<section class="about-section">
<article class="article__how-it-works">
<h3>Jak to działa?</h3>
<h4>Pobieranie statystyk</h4>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ratione harum minus hic, voluptate perspiciatis laborum? Alias maxime, voluptate reprehenderit iusto dolorem officiis porro voluptatibus repellat dicta doloribus, blanditiis similique accusantium.</p>
<h4>Porównywanie zawodników</h4>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fuga, in perspiciatis. Sequi laborum et animi quas sit voluptatibus alias sed ad molestias nulla vel cum, consectetur commodi odio aliquam officia.</p>
</article>
<div class="about-section-image">
<img src="{{ url_for('static', filename='gigabuła.png') }}">
</div>
<article>
<h3>Mecze</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Soluta ullam iusto ex? Quo amet officia aliquam odio sint harum nam eaque nihil ipsa quos aliquid, illum voluptatum, numquam, magnam omnis?</p>
<a href="/mecze">Zobacz mecze</a>
</article>
<article>
<h3>Statystyki</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Temporibus dolore tenetur nulla sint recusandae illo dolores aspernatur ducimus, omnis vitae ipsam neque animi voluptates eos porro, nihil iusto veniam commodi!</p>
<a href="/statystyki">Zobacz statystyki</a>
</article>
<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>
</article>
</section>
<!--
<section class="general-stats-section">
<h2>Ogólne statystyki:</h3>
<div class="grid">
<article>
<h3>Gole:</h3>
<p>{{ goals }}</p>
</article>
<article>
<h3>Asysty</h3>
<p>{{ assists }}</p>
</article>
<article>
<h3>Liczba meczów</h3>
<p>{{ matches }}</p>
</article>
</div>
</section>
-->
</div>
{% endblock %}

View File

@@ -3,23 +3,37 @@
{% block title %}Lista meczów{% endblock %}
{% block content %}
<h2>📅 Mecze Roberta</h2>
<table>
<tr>
<th>Data</th>
<th>Przeciwnik</th>
<th>Gole</th>
<th>Asysty</th>
<th>Minuty</th>
</tr>
{% for match in matches %}
<tr>
<td>{{ match.date }}</td>
<td>{{ match.opponent }}</td>
<td>{{ match.goals }}</td>
<td>{{ match.assists }}</td>
<td>{{ match.minutes }}</td>
</tr>
{% endfor %}
</table>
<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>
<tr>
<th>Data</th>
<th>Przeciwnik</th>
<th>Gole</th>
<th>Asysty</th>
<th>Minuty</th>
</tr>
{% for match in matches %}
<tr>
<td>{{ match.date }}</td>
<td>{{ match.opponent }}</td>
<td>{{ match.goals }}</td>
<td>{{ match.assists }}</td>
<td>{{ match.minutes }}</td>
</tr>
{% endfor %}
</table>
</section>
{% endblock %}

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.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 %}

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 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>
</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>
</section>
{% endblock %}
{% 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 %}