<div class="page-width" data-section-id="{{ section.id }}" data-section-type="quotes">
  {% if section.settings.title != blank %}
    <div class="section-header text-{{settings.title_position}}">
      <h2 class="title">{{ section.settings.title | escape }}</h2>
    </div>
  {% endif %}

  {% if section.blocks.size > 0 %}
    <div class="quotes-wrapper">
      <div class="quotes-slider" id="Quotes-{{ section.id }}" data-count="{{ section.blocks.size }}">
        {% for block in section.blocks %}
          <div class="quotes-slide--{{ block.id }}" {{ block.shopify_attributes }}>
            <blockquote class="quotes-slider__text text-center">
              <span class="quote-icon">
                {% if block.settings.t_image != blank %}
                  <img src="{{ block.settings.t_image | img_url: 'medium' }}">
                 {%else%}
                  <div class="svgnoimg">
                 {{ 'image' | placeholder_svg_tag: 'placeholder-svg' }}
                </div>  
                {% endif %}
              </span>
              {% if block.settings.quote != blank %}
                <div class="rte-setting">{{ block.settings.quote }}</div>
              {% endif %}
              {% if block.settings.author != blank %}
                <cite>{{ block.settings.author | escape }}</cite>
              {% endif %}
            </blockquote>
          </div>
        {% endfor %}
      </div>
    </div>
  {% endif %}

  {% if section.blocks.size == 0 %}
    {% include 'no-blocks' %}
  {% endif %}
</div>

{% schema %}
  {
    "name": "Testimonials",
    "class": "index-section",
    "max_blocks": 9,
    "settings": [
      {
        "type": "header",
        "content": "Testimonials [NEED HELP?](https:\/\/help.boostertheme.com\/hc\/en-us\/articles\/360002079213-How-to-setup-Testimonials-section-in-Booster-2-0)"
      },
      {
        "type": "text",
        "id": "title",
        "label": "Heading",
        "default": "Testimonials"
      }
    ],
    "blocks": [
      {
        "type": "quote",
        "name": "Testimonial",
        "settings": [
          {
            "type": "image_picker",
            "id": "t_image",
            "label": "Image"
          },
          {
            "type": "richtext",
            "id": "quote",
            "label": "Text",
            "default": "<p>Add customer reviews and testimonials to showcase your store’s happy customers.</p>"
          },
          {
            "type": "text",
            "id": "author",
            "label": "Author",
            "default": "Author's name"
          }
        ]
      }
    ],
    "presets": [
      {
        "name": "Testimonials",
        "category": "Text",
        "blocks": [
          {
            "type": "quote"
          },
          {
            "type": "quote"
          },
          {
            "type": "quote"
          }
        ]
      }
    ]
  }
{% endschema %}
