Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Samuel Dudík
PA165 Winery Management System
Commits
a27bee5d
Commit
a27bee5d
authored
May 18, 2022
by
Samuel Dudík
Browse files
Order: Minor features
parent
ef752cef
Pipeline
#141089
passed with stages
in 2 minutes and 47 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
winery/webapp/src/main/java/cz/muni/fi/pa165/winery/webapp/controllers/CartController.java
View file @
a27bee5d
...
...
@@ -48,6 +48,8 @@ public class CartController extends ControllerBase {
var
viewModel
=
new
CartListingViewModel
();
initializeViewModel
(
viewModel
);
viewModel
.
setTitle
(
"Cart"
);
var
cart
=
cartService
.
loadFromCookie
();
var
cartItems
=
cart
.
getCartItems
().
entrySet
().
stream
()
.
map
(
x
->
CartItemViewModel
.
builder
()
...
...
winery/webapp/src/main/java/cz/muni/fi/pa165/winery/webapp/controllers/MyOrderController.java
View file @
a27bee5d
...
...
@@ -25,6 +25,8 @@ public class MyOrderController extends ControllerBase {
var
viewModel
=
new
OrderListingViewModel
();
initializeViewModel
(
viewModel
);
viewModel
.
setTitle
(
"My orders"
);
viewModel
.
setOrders
(
orders
);
return
view
(
viewModel
);
...
...
winery/webapp/src/main/java/cz/muni/fi/pa165/winery/webapp/controllers/OrderController.java
View file @
a27bee5d
...
...
@@ -51,6 +51,7 @@ public class OrderController extends ControllerBase {
var
viewModel
=
new
OrdersListingViewModel
();
initializeViewModel
(
viewModel
);
viewModel
.
setTitle
(
"Orders"
);
viewModel
.
setOrders
(
orders
);
viewModel
.
setUserLookup
(
users
);
...
...
winery/webapp/src/main/resources/static/js/scripts.js
View file @
a27bee5d
...
...
@@ -27,10 +27,8 @@ function checkout() {
{
method
:
'
POST
'
}).
then
((
res
)
=>
{
if
(
res
.
status
==
410
)
{
document
.
getElementById
(
"
failure-alert
"
).
style
.
display
=
"
block
"
;
document
.
getElementById
(
"
success-alert
"
).
style
.
display
=
"
none
"
;
}
else
{
document
.
getElementById
(
"
success-alert
"
).
style
.
display
=
"
block
"
;
document
.
getElementById
(
"
failure-alert
"
).
style
.
display
=
"
none
"
;
window
.
location
.
replace
(
`
${
getUrlPrefix
()}
myorder`
);
}
});
}
...
...
winery/webapp/src/main/resources/templates/cart/index.html
View file @
a27bee5d
...
...
@@ -9,13 +9,7 @@
<div
class=
"container px-4 px-lg-5"
>
<main
role=
"main"
class=
"pb-3"
>
<h4>
Cart contents:
</h4>
<div
style=
"display: none;"
id=
"success-alert"
>
<div
class=
"alert alert-success mt-2"
role=
"alert"
>
The order was sent successfully!
</div>
</div>
<h2>
Shopping cart
</h2>
<div
style=
"display: none;"
id=
"failure-alert"
>
<div
class=
"alert alert-danger mt-2"
role=
"alert"
>
...
...
@@ -38,7 +32,9 @@
</tbody>
</table>
<a
class=
"btn btn-primary"
href=
"#"
onclick=
"checkout()"
>
Checkout
</a>
<h5
style=
"text-align: center"
th:if=
"${model.cart.empty}"
>
Empty
</h5>
<a
th:unless=
"${model.cart.empty}"
class=
"btn btn-primary"
href=
"#"
onclick=
"checkout()"
>
Checkout
</a>
</main>
</div>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment