Merge branch 'pr-3'

This commit is contained in:
2025-04-10 09:12:18 +02:00
5 changed files with 26 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
from flask import Flask, render_template from flask import Flask, render_template
from .lewy_globals import *
app = Flask(__name__) app = Flask(__name__)
@@ -11,15 +12,16 @@ def index():
'matches_list': [ 'matches_list': [
{'date': '2024-10-12', 'opponent': 'Real Madrid', 'goals': 2, 'assists': 1, 'minutes': 90}, {'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': '2024-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85},
# Mo<EFBFBD>esz doda<EFBFBD> wi<EFBFBD>cej mecz<EFBFBD>w... # Możesz dodać więcej meczów...
] ]
} }
return render_template('index.html', goals=stats['goals'], assists=stats['assists'], return render_template('index.html', goals=stats['goals'], assists=stats['assists'],
matches=stats['matches'], matches_list=stats['matches_list']) matches=stats['matches'], matches_list=stats['matches_list'],
commit=lewy_globals.getCommit())
@app.route('/mecze') @app.route('/mecze')
def mecze(): def mecze():
# Mo<EFBFBD>esz dostarczy<EFBFBD> szczeg<EFBFBD><EFBFBD>y dotycz<EFBFBD>ce mecz<EFBFBD>w # Możesz dostarczyć szczegóły dotyczące meczów
matches = [ matches = [
{'date': '2024-10-12', 'opponent': 'Real Madrid', 'goals': 2, 'assists': 1, 'minutes': 90}, {'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': '2024-10-19', 'opponent': 'Valencia', 'goals': 1, 'assists': 0, 'minutes': 85},
@@ -36,4 +38,4 @@ def statystyki():
return render_template('stats.html', stats=stats) return render_template('stats.html', stats=stats)
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True) app.run(debug=True)

View File

@@ -0,0 +1,10 @@
from git import Repo # hash ostatniego commitu
def getCommit():
repo = "<p>Brak informacji o wersji skryptu</p>"
try:
repo = Repo(search_parent_directories=True).head.object.hexsha
repo = f"<p>Commit: <a href='https://gitea.7o7.cx/roberteam/lewangoalski/commit/{repo}' style='width: 50%'>{repo[:11]}</a></p>"
except:
pass
return repo

View File

@@ -47,5 +47,10 @@
} }
} }
</script> </script>
<!--!>Footer<-->
<hr/>
{% block footer %}{% endblock %}
</body> </body>
</html> </html>

View File

@@ -12,3 +12,7 @@
<p>Liczba meczów: {{ matches }}</p> <p>Liczba meczów: {{ matches }}</p>
</div> </div>
{% endblock %} {% endblock %}
{% block footer %}
{{ commit | safe }}
{% endblock %}

View File

@@ -1 +1,2 @@
Flask>=2.2.3 Flask>=2.2.3
gitpython