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.55 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
<div class="linenumber">{{ vars.modified_line }} +</div>
29
<ins>{{ line[1:] }}</ins>
30
{% set vars.modified_line = vars.modified_line + 1 %}
31
{% elif line.startswith("-") %}
32
<div class="linenumber">{{ vars.original_line }} -</div>
33
<del>{{ line[1:] }}</del>
34
{% set vars.original_line = vars.original_line + 1 %}
35
{% else %}
36
{% if line %}
37
<div class="linenumber">{{ vars.modified_line }}&nbsp;&nbsp;</div>
38
<x-codeline>{{ line[1:] }}</x-codeline>
39
{% endif %}
40
{% if not line.startswith("@@") %}
41
{% set vars.original_line = vars.original_line + 1 %}
42
{% set vars.modified_line = vars.modified_line + 1 %}
43
{% endif %}
44
{% endif %}
45
{% endif %}
46
{% endfor %}
47
{% if vars.hunk_started %}
48
</pre> <!-- Ensure the last pre block is closed -->
49
{% endif %}
50
{% endfor %}
51
</x-frame>
52
</x-vbox>
53
{% endblock %}
54