From bea9d5c3071b264bc0631c44026f74d7941d1dd7 Mon Sep 17 00:00:00 2001 From: Ske087 Date: Mon, 13 Jan 2025 15:47:23 +0200 Subject: [PATCH] personalizare --- app.py | 6 ++---- instance/dashboard.db | Bin 0 -> 28672 bytes templates/dashboard.html | 11 ++++++----- templates/upload_content.html | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 instance/dashboard.db diff --git a/app.py b/app.py index b1a1554..baadcfd 100644 --- a/app.py +++ b/app.py @@ -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) diff --git a/instance/dashboard.db b/instance/dashboard.db new file mode 100644 index 0000000000000000000000000000000000000000..2be60dae7338ca794102d9d963c645ed7f024a45 GIT binary patch literal 28672 zcmeI)?@!u57zgk>z+$^#=c~rJWv82gW=ce}iA$D@nW|)nv%(TzkxnXhgO;^rKVGVP zw|{H@&Sv&{Z`M+N>`+PeVtc{97Ye=Oo}tXMUuXW>$g<3Irek0SG_<0uX=z z1R(G)1Umtl37(WUmVP)^0)1FHXStVGKy<~S-{;1( z{uoYDH>U(;FHMPM*UgXKyJoO*tQj5O>DFspy0siv70!fMQc)Co_I60v?Gfk52JSbW zXxurLA34Q1r5;MPTs)|1EE5K*lB&i9<*710hv?YDwQjfuCTB-9sm#sMi&Xd6qcuU~R+mJ~(cD*kN=Ej`~PyD#$M;e5P$##AOHafKmY;|fB*y_0D-?Pun`l;y_NKRFZ?L3&iwao+ghnx4a>6{w$U)x za+_<}+~a(9HJi(C7H!M745PW4TX;eRqC8Bmw+zc34f-u+BOk>CA%mTTaQ#o^ZzQ;( zKmY;|fB*y_009U<00Izz00bZ~2?Db;PSog23MSiinjP1Yg1o5wodh=&2tWV=5P$## zAOHafKmY;|fB*z0LSQzoiv0RNy8a*hHXpyppNMxDNk9Ms5P$##AOHafKmY;|fB*zW z1mZLlAOHafKmY;|fB*y_009V0ia;VEiehyA|B}d;ladzlfB*y_ k009U<00Izz00bZa0SNr}0&?(Ifp;kpTaNE!-?SUjFYR1&c>n+a literal 0 HcmV?d00001 diff --git a/templates/dashboard.html b/templates/dashboard.html index b3f6a25..b763e5d 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -19,11 +19,12 @@

Groups

    - {% for group_name, group in groups.items() %} -
  • - {{ group_name }} ({{ group.players | length }} players) -
  • - {% endfor %} + {% for group in groups %} +
  • + {{ group.name }} ({{ group.players | length }} players) +
  • +{% endfor %} +
Add Group diff --git a/templates/upload_content.html b/templates/upload_content.html index 4f45e75..004ebfc 100644 --- a/templates/upload_content.html +++ b/templates/upload_content.html @@ -20,8 +20,8 @@ {% endfor %} - {% for group_name in groups.keys() %} - + {% for group in groups %} + {% endfor %}