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.65 kiB
exported SGML document, ASCII text
        
            
1
{% extends "repo.html" %}
2
3
{% set active_page = "log" %}
4
5
{% block title %}
6
{% trans message=data.message|split("\n\n")|first, 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
<h1>{{ data.message | split("\n\n", 1) | first | inline_markdown }}</h1>
12
<p>
13
{{ data.message | split("\n\n", 1) | last | markdown }}
14
</p>
15
{% for file in diff %}
16
<h2>{{ file }}</h2>
17
{% set vars = namespace(original_line=0, modified_line=0, hunk_started=false) %}
18
{% for line in diff[file] %}
19
{% if line.startswith("@@") %}
20
{% if vars.hunk_started %}
21
</pre> <!-- close the previous pre block if this isn't the first hunk -->
22
{% endif %}
23
{% set vars.hunk_started = true %}
24
{% set diff_location = line|parse_diff_location %}
25
{% set vars.original_line = diff_location[0][0] %}
26
{% set vars.modified_line = diff_location[1][0] %}
27
<h3 class="diff-position">{{ line }}</h3>
28
<pre class="code-view">
29
{% elif vars.hunk_started %}
30
{% if line.startswith("+") %}
31
<span class="line-number">{{ vars.modified_line }}&nbsp;+</span>
32
<ins>{{ line[1:] }}</ins>
33
{% set vars.modified_line = vars.modified_line + 1 %}
34
{% elif line.startswith("-") %}
35
<span class="line-number">{{ vars.original_line }}&nbsp;-</span>
36
<del>{{ line[1:] }}</del>
37
{% set vars.original_line = vars.original_line + 1 %}
38
{% elif not line.startswith("\\") %}
39
{% if line %}
40
<span class="line-number">{{ vars.modified_line }}&nbsp;&nbsp;</span>
41
<x-codeline>{{ line[1:] }}</x-codeline>
42
{% endif %}
43
{% if not line.startswith("@@") %}
44
{% set vars.original_line = vars.original_line + 1 %}
45
{% set vars.modified_line = vars.modified_line + 1 %}
46
{% endif %}
47
{% endif %}
48
{% endif %}
49
{% endfor %}
50
{% if vars.hunk_started %}
51
</pre> <!-- close the last hunk -->
52
{% endif %}
53
{% endfor %}
54
</x-frame>
55
</x-vbox>
56
{% endblock %}
57