feat: бронирование товаров и сброс пароля по email

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
shop
2026-05-17 11:38:52 +03:00
parent bda73e1662
commit ade031b0e7
22 changed files with 666 additions and 3 deletions
+40
View File
@@ -10,6 +10,7 @@
<a href="/account?tab=profile" class="account-tabs__link <%= activeTab === 'profile' ? 'account-tabs__link--active' : '' %>">Профиль</a>
<a href="/account?tab=email" class="account-tabs__link <%= activeTab === 'email' ? 'account-tabs__link--active' : '' %>">Смена email</a>
<a href="/account?tab=password" class="account-tabs__link <%= activeTab === 'password' ? 'account-tabs__link--active' : '' %>">Смена пароля</a>
<a href="/account?tab=reservations" class="account-tabs__link <%= activeTab === 'reservations' ? 'account-tabs__link--active' : '' %>">Бронирования</a>
</nav>
<% if (activeTab === 'profile') { %>
@@ -62,6 +63,45 @@
</section>
<% } %>
<% if (activeTab === 'reservations') { %>
<section class="card account-section">
<h2>Мои бронирования</h2>
<% if (!reservations.length) { %>
<p class="muted">Активных броней нет.</p>
<% } else { %>
<table class="cart-table">
<thead>
<tr>
<th>Товар</th>
<th>Кол-во</th>
<th>Статус</th>
<th>До</th>
<th></th>
</tr>
</thead>
<tbody>
<% const resStatus = { active: 'Активна', fulfilled: 'Выполнена', cancelled: 'Отменена', expired: 'Истекла' }; %>
<% reservations.forEach(r => { %>
<tr>
<td><a href="/product/<%= r.product_slug %>"><%= r.product_name %></a></td>
<td><%= r.quantity %></td>
<td><span class="status status--<%= r.status === 'active' ? 'pending' : r.status %>"><%= resStatus[r.status] || r.status %></span></td>
<td><%= r.status === 'active' ? new Date(r.expires_at).toLocaleString('ru-RU') : '—' %></td>
<td>
<% if (r.status === 'active') { %>
<form action="/reservations/<%= r.id %>/cancel" method="post" class="inline-form">
<button type="submit" class="btn btn--ghost btn--sm">Отменить</button>
</form>
<% } %>
</td>
</tr>
<% }) %>
</tbody>
</table>
<% } %>
</section>
<% } %>
<% if (activeTab === 'password') { %>
<section class="card account-section account-section--narrow">
<h2>Смена пароля</h2>