{% extends "admin/base.html" %} {% import "macros/ui.html" as ui %} {% block title %}{{ customer.name }}{% endblock title %} {% block crumb %}{{ t(key="admin-customers", lang=lang | default(value='sk')) }}{% endblock crumb %} {% block content %}

{{ customer.name }}

{{ customer.email }}

{{ ui::button(variant="outline-secondary", label=t(key="back", lang=lang | default(value='sk')), href="/admin/customers", size="px-3 py-2 text-sm") }}
{% if error %}
{{ ui::alert_danger(message=t(key=error, lang=lang | default(value='sk'))) }}
{% endif %}

{{ t(key="negotiated-prices-hint", lang=lang | default(value='sk')) }}

{% if products | length > 0 %} {{ ui::th(label=t(key="product", lang=lang | default(value='sk'))) }} {{ ui::th(label=t(key="public-price", lang=lang | default(value='sk'))) }} {{ ui::th(label=t(key="negotiated-price", lang=lang | default(value='sk'))) }} {{ ui::th(label=t(key="effective-price", lang=lang | default(value='sk')), align="text-right") }} {% for product in products %} {% endfor %}
{{ product.name }} {% if product.on_public_sale %} {{ product.public_price }} {{ product.currency }} {{ product.regular_price }} {% else %} {{ product.public_price }} {{ product.currency }} {% endif %}
{{ ui::csrf_field() }} {{ ui::input(name="price", value=product.manual_price | default(value=""), placeholder="0.00", width="w-28", attrs='inputmode="decimal"') }} {{ ui::button(label=t(key="save", lang=lang | default(value='sk')), type="submit", size="px-3 py-1.5 text-xs") }} {% if product.manual_price %} {{ ui::button(variant="outline-danger", label=t(key="remove", lang=lang | default(value='sk')), type="submit", size="px-3 py-1.5 text-xs", attrs='formaction="/admin/customers/' ~ customer.id ~ '/prices/' ~ product.product_id ~ '/remove"') }} {% endif %}
{{ product.effective_price }} {{ product.currency }}
{% else %}

{{ t(key="admin-no-products", lang=lang | default(value='sk')) }}

{% endif %}
{% endblock content %}