diff --git a/restaurant/routes.py b/restaurant/routes.py index 36e92cea..cc606c9a 100644 --- a/restaurant/routes.py +++ b/restaurant/routes.py @@ -48,7 +48,8 @@ def cart_page(): if request.method == 'GET': selected_items = Item.query.filter_by(orderer = current_user.id)#get items which user has added to the cart - return render_template('cart.html', order_form = order_form, selected_items = selected_items) + qtd = len(Item.query.filter_by(orderer = current_user.id).all()) + return render_template('cart.html', order_form = order_form, selected_items = selected_items, selected_items_count = qtd) #CONGRATULATIONS PAGE @app.route('/congrats') diff --git a/restaurant/static/styles/css/style-cart.css b/restaurant/static/styles/css/style-cart.css index 904acde6..03af1b63 100644 --- a/restaurant/static/styles/css/style-cart.css +++ b/restaurant/static/styles/css/style-cart.css @@ -8,12 +8,15 @@ body{ align-items: center; } -.CartContainer{ - width: 80%; - height: 90%; - background-color: #ffffff; +.CartContainer { + margin: auto; + width: 80%; + min-height: 90%; + background-color: #ffffff; border-radius: 20px; box-shadow: 0px 10px 20px #1687d933; + overflow-y: auto; + box-sizing: border-box; /* Inclui bordas e preenchimentos na altura e largura */ } .Header{ @@ -152,6 +155,7 @@ hr{ margin-right: 5%; } .checkout{ + margin: 100px 0; float: right; margin-right: 5%; width: 28%; diff --git a/restaurant/templates/cart.html b/restaurant/templates/cart.html index 12762c28..2670dc37 100644 --- a/restaurant/templates/cart.html +++ b/restaurant/templates/cart.html @@ -44,7 +44,8 @@