{% extends "htmx/form_base.html" %} {% load htmx %} {% block form %} {# hx-target/include/swap are inherited by every hx-post element below #}
{# Card header: branch, staged/unstaged badge counts, and actions #}
Git
{% if available %} {{ branch }} {% endif %}
{% if available %}
{% if is_clean %} Clean {% else %} {% if has_staged %} {{ staged_files|length }} staged {% endif %} {% if unstaged_files %} {{ unstaged_files|length }} unstaged {% endif %} {% endif %} {# All-branches dropdown #}
{% endif %}
{# Checkout / fetch results #} {% include "htmx/partials/action_alert.html" %} {# Top: commit graph | file list + commit #}
{# Left panel: commit graph #} {% if available %}
{% include "dev_tools/git_log_panel.html" %}
{% endif %} {# Right panel: file list + commit #}
{% if not available %}
git not found or not in a repository
{% else %} {# Dirstat #} {% if dirstat %}
Changed Dirs
{% for stat in dirstat %}
{{ stat.pct|floatformat:0 }}%
{{ stat.path }}
{% endfor %}
{% endif %} {% include "dev_tools/partials/git_file_section.html" with label="Unstaged" files=unstaged_files view="unstaged" empty_text="No unstaged changes" section_class="" file_method="stage_file" file_title="Stage file" all_method="stage_all" all_title="Stage all" icon="plus-circle-fill" color="#3fb950" %} {% include "dev_tools/partials/git_file_section.html" with label="Staged" files=staged_files view="staged" empty_text="No staged changes" section_class="border-top" file_method="unstage_file" file_title="Unstage file" all_method="unstage_all" all_title="Unstage all" icon="dash-circle-fill" color="#f85149" %} {# Commit box #}
{% if component.commit_error %}
{{ component.commit_error }}
{% endif %}
{% endif %}
{# Bottom: full-width diff viewer (compact until there is something to show) #}
{% if component.selected_file %} {# File header with stage/unstage button #}
{{ component.selected_file }} {% if show_unstage_btn %} {% elif show_stage_btn %} {% endif %}
{# Diff content #}
{% if diff_lines %} {% include "dev_tools/partials/diff_table.html" %} {% else %}
No diff available for this file.
{% endif %}
{% elif component.lint_output %}
{{ component.lint_output }}
{% else %}
Select a file to view its diff
{% endif %}
{% endblock %}