diff --git a/assets/styles/app.scss b/assets/styles/app.scss index 1ab551f..5a57bef 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -6,7 +6,7 @@ $primary: darken(#005035, 20%); // the ~ allows you to reference things in node_modules @import "~bootstrap/scss/bootstrap"; -.offer > img { +.offer-img { height: 15rem; object-fit: cover; } @@ -40,4 +40,12 @@ $primary: darken(#005035, 20%); .offer-footer { color: #555; +} + +.user-link { + color: #555; +} + +.user-link:hover { + color: #000; } \ No newline at end of file diff --git a/public/placeholder.jpg b/public/placeholder.jpg new file mode 100644 index 0000000..a09c840 Binary files /dev/null and b/public/placeholder.jpg differ diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 5f44c1b..604b361 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -52,12 +52,13 @@ class UserController extends AbstractController ]); } - #[Route('/user/{id}', name: 'public_wishlist')] - public function show_user(User $user, WishRepository $wishRepository): Response + #[Route('/user/{id}', name: 'user_public')] + public function show_user(User $user, OfferingRepository $offeringRepository, WishRepository $wishRepository): Response { - return $this->render('user/public_wishlist.html.twig', [ + return $this->render('user/public.html.twig', [ 'username' => $user->getUsername(), 'wishes' => $wishRepository->findByUser($user), + 'offers' => $offeringRepository->findByUser($user), ]); } diff --git a/templates/offer/index.html.twig b/templates/offer/index.html.twig index b1a32c6..33d624d 100644 --- a/templates/offer/index.html.twig +++ b/templates/offer/index.html.twig @@ -12,21 +12,27 @@ {% if offers|length > 0 %}
{% for offer in offers %} - +
- +
{% endfor %}
{% else %} diff --git a/templates/user/public.html.twig b/templates/user/public.html.twig new file mode 100644 index 0000000..9a1e7a0 --- /dev/null +++ b/templates/user/public.html.twig @@ -0,0 +1,63 @@ +{% extends 'base.html.twig' %} + +{% block title %}Whishlist{% endblock %} + +{% block body %} + {% for message in app.flashes('success') %} + + {% endfor %} + +
+

{{ username }}'s Wishlist

+
+ +
+ {% if wishes == [] %} + + {% else %} + + {% endif %} +
+
+
+

{{ username }}'s Offers

+
+ + {% if offers|length > 0 %} +
+ {% for offer in offers %} +
+ +
+ {% endfor %} +
+ {% else %} + + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/user/public_wishlist.html.twig b/templates/user/public_wishlist.html.twig deleted file mode 100644 index 1237d1e..0000000 --- a/templates/user/public_wishlist.html.twig +++ /dev/null @@ -1,29 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Whishlist{% endblock %} - -{% block body %} - {% for message in app.flashes('success') %} - - {% endfor %} - -
-

{{ username }}'s' Wishlist

-
- -
- {% if wishes == [] %} - - {% else %} - - {% endif %} -
-{% endblock %} \ No newline at end of file