{% extends "layout.html" %}
{% block body %}
{{ link_breadcrumbs(breadcrumbs) }}
<table class='table table-condensed table-bordered table-striped'>
  <thead>
    <tr><th>Name</th><th>Modified</th></tr>
  </thead>
  <tbody>
    <tr>
      <td>
        {% if len(breadcrumbs) > 1 %}
          <a href='{{ from_base(breadcrumbs[-2]["url"]) }}'><i class='fa fa-level-up'></i> ..</a>
        {% endif %}
      </td>
      <td></td>
    </tr>
    {% for entry in entries %}
      <tr>
        <td><i class='{{entry.class}}'></i>
          {% if entry.url %}
          <a href='{{ from_base(entry.url) }}'>
          {% endif %}
          {{entry.name}}
          {% if entry.url %}
            </a>
          {% endif %}
        </td>
        <td>
          <span class="time-col text-muted">{{ entry.modtime }}</span>
        </td>
      </tr>
    {% endfor %}
  </tbody>
</table>
<script type="text/javascript">
  require(["moment"], function(moment) {
    $(".time-col").map(function (i, el) {
        // convert ISO datestamps to nice momentjs ones
        el = $(el);
        el.text(moment(new Date(el.text())).fromNow());
    });
  });
</script>
{% endblock %}
