save discount profile is now working perfectly well
This commit is contained in:
@@ -122,6 +122,21 @@
|
||||
{%- endif %}
|
||||
{%- endmacro badge %}
|
||||
|
||||
{# Effective-price cell content for the admin products table. The value is
|
||||
colored only when it differs from the regular price (effective_reduced);
|
||||
when equal it renders in the plain text color, unified with the Price column.
|
||||
`preview=true` uses the info color (an unsaved profile-toggle preview) instead
|
||||
of the saved primary color. No t() calls, so it is safe inside a macro. #}
|
||||
{% macro eff_price(p, preview=false) -%}
|
||||
{%- if preview -%}{% set strong = "text-info" %}{%- else -%}{% set strong = "text-primary dark:text-primary-dark" %}{%- endif -%}
|
||||
{% if p.effective_reduced %}
|
||||
<span class="font-medium {{ strong }}">{{ p.effective_price }} {{ p.currency }}</span>
|
||||
<span class="ml-1 text-xs text-on-surface/60 dark:text-on-surface-dark/60">(−{{ p.effective_percent_off }}%)</span>
|
||||
{% else %}
|
||||
{{ p.effective_price }} {{ p.currency }}
|
||||
{% endif %}
|
||||
{%- endmacro eff_price %}
|
||||
|
||||
{# ---- Form controls. Verbatim Penguin classes from
|
||||
penguinui/{text-input,text-area,select,checkbox,file-input}/default-*.html.
|
||||
These macros emit only the control (callers keep their own <label>/layout), so
|
||||
|
||||
Reference in New Issue
Block a user