{% extends widget.get_base_template %}

{% load thumbnail %}

{% block content %}
{% with widget.get_size as size %}
{% if widget.detail == "open_modal" %}

{% thumbnail widget.image.file size as image %}
<a class="thumbnail" href="{{ widget.image.url }}" data-title="{{ widget.image.default_caption|default:'' }}" data-footer="{{ widget.image.description|default:'' }}" data-toggle="lightbox" rel="{{ widget.fe_identifier }}">
{% endthumbnail %}
{% endif %} 
{% if widget.detail == "go_to_page" %}
<a class="thumbnail" href="{{ widget.parent.get_absolute_url }}">
{% endif %}
  {% if widget.size %}
  {% thumbnail widget.image.file size format="PNG" as thumb %}
  <img class="img-responsive" src='{{ thumb.url }}' alt='' />
  {% endthumbnail %}
  {% else %}
  <img class="img-responsive" src='/media/files/{{ widget.image.file }}' alt='' />
  {% endif %}
{% if widget.detail %}
</a>
{% endif %}
{% endwith %}
{% endblock %}
