{% extends 'klaus/base.html' %} {% load klaus %} {% block extra_header %}{% endblock %} {# no branch selector on commits #} {% block title %} Commit {{ rev }} - {{ repo.name }} {% endblock %} {% block content %}
{# TODO code duplication in history.html #}
{{ commit.message }} {{ commit.author_name }} {{ commit.commit_datetime|timesince }}
{# {% for file in repo.commit_diff(commit) %} #} {% for file in commit.repo_diff %} {% with fileno=loop.index0 %}
{# TODO dulwich doesn't do rename recognition #} {% comment %} {% if file.old_filename != file.new_filename %} {{ file.old_filename }} → {% endif %} {% endcomment %} {% if file.new_filename == '/dev/null' %} {{ file.old_filename }} {% else %} {{ file.new_filename }} {% endif %}
{% if file.chunks %} {% for chunk in file.chunks %} {% for line in chunk %} {#- left column: linenos -#} {% if line.old_lineno %} {% if line.new_lineno %} {% else %} {% endif %} {% else %} {% if line.old_lineno %} {% else %} {% endif %} {% endif %} {#- right column: code -#} {% endfor %} {# lines #} {% if not loop.last %} {% endif %} {% endfor %} {# chunks #}
{{ line.old_lineno }}{{ line.new_lineno }}{{ line.new_lineno }}{{ line.new_lineno }} {#- lineno anchors -#} {% if line.old_lineno %} {% else %} {% endif %} {#- the actual line of code -#} {{ line.line|safe }}
{% else %}
Binary diff not shown
{% endif %} {% endwith %} {% endfor %}
{% endblock %}