{% load i18n %}
{% translate "Opens a new window" as new_window_label %}
<figure class="village-quote village-quote--column{% if self.extra_classes %} {{ self.extra_classes }}{% endif %}">
  <blockquote {% if self.source_url %}cite="{{ self.source_url }}"{% endif %}>
    <p>
      {{ self.text }}
    </p>
  </blockquote>
  <figcaption>
    {% if self.author %}
      <p class="village-quote__author">
        {{ self.author }}
      </p>
    {% endif %}
    {% if self.details or self.source %}
      <ul class="village-quote__source">
        <li>
          <cite>{{ self.source }}</cite>
        </li>
        {% for detail in self.details %}
          {% if detail.link %}
            <li>
              <a target="_blank" rel="noopener noreferrer" href="{{ detail.link }}">{{ detail.text }} <span class="village-sr-only">{{ new_window_label }}</span></a>
            </li>
          {% else %}
            <li>
              {{ detail.text }}
            </li>
          {% endif %}
        {% endfor %}
      </ul>
    {% endif %}
    {% if self.image_url %}
      <div class="village-quote__image">
        <img src="{{ self.image_url }}" class="village-responsive-img" alt="" />
      </div>
    {% endif %}
  </figcaption>
</figure>
