{% extends "base.html" %} {% block content %} {{ render_partial('partials/toolbar.html', branches=branches, current_base_ref=current_base_ref, unstaged=unstaged, staged=staged, untracked=untracked, search_filter=search_filter, total_files=total_files, is_head_comparison=is_head_comparison) }}
{% if loading %} {{ render_partial('partials/loading_state.html') }} {% else %}
{# Rendered even with nothing to show: the empty state tells people to turn on Unstaged or Untracked, so the toggles have to be reachable. #} {{ render_partial('partials/global_controls.html', unstaged=unstaged, untracked=untracked, is_head_comparison=is_head_comparison, has_files=(groups and total_files)) }} {{ render_partial('partials/filtered_empty_state.html') }} {% if not groups or not total_files %} {{ render_partial('partials/empty_state.html', error=error, unstaged=unstaged, untracked=untracked, current_base_ref=current_base_ref) }} {% else %} {% if not is_head_comparison and not untracked and groups.get('changes') %}
{% for file in groups['changes'].files %} {% set group_name = 'changes' %} {% include 'diff_file.html' with context %} {% endfor %}
{% elif not untracked and groups.get('changes') %}
{% for file in groups['changes'].files %} {% set group_name = 'changes' %} {% include 'diff_file.html' with context %} {% endfor %}
{% else %} {% include "diff_groups.html" %} {% endif %} {% endif %}
{% endif %}
{% endblock %}