view MoinMoin/templates/history.html @ 918:764f209d1eae storage-ng

simplify global history (and make it faster), bookmark changes for diff and history global history was much too slow. even with a relatively small wiki with 5000 revisions total, it needed >60s on my machine to render. it was because the code needed all these revisions to be created (including ACL checks, etc.). i changed this to a much simpler global history that just uses the latest-revs index now and ONLY displays the latest change for every item, so we never need to access the usually 10x bigger all-revs index. i also removed display of editors / commit comments, because we could only display the editor and comment of the latest edit, but not of any previous edit, so we better do not display any of this data. users interested in details are expected to klick on the diff and history links provided. they both use the bookmark (if the user has one) and show the diff or history until the bookmark. put diff and diffsince into one view, just different url args. removed paging support from global history. the way it worked, it was much too slow anyway. users are encouraged to use the bookmark functionality to limit the amount of information displayed on global history. to avoid the worst case of getting an extremely big global history for new users without bookmark, there is a internal limit of 1000 entries.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 03 Oct 2011 00:08:56 +0200
parents 03efad0ebc90
children 64e6be47c4f6
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 %}
    <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">
                <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>
            {% for doc in history %}
                <td class="moin-wordbreak">{{ }}</td>
                <td class="moin-integer">{{ doc.revid }}</td>
                <td>{{ doc.mtime|datetimeformat }}</td>
                <td class="moin-integer">{{ doc.size }}</td>
                    <div class="moin-hist-rev">
                        <input type="radio" name="rev1" value="{{ doc.revid }}" />
                        <input type="radio" name="rev2" value="{{ doc.revid }}" />
                <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',, rev=doc.revid) }}">{{ _('show') }}</a></td>
                <td><a href="{{ url_for('frontend.show_item_meta',, rev=doc.revid) }}">{{ _('meta') }}</a></td>
                <td><a href="{{ url_for('frontend.download_item',, rev=doc.revid) }}">{{ _('download') }}</a></td>
                <td><a href="{{ url_for('frontend.highlight_item',, rev=doc.revid) }}">{{ _('highlight') }}</a></td>
                <td><a href="{{ url_for('frontend.revert_item',, rev=doc.revid) }}">{{ _('revert') }}</a></td>
                <td><a href="{{ url_for('frontend.destroy_item',, rev=doc.revid) }}">{{ _('destroy') }}</a></td>
            {% endfor %}
            {% if bookmark_time %}
                <td colspan="2">Bookmark is set to</td>
                <td>{{ bookmark_time|datetimeformat }}</td>
                <td colspan="11"></td>
            {% endif %}
    {% endif %}
{% endblock %}