view MoinMoin/templates/history.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 <bilalakhtar@ubuntu.com>
date Mon, 28 Nov 2011 18:09:58 -0500
parents 64e6be47c4f6
children 5479a3b62b9f
line wrap: on
line source
{% extends theme("show.html") %}
{% import "utils.html" as utils %}
{% block content %}
    {% set (history, next_offset, previous_offset) = history_page %}
    {% if history %}
    <div class='moin-offset-links'>
        {% if previous_offset >= 0 %}
            <a href="{{ url_for('frontend.history', item_name=item_name, offset=previous_offset) }}" title="{{ _("Previous") }}">&laquo;</a>
        {% endif %}
        {% if next_offset %}
            <a href="{{ url_for('frontend.history', item_name=item_name, offset=next_offset) }}" title="{{ _("Next") }}">&raquo;</a>
        {% endif %}
    </div>
    <h1>{{ _("History of '%(item_name)s'", item_name=item_name) }}</h1>
    <div class="moin-clr"></div>
    <form action="{{ url_for('frontend.diff', item_name=item_name) }}" method="GET">
        <div id="moin-page-history">
        <table>
            <tr>
                <th>{{ _("Name") }}</th>
                <th>{{ _("Rev.") }}</th>
                <th>{{ _("Timestamp") }}</th>
                <th>{{ _("Size") }}</th>
                <th><input type="submit" value="Diff" /></th>
                <th>{{ _("Editor") }}</th>
                <th>{{ _("Content-Type") }}</th>
                <th>{{ _("Comment") }}</th>
                <th colspan="6">{{ _("Actions") }}</th>
            </tr>
            {% for doc in history %}
            <tr>
                <td class="moin-wordbreak">{{ doc.name }}</td>
                <td class="moin-integer"><tt>{{ doc.revid|shorten_revid }}</tt></td>
                <td>{{ doc.mtime|datetimeformat }}</td>
                <td class="moin-integer">{{ doc.size }}</td>
                <td>
                    <div class="moin-hist-rev">
                        <input type="radio" name="rev1" value="{{ doc.revid }}" />
                        <input type="radio" name="rev2" value="{{ doc.revid }}" />
                    </div>
                </td>
                <td class="moin-wordbreak">{{ utils.editor_info(doc) }}</td>
                <td class="moin-wordbreak">{{ doc.contenttype }}</td>
                <td class="moin-wordbreak">{{ doc.comment }}</td>
                <td><a href="{{ url_for('frontend.show_item', item_name=doc.name, rev=doc.revid) }}">{{ _('show') }}</a></td>
                <td><a href="{{ url_for('frontend.show_item_meta', item_name=doc.name, rev=doc.revid) }}">{{ _('meta') }}</a></td>
                <td><a href="{{ url_for('frontend.download_item', item_name=doc.name, rev=doc.revid) }}">{{ _('download') }}</a></td>
                <td><a href="{{ url_for('frontend.highlight_item', item_name=doc.name, rev=doc.revid) }}">{{ _('highlight') }}</a></td>
                {% if user.may.write(item_name) -%}
                <td><a href="{{ url_for('frontend.revert_item', item_name=doc.name, rev=doc.revid) }}">{{ _('revert') }}</a></td>
                {%- endif %}
                {% if user.may.destroy(item_name) -%}
                <td><a href="{{ url_for('frontend.destroy_item', item_name=doc.name, rev=doc.revid) }}">{{ _('destroy') }}</a></td>
                {%- endif %}
            </tr>
            {% endfor %}
            {% if bookmark_time %}
            <tr> 
                <td colspan="2">Bookmark is set to</td>
                <td>{{ bookmark_time|datetimeformat }}</td>
                <td colspan="11"></td>
            </tr>
            {% endif %}
        </table>
        </div>
        </form>
    {% endif %}
{% endblock %}