review/templates/pieces/comment.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 0dc141617716
children (none)
{% if comment.style == 'markdown' %}
    {% set rendered = utils['markdown'](comment.message) %}
{% endif %}
{% if comment.node != rev.hex() %}
    {% set obsolete = True %}
    {% set obsclass = ' obsolete' %}
{% endif %}

<div class="comment group{{ obsclass }}" id="comment-{{ comment.identifier }}">
    <a href="#comment-{{ comment.identifier }}" rel="comments" class="expand" id="comment-expand-{{ comment.identifier }}">&rarr;</a>
    <script type="text/javascript">
        $(function() {
            $("#comment-expand-{{ comment.identifier }}").colorbox({inline: true, href: "#comment-{{ comment.identifier }}-colorboxed"});
        });
    </script>

    <div class="avatar">
        <img src="{{ utils['item_gravatar'](comment, 30) }}" />
    </div>
    <div>
        <div class="author">
            <a href="mailto:{{ utils['email'](comment.author) }}">{{ utils['templatefilters'].person(comment.author) }}</a>
            said:
        </div>

        {% if comment.style == 'markdown' %}
            <div class="message markdown">{{ rendered|safe }}</div>
        {% else %}
            <div class="message plain">{{ comment.message }}</div>
        {% endif %}
    </div>

    <div id="comment-{{ comment.identifier }}-colorboxed" class="colorboxed">
        <div class="avatar">
            <img src="{{ utils['item_gravatar'](comment, 30) }}" />
        </div>
        <div>
            <div class="author">
                <a href="mailto:{{ utils['email'](comment.author) }}">{{ utils['templatefilters'].person(comment.author) }}</a>
                said:
            </div>
            <div class="context">
                {% if comment.ufilename %}
                    <div class="context-head">on {{ comment.ufilename }}</div>
                {% elif obsolete %}
                    <div class="context-head">on changeset obsolete
                        {{ utils['node_short'](comment.node.decode('hex')) }}</div>
                {% else %}
                    <div class="context-head">on changeset {{ rev.rev() }}:{{ utils['node_short'](rev.node()) }}</div>
                {% endif %}
            </div>
            <div class="message">{{ comment.message }}</div>
        </div>
    </div>
    {% if not read_only %}
        {% include "pieces/forms/comment-change.html" %}
    {% endif %}
</div>