{% load bootstrap4 %}
{% load static tom_education_extras %}

<div class="row">
{% if timelapse %}
<div class="col">
  {% if '.gif' in timelapse.data.url %}
  <img src="{{timelapse.data.url}}" class="img-fluid" />
  {% else %}
  <div class="embed-responsive embed-responsive-16by9">
    <video autoplay loop controls>
      <source src="{{timelapse.data.url}}" type="video/webm">
      <a href="{{timelapse.data.url}}" alt="timelapse file">Download timelapse file</a>
    </video>
  </div>
  {% endif %}
  <p>Timelapse of {{timelapse.timelapsedataproduct.frames.all.count}} frames, update {{timelapse.modified|timesince}} ago</p>
</div>
{% endif %}
</div>
