{% 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="discount-profiles", lang=lang | default(value='sk')) }}

{% if profiles | length > 0 %}
{{ ui::csrf_field() }}
{% for profile in profiles %} {% endfor %}
{{ ui::button(label=t(key="save", lang=lang | default(value='sk')), type="submit", size="px-4 py-2 text-sm") }}
{% else %}

{{ t(key="admin-no-profiles", lang=lang | default(value='sk')) }} {{ t(key="new-profile", 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="business-price", lang=lang | default(value='sk'))) }} {{ ui::th(label=t(key="effective-price", lang=lang | default(value='sk'))) }} {{ ui::th(label=t(key="actions", lang=lang | default(value='sk')), align="text-right") }} {% for product in products %} {% endfor %}
{{ product.name }} {% if product.business_reduced %} {{ product.business_price }} {{ product.currency }} {{ product.regular_price }} {% else %} {{ product.business_price }} {{ product.currency }} {% endif %} {{ product.effective_price }} {{ product.currency }} {% if product.collision %}{{ ui::badge(label=t(key="collision", lang=lang | default(value='sk')), variant="warning") }}{% endif %}
{{ ui::button(variant="outline-secondary", label=t(key="set-negotiated-price", lang=lang | default(value='sk')), href="/admin/customers/" ~ customer.id ~ "/prices/" ~ product.product_id ~ "/edit", size="px-3 py-1.5 text-xs") }} {% if product.has_negotiated %}
{{ ui::csrf_field() }} {{ ui::button(variant="outline-danger", label=t(key="remove", lang=lang | default(value='sk')), type="submit", size="px-3 py-1.5 text-xs") }}
{% endif %}
{% else %}

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

{% endif %}
{% endblock content %}