annotate MoinMoin/action/CopyPage.py @ 4201:40acd13fb3d6

Changed form access to MultiDict forms
author Florian Krupicka <florian.krupicka@googlemail.com>
date Thu, 03 Jul 2008 23:36:48 +0200
parents 3b36f0cfc656
children 62177a952833
rev   line source
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
2 """
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
3 MoinMoin - CopyPage action
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
4
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
5 This action allows you to copy a page.
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
6
3057
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
7 @copyright: 2007 MoinMoin:ReimarBauer,
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
8 2007 MoinMoin:ThomasWaldmann
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
9 @license: GNU GPL, see COPYING for details.
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
10 """
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
11 import re
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
12 from MoinMoin import wikiutil
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
13 from MoinMoin.Page import Page
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
14 from MoinMoin.PageEditor import PageEditor
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
15 from MoinMoin.action import ActionBase
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
16
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
17 class CopyPage(ActionBase):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
18 """ Copy page action
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
19
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
20 Note: the action name is the class name
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
21 """
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
22 def __init__(self, pagename, request):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
23 ActionBase.__init__(self, pagename, request)
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
24 self.use_ticket = True
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
25 _ = self._
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
26 self.form_trigger = 'copy'
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
27 self.form_trigger_label = _('Copy Page')
3057
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
28 filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
29 pages = request.rootpage.getPageList(user='', exists=1, filter=filterfn)
3057
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
30 subpagenames = request.rootpage.getPageList(user='', exists=1, filter=filterfn)
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
31 self.subpages = subpagenames
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
32 self.users_subpages = [pagename for pagename in subpagenames if self.request.user.may.read(pagename)]
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
33
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
34 def is_allowed(self):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
35 may = self.request.user.may
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
36 return may.read(self.pagename)
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
37
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
38 def check_condition(self):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
39 _ = self._
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
40 if not self.page.exists():
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
41 return _('This page is already deleted or was never created!')
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
42 else:
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
43 return None
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
44
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
45 def do_action(self):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
46 """ copy this page to "pagename" """
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
47 _ = self._
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
48 form = self.form
4201
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4146
diff changeset
49 newpagename = form.get('newpagename', u'')
4146
3b36f0cfc656 (Re)moved normalizePagename from Request into wikiutil library
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3273
diff changeset
50 newpagename = wikiutil.normalize_pagename(newpagename, self.cfg)
4201
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4146
diff changeset
51 comment = form.get('comment', u'')
1922
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1850
diff changeset
52 comment = wikiutil.clean_input(comment)
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
53
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
54 self.page = PageEditor(self.request, self.pagename)
3057
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
55 success, msgs = self.page.copyPage(newpagename, comment)
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
56
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
57 copy_subpages = 0
4201
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4146
diff changeset
58 try:
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4146
diff changeset
59 copy_subpages = int(form['copy_subpages'])
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4146
diff changeset
60 except:
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4146
diff changeset
61 pass
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
62
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
63 if copy_subpages and self.subpages or (not self.users_subpages and self.subpages):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
64 for name in self.subpages:
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
65 self.page = PageEditor(self.request, name)
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
66 new_subpagename = name.replace(self.pagename, newpagename, 1)
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
67 success_i, msg = self.page.copyPage(new_subpagename, comment)
3057
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
68 msgs = "%s %s" % (msgs, msg)
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
69
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
70 self.newpagename = newpagename # keep there for finish
3057
9c58f31af69e CopyPage/RenamePage/DeletePage action: fix regex compile errors due to unescaped pagename usage, fix cosmetic bug, simplify/optimize code (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
71 return success, msgs
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
72
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
73 def do_action_finish(self, success):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
74 if success:
3234
a739558ca3dc Page.url() default changed to relative=False
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3057
diff changeset
75 url = Page(self.request, self.newpagename).url(self.request)
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
76 self.request.http_redirect(url)
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
77 self.request.finish()
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
78 else:
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2708
diff changeset
79 self.render_msg(self.make_form(), "dialog")
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
80
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
81 def get_form_html(self, buttons_html):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
82 _ = self._
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
83 if self.users_subpages:
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
84 subpages = ' '.join(self.users_subpages)
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
85
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
86 d = {
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
87 'subpage': subpages,
4201
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4146
diff changeset
88 'subpages_checked': ('', 'checked')[self.request.form.get('subpages_checked', '0') == '1'],
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
89 'subpage_label': _('Copy all /subpages too?'),
3273
9c6900a92a64 more wikiutil.escape fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3234
diff changeset
90 'pagename': wikiutil.escape(self.pagename, True),
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
91 'newname_label': _("New name"),
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
92 'comment_label': _("Optional reason for the copying"),
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
93 'buttons_html': buttons_html,
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
94 'querytext': _('Really copy this page?')
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
95 }
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
96
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
97 return '''
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
98 <strong>%(querytext)s</strong>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
99 <br>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
100 <br>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
101 <table>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
102 <tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
103 <dd>
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1993
diff changeset
104 %(subpage_label)s<input type="checkbox" name="copy_subpages" value="1" %(subpages_checked)s>
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
105 </dd>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
106 <dd>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
107 <class="label"><subpage> %(subpage)s</subpage>
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1993
diff changeset
108 </dd>
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
109 </tr>
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1993
diff changeset
110 </table>
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
111 <table>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
112 <tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
113 <td class="label"><label>%(newname_label)s</label></td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
114 <td class="content">
2708
5092edd82058 bug fix for non css browsers like w3m: for input fields set size of textarea and text to cols="80"
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2286
diff changeset
115 <input type="text" name="newpagename" value="%(pagename)s" size="80">
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
116 </td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
117 </tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
118 <tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
119 <td class="label"><label>%(comment_label)s</label></td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
120 <td class="content">
2708
5092edd82058 bug fix for non css browsers like w3m: for input fields set size of textarea and text to cols="80"
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2286
diff changeset
121 <input type="text" name="comment" size="80" maxlength="200">
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
122 </td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
123 </tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
124 <tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
125 <td></td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
126 <td class="buttons">
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
127 %(buttons_html)s
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
128 </td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
129 </tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
130 </table>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
131 ''' % d
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
132
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
133 else:
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
134 d = {
3273
9c6900a92a64 more wikiutil.escape fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3234
diff changeset
135 'pagename': wikiutil.escape(self.pagename, True),
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
136 'newname_label': _("New name"),
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
137 'comment_label': _("Optional reason for the copying"),
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
138 'buttons_html': buttons_html,
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
139 }
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
140 return '''
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
141 <table>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
142 <tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
143 <td class="label"><label>%(newname_label)s</label></td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
144 <td class="content">
2708
5092edd82058 bug fix for non css browsers like w3m: for input fields set size of textarea and text to cols="80"
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2286
diff changeset
145 <input type="text" name="newpagename" value="%(pagename)s" size="80">
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
146 </td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
147 </tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
148 <tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
149 <td class="label"><label>%(comment_label)s</label></td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
150 <td class="content">
2708
5092edd82058 bug fix for non css browsers like w3m: for input fields set size of textarea and text to cols="80"
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2286
diff changeset
151 <input type="text" name="comment" size="80" maxlength="200">
1850
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
152 </td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
153 </tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
154 <tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
155 <td></td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
156 <td class="buttons">
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
157 %(buttons_html)s
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
158 </td>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
159 </tr>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
160 </table>
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
161 ''' % d
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
162
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
163 def execute(pagename, request):
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
164 """ Glue code for actions """
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
165 CopyPage(pagename, request).render()
3d38db210672 action CopyPage added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
166