annotate MoinMoin/action/info.py @ 6103:500f68d3e2fd

remove our own usage of python_compatibility module
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Sep 2016 01:00:25 +0200
parents 48c7d851938f
children
rev   line source
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - info action
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 Displays page history, some general page infos and statistics.
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1914
diff changeset
7 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
3290
abb32b0af96b revision history: enable the user to get more revisions show by using max_count=123, enable wiki admin to limit that
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3270
diff changeset
8 2006-2008 MoinMoin:ThomasWaldmann
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 @license: GNU GPL, see COPYING for details.
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 """
6103
500f68d3e2fd remove our own usage of python_compatibility module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5527
diff changeset
11 import hashlib
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13 from MoinMoin import config, wikiutil, action
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14 from MoinMoin.Page import Page
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 from MoinMoin.logfile import editlog
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
16 from MoinMoin.widget import html
5102
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
17 from MoinMoin.action import AttachFile
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 def execute(pagename, request):
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
20 """ show misc. infos about a page """
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21 if not request.user.may.read(pagename):
1777
ed44b93599b5 remove unneeded request param from page.send_page()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1776
diff changeset
22 Page(request, pagename).send_page()
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
23 return
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
24
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
25 def general(page, pagename, request):
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26 _ = request.getText
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
27 f = request.formatter
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
28
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
29 request.write(f.heading(1, 1),
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
30 f.text(_('General Information')),
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
31 f.heading(0, 1))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
32
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
33 request.write(f.paragraph(1),
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
34 f.text(_("Page size: %d") % page.size()),
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
35 f.paragraph(0))
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
36
6103
500f68d3e2fd remove our own usage of python_compatibility module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5527
diff changeset
37 digest = hashlib.new('sha1', page.get_raw_body().encode(config.charset)).hexdigest().upper()
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
38 request.write(f.paragraph(1),
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
39 f.rawHTML('%(label)s <tt>%(value)s</tt>' % {
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
40 'label': _("SHA digest of this page's content is:"),
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
41 'value': digest, }),
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
42 f.paragraph(0))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
43
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
44 # show attachments (if allowed)
5168
61ce73eb13a0 action.getHandler(): make it moin 1.8 compatible again
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5102
diff changeset
45 attachment_info = action.getHandler(request, 'AttachFile', 'info')
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
46 if attachment_info:
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
47 request.write(attachment_info(pagename, request))
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
48
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
49 # show subscribers
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
50 subscribers = page.getSubscribers(request, include_self=1, return_users=1)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
51 if subscribers:
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
52 request.write(f.paragraph(1))
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
53 request.write(f.text(_('The following users subscribed to this page:')))
1870
9406e02388cf reduce usage of .keys()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1832
diff changeset
54 for lang in subscribers:
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
55 request.write(f.linebreak(), f.text('[%s] ' % lang))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
56 for user in subscribers[lang]:
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
57 # do NOT disclose email addr, only WikiName
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
58 userhomepage = Page(request, user.name)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
59 if userhomepage.exists():
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
60 request.write(f.rawHTML(userhomepage.link_to(request) + ' '))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
61 else:
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
62 request.write(f.text(user.name + ' '))
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
63 request.write(f.paragraph(0))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
64
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
65 # show links
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
66 links = page.getPageLinks(request)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
67 if links:
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
68 request.write(f.paragraph(1))
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
69 request.write(f.text(_('This page links to the following pages:')))
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
70 request.write(f.linebreak())
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
71 for linkedpage in links:
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
72 request.write(f.rawHTML("%s%s " % (Page(request, linkedpage).link_to(request), ",."[linkedpage == links[-1]])))
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
73 request.write(f.paragraph(0))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
74
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
75 def history(page, pagename, request):
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
76 # show history as default
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
77 _ = request.getText
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
78 default_count, limit_max_count = request.cfg.history_count[0:2]
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
79 paging = request.cfg.history_paging
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
80
3290
abb32b0af96b revision history: enable the user to get more revisions show by using max_count=123, enable wiki admin to limit that
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3270
diff changeset
81 try:
4424
5ad5753ae311 pre-1.9: request.form has qs args and post data, 1.9: .form only post data, .args only qs args, .values both
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4376
diff changeset
82 max_count = int(request.values.get('max_count', default_count))
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
83 except ValueError:
3290
abb32b0af96b revision history: enable the user to get more revisions show by using max_count=123, enable wiki admin to limit that
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3270
diff changeset
84 max_count = default_count
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
85 max_count = max(1, min(max_count, limit_max_count))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
86
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
87 # read in the complete log of this page
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
88 log = editlog.EditLog(request, rootpagename=pagename)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
89
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
90 offset = 0
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
91 paging_info_html = ""
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
92 paging_nav_html = ""
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
93 count_select_html = ""
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
94
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
95 f = request.formatter
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
96
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
97 if paging:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
98 log_size = log.lines()
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
99
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
100 try:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
101 offset = int(request.values.get('offset', 0))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
102 except ValueError:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
103 offset = 0
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
104 offset = max(min(offset, log_size - 1), 0)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
105
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
106 paging_info_html += f.paragraph(1, css_class="searchstats info-paging-info") + _("Showing page edit history entries from '''%(start_offset)d''' to '''%(end_offset)d''' out of '''%(total_count)d''' entries total.", wiki=True) % {
5527
48c7d851938f info action: reversed order of numbering offsets in links nad info message in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5518
diff changeset
107 'start_offset': log_size - min(log_size, offset + max_count) + 1,
48c7d851938f info action: reversed order of numbering offsets in links nad info message in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5518
diff changeset
108 'end_offset': log_size - offset,
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
109 'total_count': log_size,
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
110 } + f.paragraph(0)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
111
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
112 # generating offset navigating links
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
113 if max_count < log_size or offset != 0:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
114 offset_links = []
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
115 cur_offset = max_count
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
116 near_count = 5 # request.cfg.pagination_size
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
117
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
118 min_offset = max(0, (offset + max_count - 1) / max_count - near_count)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
119 max_offset = min((log_size - 1) / max_count, offset / max_count + near_count)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
120 offset_added = False
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
121
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
122 def add_offset_link(offset, caption=None):
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
123 offset_links.append(f.table_cell(1, css_class="info-offset-item") +
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
124 page.link_to(request, on=1, querystr={
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
125 'action': 'info',
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
126 'offset': str(offset),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
127 'max_count': str(max_count),
5527
48c7d851938f info action: reversed order of numbering offsets in links nad info message in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5518
diff changeset
128 }, css_class="info-offset-nav-link", rel="nofollow") + f.text(caption or str(log_size - offset)) + page.link_to(request, on=0) +
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
129 f.table_cell(0)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
130 )
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
131
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
132 # link to previous page - only if not at start
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
133 if offset > 0:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
134 add_offset_link(((offset - 1) / max_count) * max_count, _("Newer"))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
135
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
136 # link to beggining of event log - if min_offset is not minimal
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
137 if min_offset > 0:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
138 add_offset_link(0)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
139 # adding gap only if min_offset not explicitly following beginning
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
140 if min_offset > 1:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
141 offset_links.append(f.table_cell(1, css_class="info-offset-gap") + f.text(u'\u2026') + f.table_cell(0))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
142
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
143 # generating near pages links
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
144 for cur_offset in range(min_offset, max_offset + 1):
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
145 # note that current offset may be not multiple of max_count,
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
146 # so we check whether we should add current offset marker like this
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
147 if not offset_added and offset <= cur_offset * max_count:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
148 # current info history view offset
5527
48c7d851938f info action: reversed order of numbering offsets in links nad info message in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5518
diff changeset
149 offset_links.append(f.table_cell(1, css_class="info-offset-item info-cur-offset") + f.text(str(log_size - offset)) + f.table_cell(0))
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
150 offset_added = True
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
151
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
152 # add link, if not at this offset
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
153 if offset != cur_offset * max_count:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
154 add_offset_link(cur_offset * max_count)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
155
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
156 # link to the last page of event log
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
157 if max_offset < (log_size - 1) / max_count:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
158 if max_offset < (log_size - 1) / max_count - 1:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
159 offset_links.append(f.table_cell(1, css_class="info-offset-gap") + f.text(u'\u2026') + f.table_cell(0))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
160 add_offset_link(((log_size - 1) / max_count) * max_count)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
161
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
162 # special case - if offset is greater than max_offset * max_count
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
163 if offset > max_offset * max_count:
5527
48c7d851938f info action: reversed order of numbering offsets in links nad info message in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5518
diff changeset
164 offset_links.append(f.table_cell(1, css_class="info-offset-item info-cur-offset") + f.text(str(log_size - offset)) + f.table_cell(0))
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
165
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
166 # link to next page
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
167 if offset < (log_size - max_count):
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
168 add_offset_link(((offset + max_count) / max_count) * max_count, _("Older"))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
169
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
170 # generating html
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
171 paging_nav_html += "".join([
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
172 f.table(1, css_class="searchpages"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
173 f.table_row(1),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
174 "".join(offset_links),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
175 f.table_row(0),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
176 f.table(0),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
177 ])
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
178
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
179 # generating max_count switcher
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
180 # we do it only in case history_count has additional values
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
181 if len(request.cfg.history_count) > 2:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
182 max_count_possibilities = list(set(request.cfg.history_count))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
183 max_count_possibilities.sort()
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
184 max_count_html = []
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
185 cur_count_added = False
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
186
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
187
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
188 for count in max_count_possibilities:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
189 # max count value can be not in list of predefined values
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
190 if max_count <= count and not cur_count_added:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
191 max_count_html.append("".join([
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
192 f.span(1, css_class="info-count-item info-cur-count"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
193 f.text(str(max_count)),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
194 f.span(0),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
195 ]))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
196 cur_count_added = True
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
197
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
198 # checking for limit_max_count to prevent showing unavailable options
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
199 if max_count != count and count <= limit_max_count:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
200 max_count_html.append("".join([
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
201 f.span(1, css_class="info-count-item"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
202 page.link_to(request, on=1, querystr={
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
203 'action': 'info',
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
204 'offset': str(offset),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
205 'max_count': str(count),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
206 }, css_class="info-count-link", rel="nofollow"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
207 f.text(str(count)),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
208 page.link_to(request, on=0),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
209 f.span(0),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
210 ]))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
211
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
212 count_select_html += "".join([
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
213 f.span(1, css_class="info-count-selector"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
214 f.text(" ("),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
215 f.text(_("%s items per page")) % (f.span(1, css_class="info-count-selector info-count-selector-divider") + f.text(" | ") + f.span(0)).join(max_count_html),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
216 f.text(")"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
217 f.span(0),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
218 ])
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
219
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
220 # open log for this page
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
221 from MoinMoin.util.dataset import TupleDataset, Column
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
222
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
223 history = TupleDataset()
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
224 history.columns = [
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
225 Column('rev', label='#', align='right'),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
226 Column('mtime', label=_('Date'), align='right'),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
227 Column('size', label=_('Size'), align='right'),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
228 Column('diff', label='<input type="submit" value="%s">' % (_("Diff"))),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
229 Column('editor', label=_('Editor'), hidden=not request.cfg.show_names),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
230 Column('comment', label=_('Comment')),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
231 Column('action', label=_('Action')),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
232 ]
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
233
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
234 # generate history list
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
235
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
236 def render_action(text, query, **kw):
1283
e26799c574b0 small bugfix for info action
Franz Pletz <fpletz AT franz-pletz DOT org>
parents: 1129
diff changeset
237 kw.update(dict(rel='nofollow'))
1920
b06ef2a53efa 'make pylint', fixed lots of minor stuff found by pylint (and there is still lots left to do)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
238 return page.link_to(request, text, querystr=query, **kw)
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
239
5102
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
240 def render_file_action(text, pagename, filename, request, do):
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
241 url = AttachFile.getAttachUrl(pagename, filename, request, do=do)
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
242 if url:
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
243 f = request.formatter
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
244 link = f.url(1, url) + f.text(text) + f.url(0)
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
245 return link
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
246
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
247 may_write = request.user.may.write(pagename)
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
248 may_delete = request.user.may.delete(pagename)
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
249
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
250 count = 0
3345
41e04736a9f1 info action: fix buglet with diff defaults
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3344
diff changeset
251 pgactioncount = 0
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
252 for line in log.reverse():
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
253 count += 1
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
254
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
255 if paging and count <= offset:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
256 continue
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
257
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
258 rev = int(line.rev)
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
259 actions = []
1713
1f18d08ec3ba better display of renamed pages on info/RC, show diff-link for deleted pages on RC
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1683
diff changeset
260 if line.action in ('SAVE', 'SAVENEW', 'SAVE/REVERT', 'SAVE/RENAME', ):
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
261 size = page.size(rev=rev)
3343
04548b25e042 info action: always use recall to allow sending the link
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3290
diff changeset
262 actions.append(render_action(_('view'), {'action': 'recall', 'rev': '%d' % rev}))
3345
41e04736a9f1 info action: fix buglet with diff defaults
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3344
diff changeset
263 if pgactioncount == 0:
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
264 rchecked = ' checked="checked"'
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
265 lchecked = ''
3345
41e04736a9f1 info action: fix buglet with diff defaults
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3344
diff changeset
266 elif pgactioncount == 1:
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
267 lchecked = ' checked="checked"'
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
268 rchecked = ''
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
269 else:
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
270 lchecked = rchecked = ''
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
271 diff = '<input type="radio" name="rev1" value="%d"%s><input type="radio" name="rev2" value="%d"%s>' % (rev, lchecked, rev, rchecked)
3344
dba9666479a9 info action: add 'diff to previous' link
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3343
diff changeset
272 if rev > 1:
dba9666479a9 info action: add 'diff to previous' link
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3343
diff changeset
273 diff += render_action(' ' + _('to previous'), {'action': 'diff', 'rev1': rev-1, 'rev2': rev})
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
274 comment = line.comment
1713
1f18d08ec3ba better display of renamed pages on info/RC, show diff-link for deleted pages on RC
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1683
diff changeset
275 if not comment:
1f18d08ec3ba better display of renamed pages on info/RC, show diff-link for deleted pages on RC
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1683
diff changeset
276 if '/REVERT' in line.action:
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
277 comment = _("Revert to revision %(rev)d.") % {'rev': int(line.extra)}
1713
1f18d08ec3ba better display of renamed pages on info/RC, show diff-link for deleted pages on RC
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1683
diff changeset
278 elif '/RENAME' in line.action:
1f18d08ec3ba better display of renamed pages on info/RC, show diff-link for deleted pages on RC
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1683
diff changeset
279 comment = _("Renamed from '%(oldpagename)s'.") % {'oldpagename': line.extra}
3345
41e04736a9f1 info action: fix buglet with diff defaults
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3344
diff changeset
280 pgactioncount += 1
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
281 else: # ATT*
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
282 rev = '-'
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
283 diff = '-'
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
284
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
285 filename = wikiutil.url_unquote(line.extra)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
286 comment = "%s: %s %s" % (line.action, filename, line.comment)
5102
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
287 if AttachFile.exists(request, pagename, filename):
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
288 size = AttachFile.size(request, pagename, filename)
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
289 actions.append(render_file_action(_('view'), pagename, filename, request, do='view'))
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
290 actions.append(render_file_action(_('get'), pagename, filename, request, do='get'))
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
291 if may_delete:
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
292 actions.append(render_file_action(_('del'), pagename, filename, request, do='del'))
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
293 if may_write:
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
294 actions.append(render_file_action(_('edit'), pagename, filename, request, do='modify'))
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
295 else:
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
296 size = 0
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
297
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
298 history.addRow((
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
299 rev,
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
300 request.user.getFormattedDateTime(wikiutil.version2timestamp(line.ed_time_usecs)),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
301 str(size),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
302 diff,
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
303 line.getEditor(request) or _("N/A"),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
304 wikiutil.escape(comment) or '&nbsp;',
5102
9ae242080889 drawings/attachments: made editing support more generic (details see below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5090
diff changeset
305 "&nbsp;".join(a for a in actions if a),
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
306 ))
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
307 if (count >= max_count + offset) or (paging and count >= log_size):
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
308 break
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
309
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
310 # print version history
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
311 from MoinMoin.widget.browser import DataBrowserWidget
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
312
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
313 request.write(unicode(html.H2().append(_('Revision History'))))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
314
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
315 if not count: # there was no entry in logfile
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
316 request.write(_('No log entries found.'))
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
317 return
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
318
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
319 history_table = DataBrowserWidget(request)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
320 history_table.setData(history)
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
321
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
322 div = html.DIV(id="page-history")
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
323 div.append(html.INPUT(type="hidden", name="action", value="diff"))
4093
742cabb168b9 browser._format: refactored input parameter "method". The default value is changed from "GET" to None. Now it does not add a form tag to the table on default. You have to give a value of "GET" or "POST" to add a form tag using the given method.
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3907
diff changeset
324 div.append(history_table.render(method="GET"))
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
325
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
326 form = html.FORM(method="GET", action="")
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
327 if paging:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
328 form.append(f.div(1, css_class="info-paging-info") + paging_info_html + count_select_html + f.div(0))
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
329 form.append("".join([
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
330 f.div(1, css_class="info-paging-nav info-paging-nav-top"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
331 paging_nav_html,
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
332 f.div(0),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
333 ]))
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
334 form.append(div)
5518
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
335 if paging:
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
336 form.append("".join([
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
337 f.div(1, css_class="info-paging-nav info-paging-nav-bottom"),
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
338 paging_nav_html,
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
339 f.div(0)
b23b1d2b1391 info action: added pagination in history viewer.
Eugene Syromyatnikov <evgsyr@gmail.com>
parents: 5168
diff changeset
340 ]))
1129
4d0f0ecc7880 cleaned up info action, TODO: use buttons - code there, but doesnt work
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
341 request.write(unicode(form))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
342
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
343 # main function
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
344 _ = request.getText
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
345 page = Page(request, pagename)
1776
fc75423e26a8 remove unneeded request param from page.split_title()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1713
diff changeset
346 title = page.split_title()
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
347
1880
b07b4c102d3d began refactoring send_page(): processing instruction extraction, getting meta/data part of page only, fixed related problems with language detection. Removed lots of duplicate or unused code.
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1873
diff changeset
348 request.setContentLanguage(request.lang)
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
349 f = request.formatter
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
350
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2000
diff changeset
351 request.theme.send_title(_('Info for "%s"') % (title, ), page=page)
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
352 menu_items = [
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
353 (_('Show "%(title)s"') % {'title': _('Revision History')},
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
354 {'action': 'info'}),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
355 (_('Show "%(title)s"') % {'title': _('General Page Infos')},
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
356 {'action': 'info', 'general': '1'}),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
357 (_('Show "%(title)s"') % {'title': _('Page hits and edits')},
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
358 {'action': 'info', 'hitcounts': '1'}),
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
359 ]
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
360 request.write(f.div(1, id="content")) # start content div
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
361 request.write(f.paragraph(1))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
362 for text, querystr in menu_items:
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
363 request.write("[%s] " % page.link_to(request, text=text, querystr=querystr, rel='nofollow'))
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
364 request.write(f.paragraph(0))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
365
4424
5ad5753ae311 pre-1.9: request.form has qs args and post data, 1.9: .form only post data, .args only qs args, .values both
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4376
diff changeset
366 show_hitcounts = int(request.values.get('hitcounts', 0)) != 0
5ad5753ae311 pre-1.9: request.form has qs args and post data, 1.9: .form only post data, .args only qs args, .values both
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4376
diff changeset
367 show_general = int(request.values.get('general', 0)) != 0
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
368
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
369 if show_hitcounts:
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
370 from MoinMoin.stats import hitcounts
4660
f4e386e03434 fix quoting for pagehits stats (info action) - was not working for pagenames with blanks
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4363
diff changeset
371 request.write(hitcounts.linkto(pagename, request, 'page=' + wikiutil.url_quote(pagename)))
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
372 elif show_general:
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
373 general(page, pagename, request)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
374 else:
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
375 history(page, pagename, request)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
376
1383
fdb726f0f34f make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1347
diff changeset
377 request.write(f.div(0)) # end content div
1016
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
378 request.theme.send_footer(pagename)
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
379 request.theme.send_closing_html()
8b196cdb11e8 move info action code to own file, fix some links by using page.link_to
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
380