{% extends "base.html" %}
{% from "macros.html" import page_header %}
{% block content %}
{{ page_header("Activity", "Timeline") }}
{% if events %}
<div class="card">
  <div class="list-group list-group-flush">
    {% for event in events %}
    <div class="list-group-item">
      <div class="row align-items-center">
        <div class="col-auto">
          <span class="avatar avatar-sm">{{ event.project | initials }}</span>
        </div>
        <div class="col text-truncate">
          <a href="{{ event.project_href }}" class="text-reset d-block">{{ event.project }}</a>
          <div class="text-secondary text-truncate">
            {% if event.event_href %}
            <a href="{{ event.event_href }}">{{ event.label }}</a>
            {% else %}
            <span class="badge bg-secondary-lt">{{ event.label }}</span>
            {% endif %}
            {% if event.description %}
            <span class="ms-1">{{ event.description }}</span>
            {% endif %}
          </div>
        </div>
        <div class="col-auto text-secondary">{{ event.time }}</div>
      </div>
    </div>
    {% endfor %}
  </div>
</div>
{% else %}
<div class="empty">
  <p class="empty-title">No activity yet</p>
  <p class="empty-subtitle text-secondary">Commits and ref updates from repositories you can read show up here.</p>
</div>
{% endif %}
{% if pagination %}
{% with current_page=pagination.current_page, pagecount=pagination.pagecount, has_prev=pagination.has_prev, has_next=pagination.has_next, prev_url=pagination.prev_url, next_url=pagination.next_url, total_pages=pagination.total_pages, page_links=pagination.page_links %}
{% include "pagination.html" %}
{% endwith %}
{% endif %}
{% endblock %}