personalizare

This commit is contained in:
2025-01-13 15:47:23 +02:00
parent d9e40f0d73
commit bea9d5c307
4 changed files with 10 additions and 11 deletions

6
app.py
View File

@@ -33,10 +33,6 @@ class Content(db.Model):
player_id = db.Column(db.Integer, db.ForeignKey('player.id'), nullable=True)
group_id = db.Column(db.Integer, db.ForeignKey('group.id'), nullable=True)
@app.before_first_request
def create_tables():
db.create_all()
@app.route('/')
def dashboard():
players = Player.query.all()
@@ -107,4 +103,6 @@ def player_page(player_id):
return render_template('player_page.html', player=player, content=content)
if __name__ == '__main__':
with app.app_context():
db.create_all() # Creează toate tabelele
app.run(debug=True)

BIN
instance/dashboard.db Normal file

Binary file not shown.

View File

@@ -19,11 +19,12 @@
<h2>Groups</h2>
<ul>
{% for group_name, group in groups.items() %}
{% for group in groups %}
<li>
{{ group_name }} ({{ group.players | length }} players)
{{ group.name }} ({{ group.players | length }} players)
</li>
{% endfor %}
{% endfor %}
</ul>
<a href="{{ url_for('add_group') }}">Add Group</a>

View File

@@ -20,8 +20,8 @@
{% endfor %}
</optgroup>
<optgroup label="Groups">
{% for group_name in groups.keys() %}
<option value="{{ group_name }}">{{ group_name }}</option>
{% for group in groups %}
<option value="{{ group.id }}">{{ group.name }}</option>
{% endfor %}
</optgroup>
</select><br>