repo-commit.html
exported SGML document, ASCII text
1{% extends "repo.html" %} 2 3{% set active_page = "log" %} 4 5{% block title %} 6{% trans basename=basename, username=username, repository=repository %}{{ basename }} in {{ username }}/{{ repository }}{% endtrans %} 7{% endblock %} 8{% block content %} 9<x-vbox> 10<x-frame style="--width: 896px;" class="flexible-space"> 11{% for file in diff %} 12<h2>{{ file }}</h2> 13{% set vars = namespace(original_line=0, modified_line=0, hunk_started=false) %} 14{% for line in diff[file] %} 15{% if line.startswith("@@") %} 16{% if vars.hunk_started %} 17</pre> <!-- close the previous pre block if this isn't the first hunk --> 18{% endif %} 19{% set vars.hunk_started = true %} 20{% set diff_location = line|parse_diff_location %} 21{% set vars.original_line = diff_location[0][0] %} 22{% set vars.modified_line = diff_location[1][0] %} 23<h3 class="diff-position">{{ line }}</h3> 24<pre class="code-view"> 25{% elif vars.hunk_started %} 26{% if line.startswith("+") %} 27<span class="line-number">{{ vars.modified_line }} +</span> 28<ins>{{ line[1:] }}</ins> 29{% set vars.modified_line = vars.modified_line + 1 %} 30{% elif line.startswith("-") %} 31<span class="line-number">{{ vars.original_line }} -</span> 32<del>{{ line[1:] }}</del> 33{% set vars.original_line = vars.original_line + 1 %} 34{% elif not line.startswith("\\") %} 35{% if line %} 36<span class="line-number">{{ vars.modified_line }} </span> 37<x-codeline>{{ line[1:] }}</x-codeline> 38{% endif %} 39{% if not line.startswith("@@") %} 40{% set vars.original_line = vars.original_line + 1 %} 41{% set vars.modified_line = vars.modified_line + 1 %} 42{% endif %} 43{% endif %} 44{% endif %} 45{% endfor %} 46{% if vars.hunk_started %} 47</pre> <!-- close the last hunk --> 48{% endif %} 49{% endfor %} 50</x-frame> 51</x-vbox> 52{% endblock %} 53