{% extends "base.html" %}

{% block title %}repos{% endblock %}

{% block breadcrumbs %}
<ul>
  <li><a href="{{ crate::base_url() }}/">{{ crate::hostname() }}</a></li>
</ul>
{% endblock %}

{% block content %}
{% if repos.is_empty() %}
<p>No repositories found.</p>
{% else %}
<div class="repo-list">
  {% for repo in repos %}
  <a href="{{ crate::base_url() }}/{{ repo.name }}" class="repo-card">
    <span class="repo-name">{{ repo.name }}</span>
    {% if let Some(desc) = &repo.description %}
    <span class="repo-desc">{{ desc }}</span>
    {% endif %}
    <span class="repo-meta"><span>{{ repo.commit_count }} {{ repo.commit_count|pluralize("commit", "commits") }}</span>{% if let Some(date) = &repo.last_commit %}<span>{{ date }}</span>{% endif %}</span>
  </a>
  {% endfor %}
</div>
{% endif %}
{% endblock %}
