{% macro digitalmarketplaceLotDividerRow(params) %}
{#- Normalise the number once, so the derived text below can never read "for lot undefined" to a screen reader. The null guard is load-bearing: a lot number can arrive null from an API and `| string` throws on null, which would take the whole page down. `| string` itself is what keeps a literal 0 truthy. -#} {%- set lotNumber = ("" if params.number is none else params.number) | default("") | string %} {%- set visuallyHiddenPrefix = params.visuallyHiddenPrefix | default("Lot") %} {%- set derivedActionText = ("for lot " ~ lotNumber) if lotNumber else "" %} {% if visuallyHiddenPrefix and lotNumber %}{{ visuallyHiddenPrefix }} {% endif %}{{ lotNumber }} {%- if params.actions | length %} {%- for action in params.actions %} {%- set actionVisuallyHiddenText = action.visuallyHiddenText | default(derivedActionText) %} {{ action.text }}{% if actionVisuallyHiddenText %} {{ actionVisuallyHiddenText }}{% endif %} {%- endfor %} {%- endif %}
{% endmacro %}