begining of history section

This commit is contained in:
2025-06-02 00:32:27 +02:00
parent 42c60f9db5
commit 48825185b8
9 changed files with 55 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ def setup():
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)

View File

@@ -34,6 +34,14 @@ def statystyki():
}
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('history.html', history=history, selected_club=selected_club)
def toggle_dark_mode():
# Przełącz tryb i zapisz w ciasteczku
dark_mode = request.cookies.get('darkMode', 'disabled')

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -242,3 +242,18 @@ header button:hover {
.stat-box p {
font-size: 1.1rem;
}
.choose-club button{
height: 50px;
width: 50px;
background-color: white;
border: none;
}
.choose-club button img{
height: 40px;
width: 40px;
}
.choose-club button img:hover{
height: 45px;
width: 45px;
background-color: #ffffff7e;
}

View File

@@ -20,7 +20,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="/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>

View File

@@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block title %}Strona Główna{% endblock %}
{% block content %}
<section>
<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 %}