From 428baa749c9d1601f9822b1358c092cef24f4318 Mon Sep 17 00:00:00 2001 From: thisfro Date: Thu, 13 May 2021 12:11:02 +0200 Subject: [PATCH] create a public user page --- assets/styles/app.scss | 10 +++- public/placeholder.jpg | Bin 0 -> 35179 bytes src/Controller/UserController.php | 7 +-- templates/offer/index.html.twig | 26 ++++++---- templates/user/public.html.twig | 63 +++++++++++++++++++++++ templates/user/public_wishlist.html.twig | 29 ----------- 6 files changed, 92 insertions(+), 43 deletions(-) create mode 100644 public/placeholder.jpg create mode 100644 templates/user/public.html.twig delete mode 100644 templates/user/public_wishlist.html.twig 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 0000000000000000000000000000000000000000..a09c840dadf544b3e4e763aeb6b89f8171269bf2 GIT binary patch literal 35179 zcmeI(do)!09suy)n3u;$WGYf73Mm}#2xACwPsby#(&KQ7Mo)%>TBAA?6;YlkB6(9$ zLh9o55*ekA^dfmylJQ99aYl)Iy7!NJ&RTcfw7z@Rcjh;H_UyI4zx`SJyMMp6HouAA zf~MP8T3aFv1|f{#h4?(Q%-q3(=4k6+Nb%aJ=Dl;17iE{G`VSNpe+GTK7scAfieh7D zVMW=cr?qGa#mC=$E8Q=UVocH373Duc=17=8AQJGxL?Tf{L|Bw0Elv^>Bgsh3kdU4$ zD?e|ptehNWfx0q9VTq!goQnRUB|m8D=;+8R8yGLuGE&#p(Hh$cMnpt}Bu1JoEc{NIqgAW1yt(}Knqj1U%wClG~2M8yOfT$+xA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E6m z#9T;c=EQSb*Tlw;H%^S7R?nXJYYqvD)MXM0kyRn8JptDkBbq7CvR_4Z6m_MA$V(TJ zau;}!rZLu$^J~_b&E2iIzoN3h``o3{;MKn#zTI`ViA7v#p|!|ib8MS|gVv$}v}$3r zd-$n)WJ~(sfvo3y(>AC{^fvN5Lv-`i<9gLv-1k*$WVjZ1-fz$MlA2~^IWMhjxqmd7 z)$Y1c7WqSg{oZdD{&Inhq&o;7iIGE8ZPV$`pXKKn^t`Q#3hGQuY$}p+O^yj}jMtZ7 zXhx6r5#8TMGJP8m@laJ&%b7@5ZtY5^G0|l zFlWXO?8^bd=jRjkt@ZwIkd-%FEd>9O~`7e!O8PB!w0vW9oJHWv!o+ zy(^o0|1>dsFxN1nm$5^pWp6(kna#iLq>%+r$VYRs852uH*H0qK$dRhW(2jk6D*5p|yAxFt7RWbm&%H*)A!wu=9S`T=EDWhF1BGtlA z{&8FiTQJ6XVHx%2uI)$%^If{B9GA>udahyCYxB`wS!$6QwNo&ObL}W%47kv^iFCm% zdp&pH|G$3%$>(Z;lrender('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 %} {% 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 %} +
    + {% for wish in wishes %} +
  • {{ wish.title }}
  • + {% endfor %} +
+ {% endif %} +
+
+
+

{{ username }}'s Offers

+
+ + {% if offers|length > 0 %} + + {% 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 %} -
    - {% for wish in wishes %} -
  • {{ wish.title }}
  • - {% endfor %} -
- {% endif %} -
-{% endblock %} \ No newline at end of file