{#
/**
 * @file
 * Theme implementation for a view template to display a list of rows.
 *
 * Applies to the *Step by step* View's "Prev/Next block" display only.
 * Changes include:
 * - Display only *two* list items at most: One for the previous step node and
 *   another for the next step node.
 * - Instead of the Step title, display Prev or Next.
 * - On the very first step, use "Start" instead of "Next".
 * - Apply the "step--next" and "step--prev" classes on appropriate list items.
 *
 * Available variables:
 * - attributes: HTML attributes for the container.
 * - rows: A list of rows for this list.
 *   - attributes: The row's HTML attributes.
 *   - content: The row's contents.
 * - view: The view object.
 * - title: The title of this group of rows. May be empty.
 * - list: @todo.
 *   - type: Starting tag will be either a ul or ol.
 *   - attributes: HTML attributes for the list element.
 * - has_prev_step: Have we got a previous step node?
 * - has_next_step: Have we got a ntext step node?
 * - prev_step_nid: Node Id of the previous node, if any.
 * - next_step_nid: Node Id of the next node, if any.
 * - prev_step_index: Array index of the previous node, if any.
 * - next_step_index: Array index of the next node, if any.
 * - prev_step_link_text: Prev
 * - next_step_link_text: Start|Next
 *
 * @see template_preprocess_views_view_list()
 *
 * @ingroup themeable
 */
#}

{% set nav_id = 'step-by-step-prev-next-' ~ random() %}
{% set prevNextAttributes = create_attribute({ id: nav_id }) %}
{% set prev_next_type = 'step_by_step' %}
{% set prev_url = has_prev_step ? path('entity.node.canonical', {'node': prev_step_nid }) : '' %}
{% set next_url = has_next_step ? path('entity.node.canonical', {'node': next_step_nid }) : ''  %}

{% set show_title = TRUE %}
{% set prev_title = has_prev_step ? prev_step_title %}
{% set next_title = has_next_step ? next_step_title %}

{% embed 'localgov_base:prev-next' %}
  {% block prev_next_pre_content %}
    <h2 class="visually-hidden" aria-labelledby="{{ nav_id }}">{{ 'Step by step navigation'|t }}</h2>
  {% endblock %}
{% endembed %}
