By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 repo-commit.html

View raw Download
text/plain • 2.44 kiB
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
<!-- Intentionally not displaying hunk headers directly -->
25
<pre class="code-view"> <!-- Start a new pre block for hunk content -->
26
{% elif vars.hunk_started %}
27
{% if line.startswith("+") %}
28
<ins class="ln" data-ln="{{ vars.modified_line }} +">{{ line[1:] }}</ins>
29
{% set vars.modified_line = vars.modified_line + 1 %}
30
{% elif line.startswith("-") %}
31
<del class="ln" data-ln="{{ vars.original_line }} -">{{ line[1:] }}</del>
32
{% set vars.original_line = vars.original_line + 1 %}
33
{% else %}
34
{% if line %}
35
<x-codeline class="ln" data-ln="{{ vars.modified_line }} ">{{ line }}</x-codeline>
36
{% endif %}
37
{% if not line.startswith("@@") %}
38
{% set vars.original_line = vars.original_line + 1 %}
39
{% set vars.modified_line = vars.modified_line + 1 %}
40
{% endif %}
41
{% endif %}
42
{% endif %}
43
{% endfor %}
44
{% if vars.hunk_started %}
45
</pre> <!-- Ensure the last pre block is closed -->
46
{% endif %}
47
{% endfor %}
48
</x-frame>
49
</x-vbox>
50
{% endblock %}
51