feat: интерактивный установщик install.sh (Docker / Ubuntu, админ, БД)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+68
-6
@@ -3,6 +3,8 @@
|
||||
<h1>Корзина</h1>
|
||||
|
||||
<% if (error) { %><p class="alert alert--error"><%= error %></p><% } %>
|
||||
<% if (promoOk) { %><p class="alert alert--success"><%= promoOk %></p><% } %>
|
||||
<% if (promoErr) { %><p class="alert alert--error"><%= promoErr %></p><% } %>
|
||||
|
||||
<% if (!items.length) { %>
|
||||
<p class="empty">Корзина пуста. <a href="/">Перейти в каталог</a></p>
|
||||
@@ -39,16 +41,76 @@
|
||||
<% }) %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="cart-actions">
|
||||
<button type="submit" class="btn btn--ghost">Обновить</button>
|
||||
<p class="cart-total">Итого: <strong><%= formatPrice(total) %></strong></p>
|
||||
|
||||
<div class="cart-sidebar">
|
||||
<section class="card promo-box">
|
||||
<h2 class="promo-box__title">Промокод</h2>
|
||||
<% if (pricing.promo) { %>
|
||||
<p class="promo-box__applied">
|
||||
<strong><%= pricing.promo.code %></strong>
|
||||
<% if (pricing.promo.description) { %> — <%= pricing.promo.description %><% } %>
|
||||
</p>
|
||||
<p class="promo-box__discount">Скидка: −<%= formatPrice(pricing.promoDiscount) %></p>
|
||||
<div class="promo-countdown" data-expires="<%= pricing.promo.expires_at %>">
|
||||
<span class="promo-countdown__label">До конца акции:</span>
|
||||
<span class="promo-countdown__timer">—</span>
|
||||
</div>
|
||||
<form action="/cart/promo/remove" method="post" class="inline-form">
|
||||
<button type="submit" class="btn btn--ghost btn--sm">Убрать промокод</button>
|
||||
</form>
|
||||
<% } else { %>
|
||||
<form action="/cart/promo" method="post" class="promo-box__form">
|
||||
<input type="text" name="code" class="input" placeholder="WELCOME10" required autocomplete="off">
|
||||
<button type="submit" class="btn btn--primary">Применить</button>
|
||||
</form>
|
||||
<% } %>
|
||||
</section>
|
||||
|
||||
<% if (user) { %>
|
||||
<a href="/checkout" class="btn btn--primary btn--lg">Оформить заказ</a>
|
||||
<% } else { %>
|
||||
<p class="hint"><a href="/login?next=/checkout">Войдите</a>, чтобы оформить заказ.</p>
|
||||
<section class="card promo-box">
|
||||
<h2 class="promo-box__title">Баллы лояльности</h2>
|
||||
<p class="muted">На счёте: <strong><%= pricing.loyaltyBalance %></strong> баллов (1 балл = 1 коп.)</p>
|
||||
<% if (pricing.pointsEarned > 0) { %>
|
||||
<p class="muted">За этот заказ начислим: +<%= pricing.pointsEarned %> баллов</p>
|
||||
<% } %>
|
||||
<% if (pricing.loyaltyDiscount > 0) { %>
|
||||
<p class="promo-box__discount">Списано: −<%= formatPrice(pricing.loyaltyDiscount) %> (<%= pricing.loyaltyPointsUsed %> баллов)</p>
|
||||
<form action="/cart/loyalty/remove" method="post">
|
||||
<button type="submit" class="btn btn--ghost btn--sm">Отменить списание</button>
|
||||
</form>
|
||||
<% } else if (pricing.loyaltyBalance > 0) { %>
|
||||
<form action="/cart/loyalty" method="post" class="promo-box__form">
|
||||
<button type="submit" name="use_all" value="1" class="btn btn--ghost">Списать все доступные</button>
|
||||
</form>
|
||||
<% } %>
|
||||
</section>
|
||||
<% } %>
|
||||
|
||||
<section class="card cart-summary">
|
||||
<dl class="cart-summary__dl">
|
||||
<dt>Товары</dt>
|
||||
<dd><%= formatPrice(pricing.subtotal) %></dd>
|
||||
<% if (pricing.promoDiscount > 0) { %>
|
||||
<dt>Промокод</dt>
|
||||
<dd class="cart-summary__discount">−<%= formatPrice(pricing.promoDiscount) %></dd>
|
||||
<% } %>
|
||||
<% if (pricing.loyaltyDiscount > 0) { %>
|
||||
<dt>Лояльность</dt>
|
||||
<dd class="cart-summary__discount">−<%= formatPrice(pricing.loyaltyDiscount) %></dd>
|
||||
<% } %>
|
||||
<dt class="cart-summary__total-label">К оплате</dt>
|
||||
<dd class="cart-summary__total"><%= formatPrice(pricing.total) %></dd>
|
||||
</dl>
|
||||
<% if (user) { %>
|
||||
<a href="/checkout" class="btn btn--primary btn--lg btn--block">Оформить заказ</a>
|
||||
<% } else { %>
|
||||
<p class="hint"><a href="/login?next=/checkout">Войдите</a>, чтобы оформить заказ.</p>
|
||||
<% } %>
|
||||
</section>
|
||||
</div>
|
||||
</form>
|
||||
<% } %>
|
||||
|
||||
<script src="/js/promo-countdown.js"></script>
|
||||
|
||||
<%- include('partials/layout-end') %>
|
||||
|
||||
Reference in New Issue
Block a user