Skip to content
Snippets Groups Projects
Commit e60d88b2 authored by Zahdi's avatar Zahdi
Browse files

[Progress] adding the main template for the wishlists

parent e6521288
No related branches found
No related tags found
No related merge requests found
......@@ -8,4 +8,5 @@ var/
vendor/
docker/
.idea/
migrations/
\ No newline at end of file
migrations/
public/uploads
\ No newline at end of file
uploads/
\ No newline at end of file
......@@ -167,3 +167,124 @@ h1 a {
background-color: #0099B8;
}
* {
box-sizing: border-box;
font-family: Helvetica, Arial, sans-serif;
}
body {
margin: 0;
background: #f4f4f4;
}
header {
display: flex;
align-items: center;
background: #00B8DE;
color: white;
padding: 10px;
gap: 15px;
}
.user-icon {
width: 40px;
height: 40px;
background: #ccc;
border-radius: 50%;
}
h1 {
margin: 0;
font-size: 18px;
font-weight: bold;
}
.search-bar {
margin-left: auto;
padding: 5px;
border-radius: 5px;
border: none;
}
.navbar {
background: white;
padding: 10px;
display: flex;
justify-content: center;
border-bottom: 2px solid #ccc;
}
.add-wishlist-btn {
padding: 8px 15px;
background: #00B8DE;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.add-wishlist-btn:hover {
background: #0099B8;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 20px;
margin-top: 20px;
}
.wishlist {
background: white;
border: 2px solid #99CC33;
border-radius: 10px;
padding: 15px;
width: 50%;
position: relative;
}
.wishlist h2 {
margin: 0;
font-size: 16px;
color: blue;
cursor: pointer;
}
.wishlist-items {
display: flex;
gap: 10px;
margin-top: 10px;
}
.wishlist-item {
width: 50px;
height: 50px;
background: #ddd;
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
}
.wishlist-footer {
margin-top: 10px;
font-size: 12px;
}
.wishlist-actions {
position: absolute;
top: 10px;
right: 10px;
display: flex;
gap: 5px;
}
.wishlist-actions button {
background: white;
border: 1px solid black;
border-radius: 3px;
padding: 5px;
cursor: pointer;
}
\ No newline at end of file
......@@ -61,7 +61,12 @@ final class WishlistController extends AbstractController
#[Route('/{id}/edit', name: 'app_wishlist_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Wishlist $wishlist, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(WishlistType::class, $wishlist);
$wishlist->setName($request->get('name'));
$wishlist->setDeadline($request->get('deadline')) ;
$entityManager->persist($wishlist);
$entityManager->flush();
return new Response('wishlist was modified successfully ', Response::HTTP_ACCEPTED) ;
/* $form = $this->createForm(WishlistType::class, $wishlist);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
......@@ -73,7 +78,7 @@ final class WishlistController extends AbstractController
return $this->render('wishlist/edit.html.twig', [
'wishlist' => $wishlist,
'form' => $form,
]);
]); */
}
#[Route('/{id}', name: 'app_wishlist_delete', methods: ['POST'])]
......@@ -86,4 +91,6 @@ final class WishlistController extends AbstractController
return $this->redirectToRoute('app_wishlist_index', [], Response::HTTP_SEE_OTHER);
}
}
{% extends 'base.html.twig' %}
{% block title %}Wishlist index{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<h1>Wishlist index</h1>
{% block title %} My Wishlists {% endblock %}
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Deadline</th>
<th>IsDisabled</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for wishlist in wishlists %}
<tr>
<td>{{ wishlist.id }}</td>
<td>{{ wishlist.name }}</td>
<td>{{ wishlist.deadline ? wishlist.deadline|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ wishlist.isDisabled ? 'Yes' : 'No' }}</td>
<td>
<a href="{{ path('app_wishlist_show', {'id': wishlist.id}) }}">show</a>
<a href="{{ path('app_wishlist_edit', {'id': wishlist.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_wishlist_new') }}">Create new</a>
{% endblock %}
{% block body %}
<header>
<div class="user-icon"></div>
<h1>My Wishlists</h1>
<input type="text" class="search-bar" placeholder="Search...">
</header>
<div class="navbar">
<button class="add-wishlist-btn">Add wishlist</button>
</div>
<div class="container">
<div class="wishlist">
<h2>wish list 1 title</h2>
<div class="wishlist-items">
<div class="wishlist-item">📷</div>
<div class="wishlist-item">📷</div>
<div class="wishlist-item">📷</div>
</div>
<p class="wishlist-footer">Authors: name1, name2</p>
<div class="wishlist-actions">
<button title="Share wishlist"></button>
<button title="Edit title"></button>
<button title="Delete wishlist">🗑</button>
</div>
</div>
<div class="wishlist">
<h2>wish list 2 title</h2>
<div class="wishlist-items">
<div class="wishlist-item">📷</div>
<div class="wishlist-item">📷</div>
<div class="wishlist-item">📷</div>
</div>
<p class="wishlist-footer">Authors: name1</p>
<div class="wishlist-actions">
<button title="Share wishlist"></button>
<button title="Edit title"></button>
<button title="Delete wishlist">🗑</button>
</div>
</div>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment