diff --git a/public/css/style.css b/public/css/style.css index a31b23f2ad3ceab1f91774fdcee8db1f5121215a..f6ed8fd9b3d9ed086dc8f9c86093b27b95f1951d 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -47,12 +47,14 @@ h1 a { margin: 20px; } + .info-text { - color: red; + color: #f4f4f4; font-size: 14px; max-width: 150px; + text-align: center; /* Center the text horizontally */ + width: 100%; /* Ensure it can take the full width of the container for centering */ } - .form-section { background: white; padding: 20px; diff --git a/src/Entity/Invitation.php b/src/Entity/Invitation.php index 9bc4384c1a2525d8b64713fc5c995750e7bbdf0d..49ae991da3a87cd4b39c4b9337fba3cea5a3c69c 100644 --- a/src/Entity/Invitation.php +++ b/src/Entity/Invitation.php @@ -17,11 +17,11 @@ class Invitation - #[ORM\OneToOne(cascade: ['persist', 'remove'])] + #[ORM\ManyToOne(cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] private ?Wishlist $wishlist = null; - #[ORM\OneToOne(cascade: ['persist', 'remove'])] + #[ORM\ManyToOne(cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] private ?User $inviter = null; diff --git a/templates/invitation/index.html.twig b/templates/invitation/index.html.twig index ecdf40990c6069d3aac40cda8ec57ba83ad0b616..3054e1e9a4561a1358a37f1dee96fce0808fb19d 100644 --- a/templates/invitation/index.html.twig +++ b/templates/invitation/index.html.twig @@ -3,6 +3,18 @@ {% block title %}Wishlist Invitations{% endblock %} {% block body %} + +<style> + +.info-text { + color: #f4f4f4; + font-size: 14px; + max-width: 150px; + text-align: center; + width: 100%; +} +</style> + <header> <div class="user-icon"></div> <h1><a href="#">Wishlist Invitations</a></h1> @@ -39,9 +51,4 @@ {% endif %} </div> - <div class="navbar"> - <button class="add-wishlist-btn"> - <a href="{{ path('app_invitation_new') }}" style="color: white; text-decoration: none;">Create new invitation</a> - </button> - </div> {% endblock %} \ No newline at end of file diff --git a/templates/wishlist/edit.html.twig b/templates/wishlist/edit.html.twig index 0002ccaa795a79cfb04a1148106c107e5323d27e..198acf1a93fdc685e3959d44ece44c2a64c35db4 100644 --- a/templates/wishlist/edit.html.twig +++ b/templates/wishlist/edit.html.twig @@ -2,12 +2,119 @@ {% block title %}Edit Wishlist{% endblock %} -{% block body %} - <h1>Edit Wishlist</h1> +{% block stylesheets %} + {{ parent() }} + <style> + body { + font-family: Arial, sans-serif; + background: linear-gradient(135deg, #00B8DE, #99CC33) fixed; + color: white; + text-align: center; + padding: 20px; + } + .container { + max-width: 800px; + margin: auto; + } + .wishlist-form { + max-width: 600px; + margin: 0 auto; + padding: 20px; + background: rgba(255, 255, 255, 0.2); + border-radius: 10px; + border: 2px solid #99CC33; + box-shadow: 0 4px 8px rgba(0,0,0,0.2); + backdrop-filter: blur(10px); + } + .form-group { + margin-bottom: 1.5rem; + text-align: left; + } + .form-label { + display: block; + margin-bottom: 0.5rem; + font-weight: bold; + } + .form-control { + width: 100%; + padding: 0.5rem; + border: 2px solid #99CC33; + border-radius: 4px; + font-size: 1rem; + } + .form-check { + display: flex; + align-items: center; + margin-top: 1rem; + } + .form-check-input { + margin-right: 0.5rem; + } + .btn { + padding: 0.5rem 1rem; + border-radius: 4px; + cursor: pointer; + font-size: 1rem; + } + .btn-primary { + background-color: white; + color: #00B8DE; + border: 2px solid #00B8DE; + transition: 0.3s; + } + .btn-primary:hover { + background-color: #99CC33; + color: white; + border-color: #99CC33; + } + .btn-secondary { + background-color: white; + color: #99CC33; + border: 2px solid #99CC33; + transition: 0.3s; + } + .btn-secondary:hover { + background-color: #00B8DE; + color: white; + border-color: #00B8DE; + } + .form-help { + font-size: 0.8rem; + color: #e0e0e0; + margin-top: 0.25rem; + } + .error-message { + color: #dc3545; + font-size: 0.875rem; + margin-top: 0.25rem; + } + @media (max-width: 768px) { + .wishlist-form { + width: 90%; + } + } + .delete-form { + display: inline-block; + margin-left: 10px; + } + </style> +{% endblock %} - {{ include('wishlist/_form.html.twig', {'button_label': 'Update'}) }} +{% block body %} + <div class="container"> + <h1 class="my-4">Edit Wishlist</h1> - <a href="{{ path('app_wishlist_index') }}">back to list</a> + {{ include('wishlist/_form.html.twig', { + 'button_label': 'Update', + 'form': form, + 'attr': {'class': 'wishlist-form'} + }) }} - {{ include('wishlist/_delete_form.html.twig') }} -{% endblock %} + <div class="form-group mt-4"> + <a href="{{ path('app_wishlist_index') }}" class="btn btn-secondary">Back to list</a> + <div class="delete-form"> + {{ include('wishlist/_delete_form.html.twig') }} + </div> + </div> + </div> +{% endblock %} \ No newline at end of file diff --git a/templates/wishlist/index.html.twig b/templates/wishlist/index.html.twig index 62fa85990a0a4b309dd38d329823ff55014f8543..cc841372fa2ac7cc22dfc968a2c7da167be42a34 100644 --- a/templates/wishlist/index.html.twig +++ b/templates/wishlist/index.html.twig @@ -58,8 +58,8 @@ <!-- Share Button --> <button type="button" class="share-btn" data-wishlist-id="{{ wishlist.id }}">↗</button> - <button title="Edit title">✏</button> - <button title="Delete wishlist">🗑</button> + <button title="Edit title"><a href="{{ path('app_wishlist_edit', { 'id': wishlist.id }) }}">✏</a></button> + <button title="Delete wishlist"> <a href="{{path('app_wishlist_delete', {'id':wishlist.id} ) }}">🗑</a> </button> </div> {% endfor %} </div>