begining of history section
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
BIN
FlaskWebProject/FlaskWebProject/static/Borussia_Dortmund.png
Normal file
BIN
FlaskWebProject/FlaskWebProject/static/Borussia_Dortmund.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 165 KiB |
BIN
FlaskWebProject/FlaskWebProject/static/FC_Barcelona.png
Normal file
BIN
FlaskWebProject/FlaskWebProject/static/FC_Barcelona.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
BIN
FlaskWebProject/FlaskWebProject/static/FC_Bayern.png
Normal file
BIN
FlaskWebProject/FlaskWebProject/static/FC_Bayern.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 186 KiB |
BIN
FlaskWebProject/FlaskWebProject/static/Lech_Poznan.png
Normal file
BIN
FlaskWebProject/FlaskWebProject/static/Lech_Poznan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -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;
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
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>
|
||||
<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 %}
|
||||
Reference in New Issue
Block a user