Blob: commit.html

Blob id: 7407e5a865829c105b3c9667dff6e4c0430821a9

Size: 2.3 KB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{% extends "base.html" %}

{% block content %}
    <header>
        <b>Commit:</b> <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.id) }}">{{ commit.id }}</a><br>
        {% if commit.parent_id %}
        <b>Parent:</b> <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.parent_id) }}">{{ commit.parent_id }}</a><br>
        {% endif %}
        <b>Author:</b> {{ commit.author.name }} &lt;{{ commit.author.email }}&gt;<br>
        <b>Committer:</b> {{ commit.committer.name }} &lt;{{ commit.committer.email }}&gt;<br>
        <b>Date:</b> {{ commit.date | datetime }}<br>
        <b>Tree:</b> <a href="{{ url_for('repo_tree_path', repo_name=repo_name, path='') }}?ref={{ commit.tree_id }}">{{ commit.tree_id }}</a>
    </header>
    <p>{{ commit.message }}</p>
    {% if commit.diff %}
    <h2>Diffstat</h2>
    <table>
        <tbody>
            {% for file in commit.changed_files %}
            {% set status_letter = {'added':'A','deleted':'D','modified':'M','renamed':'R','copied':'C','typechange':'T'}.get(file.status, '?') %}
            {% set total = file.additions + file.deletions %}
            {% set plus_len = [file.additions, 40] | min %}
            {% set minus_len = [file.deletions, 40] | min %}
            <tr>
                <td class="status {{ status_letter }}">{{ status_letter }}</td>
                <td><a href="{{ url_for('repo_blob_path', repo_name=repo_name, path=file.file) }}?ref={{ commit.id }}">{{ file.file }}</a></td>
                <td>|</td>
                <td>{{ total }}</td>
                <td><span style="color: green;">{{ '+' * plus_len }}</span><span style="color: red;">{{ '- ' * minus_len }}</span></td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    <p>{{ commit.diff_stats.files_changed }} files changed, {{ commit.diff_stats.insertions }} insertions(+), {{ commit.diff_stats.deletions }} deletions(-)</p>
    {% if commit.parent_id %}
    <div>
        <a href="{{ url_for('repo_diff', repo_name=repo_name) }}?id1={{ commit.parent_id }}&id2={{ commit.id }}">View Full Diff</a> | 
        <a href="{{ url_for('commit_patch', repo_name=repo_name, commit_id=commit.id) }}">Patch</a>
    </div>
    {% endif %}
    {% else %}
    <p>No changes compared to parent</p>
    {% endif %}
{% endblock %}