index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff

Diffstat (limited to 'templates/repository/diff.html')

-rw-r--r-- templates/repository/diff.html 46
 1 file changed, 46 insertions(+)

diff --git a/templates/repository/diff.html b/templates/repository/diff.html
new file mode 100644
index 0000000..f3d5d01 100644
--- /dev/null
+++ b/templates/repository/diff.html
@@ -1,0 +1,46 @@
{% extends "base.html" %}

{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}

{% block header %}
  {{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}

{% block tabs %}
  {{ macros::repo_tabs(repo, current_ref, query, "diff") }}
{% endblock %}

{% block content %}
<h3><a href="/{{ repo.name }}/diff/">Diffstat</a>{% if let Some(file_path) = file_path %} <strong>(limited to '{{ file_path }}')</strong>{% endif %}</h3>
  <table class="diffstat">
  <tbody>
  {% for file_diff in diff.file_diffs %}
    <tr>
      <td class="mode">{{ file_diff.mode }}</td>
      <td class="upd">
        <a href="/{{ repo.name }}/diff/{{ file_diff.path }}{% if let Some(id) = query.id %}?id={{ id }}{% endif %}" class="{{ file_diff.state }}">{{ file_diff.path }}</a>
      </td>
      <td class="right">{{ file_diff.total }}</td>
      <td class="graph">
        <table summary="file diffstat" style="width: {{ file_diff.total_percentage }}%">
          <tbody>
            <tr>
              {% if file_diff.total != 0 %}
                {% if file_diff.insertions_percentage > 0.0 %}
                  <td class="diffstat-addition" style="width: {{ file_diff.insertions_percentage }}%;"></td>
                {% endif %}
                {% if file_diff.deletions_percentage > 0.0 %}
                  <td class="diffstat-deletion" style="width: {{ file_diff.deletions_percentage }}%;"></td>
                {% endif %}
              {% endif %}
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
  {% endfor %}
  </tbody>
</table>
<pre class="diff">{{ diff.stats }}
{{ diff.output|safe }}</pre>
{% endblock %}