{# Ansicht „Änderungen“: Branch des Chats je Quelle, Aktionen nur auf Klick eines Menschen. Aktualisiert sich nach jeder Antwort. #}
{% if error %}{% endif %} {% if notice %}

{{ notice }}

{% endif %} {% for v in views %}{% set b = v.branch %}{% set hx = 'hx-target="#changes" hx-swap="outerHTML"' %}
Änderungen {{ b.name }} {% if b.closed %} {{ 'gemergt' if b.pr_state == 'MERGED' else 'abgelehnt' }} {% set remote = b.pr_info.get('remote_branch') %} {% if remote in ('deleted', 'gone') %}im Git-Server gelöscht {% elif remote == 'changed' %}Branch im Git-Server behalten {% elif remote == 'failed' %}Branch nicht gelöscht{% endif %} {% elif b.pr_id %} PR #{{ b.pr_id }} {{ 'Entwurf' if b.pr_draft else 'offen' }} {% elif b.pushed %} gepusht {% else %} nur in der Plattform {% endif %} {% if b.unpushed and b.pushed and not b.closed %}neue Commits nicht übertragen{% endif %} {% if v.commits and v.commits[-1].warnings and not b.closed %}Syntaxwarnung im letzten Commit{% endif %} {% if v.conflict %}Konflikt mit {{ b.target }} {% elif v.behind %}{{ b.target }} ist weiter{% endif %}

{{ v.source.name }} · Ziel {{ b.target }} · {{ v.commits|length }} Commit{{ 's' if v.commits|length != 1 }} · {{ v.files|length }} Datei{{ 'en' if v.files|length != 1 }} {% if b.pr_id %} · {% for r in b.pr_info.get('reviewers', []) %}{{ r.name }} {{ {'APPROVED': '✓', 'NEEDS_WORK': '✗'}.get(r.status, '·') }}{% if not loop.last %}, {% endif %}{% endfor %} {% if b.pr_info.get('comments') %} · {{ b.pr_info.comments }} Kommentar{{ 'e' if b.pr_info.comments != 1 }}{% endif %} {% if b.pr_checked %} · Stand {{ b.pr_checked.astimezone().strftime('%d.%m. %H:%M') }}{% endif %}{% endif %}

{% if b.pr_url %}PR #{{ b.pr_id }} öffnen{% endif %} {% if not b.closed %} {% if b.unpushed %}
{% endif %} {% if not v.conflict %}
{% elif v.conflict %}
{% endif %} {% if b.pr_draft %}
{% endif %} {% if b.pr_id %}
{% if b.pr_info.get('comments') %}
{% endif %} {% endif %} {% endif %}
{% if not b.closed and not b.pr_id and v.commits %}
Pull Request erstellen
Ziel {{ b.target }}. Geprüft wird im Review des Git-Servers.
{% endif %}
Commits und Diff
    {% for c in v.commits|reverse %}
  • {{ c.sha[:10] }} {{ c.message.splitlines()[0] }}{% if c.merged %} Abgleich{% if c.changes %}, {{ c.changes|length }} Konflikt{{ 'e' if c.changes|length != 1 }} gelöst{% endif %}{% endif %} {{ c.created.astimezone().strftime('%d.%m. %H:%M') }} · {{ c.files|length }} Datei{{ 'en' if c.files|length != 1 }}{% if b.pushed and (c.sha == b.pushed) %} · bis hier übertragen{% endif %} {% if c.warnings %}{{ c.warnings|length }} Syntaxwarnung{{ 'en' if c.warnings|length != 1 }}
      {% for w in c.warnings %}
    • {{ w }}
    • {% endfor %}
    {% endif %}
  • {% endfor %}
{% if not b.closed and b.unpushed and v.commits %}
{% endif %} {% if v.diff %} {% from "_diff.html" import diff %}{{ diff(v.diff) }} {% if v.truncated %}

Diff gekürzt; vollständig im Pull Request bzw. nach dem Push im Git-Server.

{% endif %} {% endif %}
{% endfor %}