File size: 4,837 Bytes
a6ab5dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{% extends "base.html" %}
{% block title %}{{ page_title }}{% endblock %}
{% block content %}
<div class="plp">
  {% if breadcrumb and show_breadcrumb %}
  <nav aria-label="Breadcrumb" class="breadcrumb"><ol>
    {% for crumb in breadcrumb %}<li>{% if crumb.url %}<a href="{{ crumb.url }}">{{ crumb.name }}</a>{% else %}<span aria-current="page">{{ crumb.name }}</span>{% endif %}</li>{% endfor %}
  </ol></nav>
  {% endif %}

  <h1 class="plp-heading">{{ heading }}</h1>

  {% if visnav %}
  {# Source-observed category carousel: large image tiles with a label and a
     circular arrow, followed by slide dots. #}
  <div class="plp-visnav" role="region" aria-label="Shop by category">
    <ul class="plp-visnav-track">
      {% for tile in visnav %}
      <li class="plp-visnav-item">
        <a href="{{ tile.url }}">
          {% if tile.image %}<img src="{{ tile.image }}" alt="{{ tile.label }}" loading="lazy">{% endif %}
          <span class="plp-visnav-label">{{ tile.label }}</span>
          <span class="plp-visnav-arrow" aria-hidden="true">
            <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
              <path d="M4 12h15M13 6l6 6-6 6"/></svg>
          </span>
        </a>
      </li>
      {% endfor %}
    </ul>
    <ol class="plp-visnav-dots" aria-hidden="true"><li class="is-active"></li><li></li><li></li></ol>
  </div>
  {% elif siblings %}
  <ul class="plp-siblings">
    {% for sibling in siblings %}<li><a href="{{ sibling.url }}" {% if sibling.current %}aria-current="page"{% endif %}>{{ sibling.name }}</a></li>{% endfor %}
  </ul>
  {% endif %}

  <form class="plp-controls" method="get" action="{{ base_path }}">
    <div class="plp-refinements">
      <details class="refinement refinement-all">
        <summary data-testid="all-filters">All Filters</summary>
        <div class="refinement-all-panel">
          {% for refinement in result.rest %}
          <fieldset><legend>{{ refinement.label }}</legend>
            {% for value in refinement.values %}
            <label><input type="checkbox" name="refine" value="{{ refinement.attribute_id }}={{ value.label }}" {% if value.selected %}checked{% endif %}>
              <span>{{ value.label }}</span><span class="hit-count">({{ value.hit_count }})</span></label>
            {% endfor %}
          </fieldset>
          {% endfor %}
        </div>
      </details>
      {% for refinement in result.quick %}
      <details class="refinement" {% if refinement.selected_count %}open{% endif %}>
        <summary>{{ refinement.label }}{% if refinement.selected_count %} ({{ refinement.selected_count }}){% endif %}</summary>
        <ul>
          {% for value in refinement.values %}
          <li><label>
            <input type="checkbox" name="refine" value="{{ refinement.attribute_id }}={{ value.label }}" {% if value.selected %}checked{% endif %}>
            <span>{{ value.label }}</span><span class="hit-count">({{ value.hit_count }})</span>
          </label></li>
          {% endfor %}
        </ul>
      </details>
      {% endfor %}
    </div>
    <p class="plp-count" data-testid="result-count">{{ "{:,}".format(result.total) }} Results</p>
    <div class="plp-sort">
      <label class="visually-hidden" for="sort">Sort</label>
      <select id="sort" name="sort">
        {% for sort_id, label in sort_options %}<option value="{{ sort_id }}" {% if sort_id == result.sort_id %}selected{% endif %}>{{ label }}</option>{% endfor %}
      </select>
      {% if q %}<input type="hidden" name="q" value="{{ q }}">{% endif %}
      <button type="submit" class="chakra-button">Apply</button>
      {% if selected_any %}<a class="plp-clear" href="{{ base_path }}{% if q %}?q={{ q }}{% endif %}">Clear</a>{% endif %}
    </div>
  </form>

  <div class="product-grid css-1wl9euw" role="grid">
    {% for item in tiles %}
    {% include "partials/tile.html" %}
    {# The source drops a promotional cell into the grid after the third tile. #}
    {% if grid_promo and loop.index == 3 %}
    <div role="row" class="css-11ovpv2">
      <a class="grid-promo" href="{{ grid_promo.url }}"
         {% if grid_promo.image %}style="background-image:url('{{ grid_promo.image }}')"{% endif %}>
        <span class="grid-promo-heading">{{ grid_promo.heading }}</span>
        <span class="grid-promo-body">{{ grid_promo.body }}</span>
        <span class="grid-promo-cta">{{ grid_promo.cta }}</span>
      </a>
    </div>
    {% endif %}
    {% endfor %}
  </div>

  {% if result.has_more %}
  <div class="plp-more">
    <a class="chakra-button" href="{{ more_url }}">Show More ({{ [result.remaining, 48] | min }})</a>
    {% if result.remaining > 48 %}<a class="chakra-button" href="{{ all_url }}">Show All ({{ result.remaining }})</a>{% endif %}
  </div>
  {% endif %}
</div>
{% endblock %}