{% extends widget.get_base_template %}
{% load thumbnail %}

{% block content %}
<div data-ride="carousel" class="carousel slide" id="carousel_{{ widget.fe_identifier }}">
  <ol class="carousel-indicators">
    {% for category_file in widget.category.files %}
    {% with category_file.file as file %}
    <li data-target="#carousel_{{ widget.fe_identifier }}" data-slide-to="{{ forloop.counter0 }}" class="active"></li>
    {% endwith %}
    {% endfor %}
  </ol>
  <div class="carousel-inner" role="listbox">
    {% for category_file in widget.category.files %}
    {% with category_file.file as file %}
    <div class="item {% if forloop.first %}active{% endif %}">
      {% include "widget/mediagallery/_item.html" %}
    </div>
    {% endwith %}
    {% endfor %}
  </div>
  <a class="left carousel-control" href="#carousel_{{ widget.fe_identifier }}" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#carousel_{{ widget.fe_identifier }}" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
{% endblock %}
