view MoinMoin/templates/diff_text.html @ 1109:b703c5e590a3

Create new template filter "shorten_revid" which shortens the specified text to 7 chars Make use of templates in history, show and diff_text HTML templates. Also, in history.html, render revids in monospace fonts.
author Bilal Akhtar <>
date Mon, 28 Nov 2011 18:09:58 -0500
parents c147baf694d9
children 5479a3b62b9f
line wrap: on
line source
{% import "utils.html" as utils %}

{% macro show_meta(rev) %}
    <div class="moin-diff-info moin-diff-info-rev-id">
        <span class="moin-diff-info-caption">Revision:</span>
        <span class="moin-diff-info-value">{{ rev.meta['revid'] | shorten_revid }}</span>
    <div class="moin-diff-info moin-diff-info-rev-author">
        <span class="moin-diff-info-caption">Editor:</span>
        <span class="moin-diff-info-value">
            {{ utils.editor_info(rev.meta) }}
    <div class="moin-diff-info moin-diff-info-rev-size">
        <span class="moin-diff-info-caption">Size:</span>
        <span class="moin-diff-info-value">{{ rev.meta['size'] }}</span>
    <div class="moin-diff-info moin-diff-info-rev-comment">
        <span class="moin-diff-info-caption">Comment:</span>
        <span class="moin-diff-info-value">{{ rev.meta['comment'] }}</span>
{% endmacro %}

<table class="moin-diff">
        <td class="moin-diff-header">
            {{ show_meta(oldrev) }}
        <td class="moin-diff-header">
            {{ show_meta(newrev) }}
        <td class="moin-diff-removed"><span>{{ _('Deletions are marked like this.') }}</span></td>
        <td class="moin-diff-added"><span>{{ _('Additions are marked like this.') }}</span></td>
    {% for llineno, lcontent, rlineno, rcontent in diffs %}
        <tr class="moin-diff-line-number">
            <td><a href="#{{ llineno }}">{{ _('Line') }} {{ llineno }}:</a></td>
            <td><a href="#{{ rlineno }}">{{ _('Line') }} {{ rlineno }}:</a></td>
            <td class="moin-diff-removed">{{ lcontent }}</td>
            <td class="moin-diff-added">{{ rcontent }}</td>
    {% endfor %}