{#
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2025 The Linux Foundation
#}

{#- Section: Repositories (Markdown) -#}
{#- Renders the repositories section with repository activity tables -#}
{#-
    Context required:
        - repositories (dict): Repository data and counts
        - config (dict): Configuration options

    This section displays:
        - All repositories table with activity metrics
        - Matches production format: Gerrit Project | Commits | LOC | Contributors | Days Inactive | Last Commit Date | Status
-#}

{% if config.include_sections.repositories and repositories.has_repositories %}
## 📊 {{ project.terminology.repositories }}

| {{ project.terminology.repository }} | Commits | LOC | Contributors | Days Inactive | Last Commit Date | Status |
| --- | --- | --- | --- | --- | --- | --- |
{% for repo in repositories.all %}
| {% if repo.gerrit_url %}[{{ repo.gerrit_project | default('Unknown') }}]({{ repo.gerrit_url }}){% else %}{{ repo.gerrit_project | default('Unknown') }}{% endif %} | {{ repo.total_commits | default(0) }} | {{ repo.total_lines_added | format_loc }} | {{ repo.unique_contributors | default(0) }} | {{ repo.days_inactive | default(0) }} | {{ repo.last_commit_date | default('N/A') }} | {{ repo.activity_status | default('🛑') }} |
{% endfor %}

**Total:** {{ repositories.all_count }} repositories

---
{% endif %}
