annotate MoinMoin/templates/global_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 51475954290f
children a974190eaeda f2d8c602dbb6
rev   line source
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 {% extends theme("layout.html") %}
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 {% import "utils.html" as utils %}
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4 {% block head %}
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 {{ super() }}
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
6 <link rel="alternate" title="Global History" href="{{ url_for('feed.atom') }}" type="application/atom+xml" />
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 {% endblock %}
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 {% block content %}
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 <h1>{{ _("Global History") }}</h1>
468
511a2a2e9950 paging of history results, currently without the option of setting count per page
Akash Sinha <akash2607@gmail.com>
parents: 465
diff changeset
11 <div class='moin-clr'></div>
454
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
12 <div id="moin-global-history">
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
13 {% for day, revs in history %}
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
14 {% set latest_timestamp = revs[0].meta['mtime'] %}
454
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
15 <div class="moin-history-container">
465
3076415fdaba Bookmark functionality added for the global history results
Akash Sinha <akash2607@gmail.com>
parents: 464
diff changeset
16 <div class="moin-history-container-header">
3076415fdaba Bookmark functionality added for the global history results
Akash Sinha <akash2607@gmail.com>
parents: 464
diff changeset
17 <span>
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
18 <h2>{{ day }}</h2>
465
3076415fdaba Bookmark functionality added for the global history results
Akash Sinha <akash2607@gmail.com>
parents: 464
diff changeset
19 {% if user.valid %}
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
20 <a class="bookmark-link" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
465
3076415fdaba Bookmark functionality added for the global history results
Akash Sinha <akash2607@gmail.com>
parents: 464
diff changeset
21 {% endif %}
3076415fdaba Bookmark functionality added for the global history results
Akash Sinha <akash2607@gmail.com>
parents: 464
diff changeset
22 </span>
3076415fdaba Bookmark functionality added for the global history results
Akash Sinha <akash2607@gmail.com>
parents: 464
diff changeset
23 </div>
454
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
24 <div class="moin-history-container-body">
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
25 <table>
457
f1f88b7b17fa some variable names modified.
Akash Sinha <akash2607@gmail.com>
parents: 454
diff changeset
26 {% for rev in revs %}
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
27 {% set meta = rev.meta %}
464
58a29a7fd016 grouping of the global history results on item name and date basis (code cleaned)
Akash Sinha <akash2607@gmail.com>
parents: 460
diff changeset
28 <tr>
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
29 <td class="moin-action">
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
30 <span class="moin-history-{{ meta.action|lower }}"></span>
473
b33a2dca5e8f diff link added on global history page, to view diff between latest revision and first revision
Akash Sinha <akash2607@gmail.com>
parents: 470
diff changeset
31 </td>
464
58a29a7fd016 grouping of the global history results on item name and date basis (code cleaned)
Akash Sinha <akash2607@gmail.com>
parents: 460
diff changeset
32 <td class="moin-history-links">
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
33 <a href="{{ url_for('frontend.history', item_name=meta.name, bookmark=bookmark_time) }}">HIST</a>
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
34 {% if bookmark_time -%}
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
35 <a href="{{ url_for('frontend.diff', item_name=meta.name, bookmark=bookmark_time) }}">DIFF</a>
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
36 {%- endif %}
464
58a29a7fd016 grouping of the global history results on item name and date basis (code cleaned)
Akash Sinha <akash2607@gmail.com>
parents: 460
diff changeset
37 </td>
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
38 <td class="moin-history-time">{{ meta.mtime|timeformat }}</td>
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
39 <td class="moin-history-item"><a class="{{ meta.contenttype|contenttype_to_class }}" href="{{ url_for('frontend.show_item', item_name=meta.name) }}" title="{{ meta.contenttype }}">{{ meta.name }}</a></td>
464
58a29a7fd016 grouping of the global history results on item name and date basis (code cleaned)
Akash Sinha <akash2607@gmail.com>
parents: 460
diff changeset
40 </tr>
454
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
41 {% endfor %}
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
42 </table>
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
43 </div>
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
44 </div>
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
45 {% endfor %}
918
764f209d1eae simplify global history (and make it faster), bookmark changes for diff and history
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 905
diff changeset
46 {% if bookmark_time %}
771
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
47 <div class="moin-history-container">
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
48 <div class="moin-history-container-header">
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
49 <span>
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
50 <h2>{{ bookmark_time|datetimeformat }}</h2>
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
51 <a href="{{ url_for('frontend.bookmark', time='del') }}">{{ _("Delete bookmark") }}</a>
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
52 </span>
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
53 </div>
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
54 </div>
e5b51d4304c8 global history: render the bookmark in same way as the day headers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 770
diff changeset
55 {% endif %}
454
b07dfe4ceb8d Grouping of global history done on the date basis.
Akash Sinha <akash2607@gmail.com>
parents: 216
diff changeset
56 </div>
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
57 {% endblock %}