From e2c78385d0b4b7dbfa5135c44b6a844e59c77af4 Mon Sep 17 00:00:00 2001 From: Firas <firas.bouzazi@imt-atlantique.net> Date: Wed, 26 Mar 2025 01:26:50 +0100 Subject: [PATCH] minor changes --- templates/wishlist/index.html.twig | 45 ++++++++++++++++++++---------- templates/wishlist/new.html.twig | 5 ++-- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/templates/wishlist/index.html.twig b/templates/wishlist/index.html.twig index af98d2ce..72227a94 100644 --- a/templates/wishlist/index.html.twig +++ b/templates/wishlist/index.html.twig @@ -1,6 +1,6 @@ {% extends 'base.html.twig' %} -{% block title %} My Wishlists {% endblock %} +{% block title %}My Wishlists{% endblock %} {% block body %} <style> @@ -71,6 +71,11 @@ border-radius: 5px; font-size: 1.5em; } + .wishlist-footer { + margin-top: 10px; + font-size: 0.9em; + color: #e0f7fa; + } .wishlist-actions { display: flex; gap: 10px; @@ -106,19 +111,31 @@ <div class="container"> {% for wishlist in wishlists %} - <div class="wishlist"> - <h2>{{ wishlist.name }}</h2> - <div class="wishlist-items"> - {% for item in wishlist.items %} - <div class="wishlist-item">📷</div> - {% endfor %} - </div> - <div class="wishlist-actions"> - <button title="Share wishlist">↗</button> - <button title="Edit title">✏</button> - <button title="Delete wishlist">🗑</button> + <div class="wishlist"> + <h2> + <a href="{{ path('app_wishlist_show', { 'id': wishlist.id }) }}"> + {{ wishlist.name }} + </a> + </h2> + + <div class="wishlist-items"> + {% for item in wishlist.items %} + <div class="wishlist-item">📷</div> + {% else %} + <p class="empty-state">No items yet.</p> + {% endfor %} + </div> + + <p class="wishlist-footer">{{ wishlist.deadline ? wishlist.deadline|date('Y-m-d') : 'No deadline' }}</p> + + <div class="wishlist-actions"> + <button title="Share wishlist">↗</button> + <button title="Edit title">✏</button> + <button title="Delete wishlist">🗑</button> + </div> </div> - </div> + {% else %} + <p>You have no wishlists yet. Start by <a href="{{ path('app_wishlist_new') }}">creating one</a>.</p> {% endfor %} </div> -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/templates/wishlist/new.html.twig b/templates/wishlist/new.html.twig index db732bbc..4f84df8e 100644 --- a/templates/wishlist/new.html.twig +++ b/templates/wishlist/new.html.twig @@ -1,3 +1,4 @@ +{# templates/wishlist/new.html.twig #} {% extends 'base.html.twig' %} {% block title %}Create New Wishlist{% endblock %} @@ -99,7 +100,7 @@ {% block body %} <div class="container"> <h1 class="my-4">Create New Wishlist</h1> - + {{ form_start(form, {'attr': {'class': 'wishlist-form'}}) }} <div class="form-group"> {{ form_label(form.name) }} @@ -128,4 +129,4 @@ </div> {{ form_end(form) }} </div> -{% endblock %} +{% endblock %} \ No newline at end of file -- GitLab