new dashboard

This commit is contained in:
2025-01-22 08:33:57 +08:00
parent 37ae72ceef
commit fae8ddb6d3
2 changed files with 77 additions and 18 deletions
+4 -2
View File
@@ -84,12 +84,14 @@ def verify_document(document_id):
return redirect(url_for('dashboard'))
return redirect(url_for('home'))
@app.route('/dashboard')
@app.route('/dashboard', methods=['GET', 'POST'])
@login_required
def dashboard():
if current_user.is_host:
listings = Listing.query.filter_by(host_id=current_user.id).all()
return render_template('dashboard.html', listings=listings)
users = User.query.all()
documents = {doc.user_id: doc for doc in Document.query.all()}
return render_template('dashboard.html', listings=listings, users=users, documents=documents)
return redirect(url_for('home'))
@app.route('/create-listing', methods=['GET', 'POST'])