review/templates/index.html @ bdfacbcf700e default tip

Friendlier patch urls & mimetype

Replace /changeset/<revset>/patch/ by /changeset/<revset>.patch and set
the mimetype to text/x-diff.

This helps the browser opening the right application thanks to the
mimetype, and the application to better guess the file type thanks
to the '.patch' extension
author Christophe de Vienne <christophe@cdevienne.info>
date Fri, 19 Aug 2016 18:58:14 +0200
parents acf857ef0abe
children (none)
{% extends "base.html" %}

{% block id %}index{% endblock %}
{% block title %}{% endblock %}

{% block content %}
    <h2>Changesets</h2>
    <table>
        {% for rcset in rcsets %}
            {% set rev = rcset.target[rcset.node] %}
            {% set phase = rev.phasestr() %}
            {% set node_short = utils['node_short'](rev.node()) %}
            {% set link = "/changeset/" + node_short + "/" %}

            <tr class="{{ phase }}">
                <td class="node"><span class="rev">{{ rev.rev() }}</span><span class="sep">:</span><span class="hash">{{ node_short }}</span></td>
                <td class="user">{{ utils['person'](rev.user()) }}</td>
                <td class="desc">
                    <a class="changeset-link" href="{{ link }}">
                        {% if rev.branch() != 'default' %}
                            [{{ rev.branch() }}] 
                        {%endif%}
                        {{ utils['decode'](rev.description().splitlines()[0]) }}
                    </a>
                </td>
                <td class="stats">
                    {% with %}
                        {% set comments = rcset.comments %}
                        {% set signoffs = utils['categorize_signoffs'](rcset.signoffs) %}

                        {% if comments %}
                            <a class="badge comments" href="{{ link }}">{{ utils['len'](comments) }} comment{% if utils['len'](comments) > 1 %}s{% endif %}</a>
                        {% endif %}

                        {% if signoffs['yes'] %}
                            <a class="badge signoffs yes" href="{{ link }}">{{ signoffs['yes'] }} yes</a>
                        {% endif %}
                        {% if signoffs['neutral'] %}
                            <a class="badge signoffs neutral" href="{{ link }}">{{ signoffs['neutral'] }} neutral</a>
                        {% endif %}
                        {% if signoffs['no'] %}
                            <a class="badge signoffs no" href="{{ link }}">{{ signoffs['no'] }} no</a>
                        {% endif %}
                    {% endwith %}
                </td>
            </tr>
        {% endfor %}
    </table>

    <div class="pagination group">
        {% if not older < 0 %}
            <a class="older" href="/{{ older }}/">Older Changesets &rArr;</a>
        {% endif %}
        {% if not newer < 0 %}
            <a class="newer" href="/{{ newer }}/">&lArr; Newer Changesets</a>
        {% endif %}
    </div>
{% endblock %}