annotate MoinMoin/action/DeletePage.py @ 5250:00ca621ffbc2 1.9.0rc1

updated underlay
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 03 Nov 2009 00:40:45 +0100
parents bc5d4e7072ea
children
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3 MoinMoin - DeletePage action
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
5 This action allows you to delete a page.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
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: 2708
diff changeset
7 @copyright: 2006-2007 MoinMoin:ThomasWaldmann,
1993
93877b7d87b9 fixing copyright headers:unified my name
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1922
diff changeset
8 2007 MoinMoin:ReimarBauer
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
9 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10 """
1828
09e81597c7ce PageEditor:cache cleaning for renamePage, DeletePage, minor optimisation, RenamePage feature added to rename all subpages
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1817
diff changeset
11 import re
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
12 from MoinMoin import wikiutil
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13 from MoinMoin.PageEditor import PageEditor
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
14 from MoinMoin.action import ActionBase
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
15
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
16 class DeletePage(ActionBase):
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
17 """ Delete page action
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
18
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
19 Note: the action name is the class name
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
20 """
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
21 def __init__(self, pagename, request):
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
22 ActionBase.__init__(self, pagename, request)
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
23 self.use_ticket = True
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
24 _ = self._
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
25 self.form_trigger = 'delete'
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
26 self.form_trigger_label = _('Delete')
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: 2708
diff changeset
27 filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
3181
8d465b643237 DeletePage action: fix AttributeError
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3057
diff changeset
28 subpagenames = 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: 2708
diff changeset
29 self.subpages = [pagename for pagename in subpagenames if self.request.user.may.delete(pagename)]
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
30
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
31 def is_allowed(self):
1334
a4efeab7a10f Added security check to PageEditor.deletePage.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 889
diff changeset
32 # this is not strictly necessary because the underlying storage code checks
a4efeab7a10f Added security check to PageEditor.deletePage.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 889
diff changeset
33 # as well
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
34 may = self.request.user.may
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
35 return may.write(self.pagename) and may.delete(self.pagename)
889
ad62767ffd0c pep8 style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 876
diff changeset
36
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
37 def check_condition(self):
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
38 _ = self._
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
39 if not self.page.exists():
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
40 return _('This page is already deleted or was never created!')
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
41 else:
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
42 return None
889
ad62767ffd0c pep8 style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 876
diff changeset
43
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
44 def do_action(self):
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
45 """ Delete pagename """
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
46 form = self.form
4201
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3181
diff changeset
47 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: 1918
diff changeset
48 comment = wikiutil.clean_input(comment)
889
ad62767ffd0c pep8 style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 876
diff changeset
49
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
50 # Create a page editor that does not do editor backups, because
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
51 # delete generates a "deleted" version of the page.
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
52 self.page = PageEditor(self.request, self.pagename, do_editor_backup=0)
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: 2708
diff changeset
53 success, msgs = self.page.deletePage(comment)
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: 2708
diff changeset
54
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
55 delete_subpages = 0
4201
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3181
diff changeset
56 try:
4237
162002d5b148 Replaced some references to request.form with MultiDict-compatible semantics
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4201
diff changeset
57 delete_subpages = int(form['delete_subpages'])
4201
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3181
diff changeset
58 except:
40acd13fb3d6 Changed form access to MultiDict forms
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3181
diff changeset
59 pass
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
60
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
61 if delete_subpages and self.subpages:
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
62 for name in self.subpages:
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
63 self.page = PageEditor(self.request, name, do_editor_backup=0)
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
64 success_i, msg = self.page.deletePage(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: 2708
diff changeset
65 msgs = "%s %s" % (msgs, msg)
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
66
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
67 return success, msgs
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
68
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
69 def get_form_html(self, buttons_html):
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
70 _ = self._
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
71
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
72 if self.subpages:
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
73 subpages = ' '.join(self.subpages)
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
74
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
75 d = {
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
76 'subpage': subpages,
5205
bc5d4e7072ea action CopyPage, RenamePage, DeletePage: subpages_checked needs request.args.getfor reading this url param
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 4237
diff changeset
77 'subpages_checked': ('', 'checked')[self.request.args.get('subpages_checked', '0') == '1'],
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
78 'subpage_label': _('Delete all /subpages too?'),
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
79 'comment_label': _("Optional reason for the deletion"),
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
80 'buttons_html': buttons_html,
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
81 'querytext': _('Really delete this page?'),
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
82 }
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
83
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
84 return '''
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
85 <strong>%(querytext)s</strong>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
86 <br>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
87 <br>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
88 <table>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
89 <tr>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
90 <dd>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
91 %(subpage_label)s<input type="checkbox" name="delete_subpages" value="1" %(subpages_checked)s> </dd>
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1993
diff changeset
92 <dd><class="label"><subpage> %(subpage)s</subpage></dd>
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
93 </tr>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
94 </table>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
95 <table>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
96 <tr>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
97 <td class="label"><label>%(comment_label)s</label></td>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
98 <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
99 <input type="text" name="comment" size="80" maxlength="200">
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
100 </td>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
101 </tr>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
102 <tr>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
103 <td></td>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
104 <td class="buttons">
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
105 %(buttons_html)s
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
106 </td>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
107 </tr>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
108 </table>
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
109 ''' % d
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
110
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
111 else:
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
112 d = {
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
113 'pagename': self.pagename,
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
114 'comment_label': _("Optional reason for the deletion"),
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
115 'buttons_html': buttons_html,
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
116 'querytext': _('Really delete this page?'),
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
117 }
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
118
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
119 return '''
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
120 <strong>%(querytext)s</strong>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
121 <table>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
122 <tr>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
123 <td class="label"><label>%(comment_label)s</label></td>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
124 <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
125 <input type="text" name="comment" size="80" maxlength="200">
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
126 </td>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
127 </tr>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
128 <tr>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
129 <td></td>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
130 <td class="buttons">
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
131 %(buttons_html)s
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
132 </td>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
133 </tr>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
134 </table>
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
135 ''' % d
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
136
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
137
1817
fd22bf359a65 action:DeletePage extended to delete subpages on request
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1334
diff changeset
138
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
139 def execute(pagename, request):
610
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
140 """ Glue code for actions """
8dac4b68072b refactor RenamePage and DeletePage action to use ActionBase base class, move rename page code to PageEditor
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 332
diff changeset
141 DeletePage(pagename, request).render()
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
142