repo-commit.html
HTML 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<x-vbox> 12<article> 13<h1>{{ data.message | split("\n\n", 1) | first | inline_markdown }}</h1> 14{{ data.message | split("\n\n", 1) | last | markdown }} 15</article> 16 17<p> 18<a href="/{{ data.owner_name }}">{{ data.owner_name }}</a>,<br> 19{% trans receive_date=data.receive_date.strftime('%A, %e %B %Y, %H:%M:%S'), author_date=data.author_date.strftime("%A, %e %B %Y, %H:%M:%S"), 20receive_unix=data.receive_date.timestamp() | int, author_unix=data.author_date.timestamp() | int 21%} 22created on {{ author_date }} ({{ author_unix }}), 23received on {{ receive_date }} ({{ receive_unix }}) 24{% endtrans %} 25<br> 26{% trans %}Author identity:{% endtrans %} <code>{{ data.owner_identity }}</code> 27</p> 28 29<code>{{ data.sha }}</code> 30 31<x-vbox> 32{% for file in diff %} 33<article class="card"> 34<section class="card-main"> 35<h2>{{ file }}</h2> 36{% set vars = namespace(original_line=0, modified_line=0, hunk_started=false) %} 37{% for line in diff[file] %} 38{% if line.startswith("@@") %} 39{% if vars.hunk_started %} 40</pre> <!-- close the previous pre block if this isn't the first hunk --> 41{% endif %} 42{% set vars.hunk_started = true %} 43{% set diff_location = line|parse_diff_location %} 44{% set vars.original_line = diff_location[0][0] %} 45{% set vars.modified_line = diff_location[1][0] %} 46<h3 class="diff-position">{{ line }}</h3> 47<pre class="code-view"> 48{% elif vars.hunk_started %} 49{% if line.startswith("+") %} 50<span class="line-number">{{ vars.modified_line }} +</span> 51<ins>{{ line[1:] }}</ins> 52{% set vars.modified_line = vars.modified_line + 1 %} 53{% elif line.startswith("-") %} 54<span class="line-number">{{ vars.original_line }} -</span> 55<del>{{ line[1:] }}</del> 56{% set vars.original_line = vars.original_line + 1 %} 57{% elif not line.startswith("\\") %} 58{% if line %} 59<span class="line-number">{{ vars.modified_line }} </span> 60<x-codeline>{{ line[1:] }}</x-codeline> 61{% endif %} 62{% if not line.startswith("@@") %} 63{% set vars.original_line = vars.original_line + 1 %} 64{% set vars.modified_line = vars.modified_line + 1 %} 65{% endif %} 66{% endif %} 67{% endif %} 68{% endfor %} 69{% if vars.hunk_started %} 70</pre> <!-- close the last hunk --> 71{% endif %} 72</section> 73</article> 74{% endfor %} 75</x-vbox> 76</x-vbox> 77</x-frame> 78</x-vbox> 79{% endblock %} 80