Attachment 'quicklink.patch'
Download 1 --- moin-1.6.orig/MoinMoin/theme/__init__.py 2007-12-01 17:11:30.000000000 +0200
2 +++ moin-1.6/MoinMoin/theme/__init__.py 2007-12-01 17:11:55.000000000 +0200
3 @@ -1219,10 +1219,10 @@
4
5 _ = self.request.getText
6 if self.request.user.isQuickLinkedTo([page.page_name]):
7 - text = _("Remove Link", formatted=False)
8 + action, text = 'quickunlink', _("Remove Link", formatted=False)
9 else:
10 - text = _("Add Link", formatted=False)
11 - return page.link_to(self.request, text=text, querystr={'action': 'quicklink'}, css_class='nbquicklink', rel='nofollow')
12 + action, text = 'quicklink', _("Add Link", formatted=False)
13 + return page.link_to(self.request, text=text, querystr={'action': action}, css_class='nbquicklink', rel='nofollow')
14
15 def attachmentsLink(self, page):
16 """ Return link to page attachments """
17
18 --- moin-1.6.orig/MoinMoin/action/quicklink.py 2007-12-01 17:11:30.000000000 +0200
19 +++ moin-1.6/MoinMoin/action/quicklink.py 2007-12-01 17:12:07.000000000 +0200
20 @@ -15,16 +15,12 @@
21
22 if not request.user.valid:
23 msg = _("You must login to add a quicklink.", formatted=False)
24 - elif request.user.isQuickLinkedTo([pagename]):
25 - if request.user.removeQuicklink(pagename):
26 - msg = _('Your quicklink to this page has been removed.', formatted=False)
27 - else: # should not happen
28 - msg = _('Your quicklink to this page could not be removed.', formatted=False)
29 - else:
30 + elif not request.user.isQuickLinkedTo([pagename]):
31 if request.user.addQuicklink(pagename):
32 msg = _('A quicklink to this page has been added for you.', formatted=False)
33 else: # should not happen
34 msg = _('A quicklink to this page could not be added for you.', formatted=False)
35 + else:
36 + msg = _('You already have a quicklink to this page.', formatted=False)
37
38 - Page(request, pagename).send_page(msg=msg)
39 -
40 + Page(request, pagename).send_page(msg=msg)
41
42 --- moin-1.6.orig/MoinMoin/action/quickunlink.py 1970-01-01 02:00:00.000000000 +0200
43 +++ moin-1.6/MoinMoin/action/quickunlink.py 2007-12-01 17:12:07.000000000 +0200
44 @@ -0,0 +1,26 @@
45 +# -*- coding: iso-8859-1 -*-
46 +"""
47 + MoinMoin - remove a quicklink from the user's quicklinks
48 +
49 + @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
50 + 2006 MoinMoin:ThomasWaldmann
51 + @license: GNU GPL, see COPYING for details.
52 +"""
53 +from MoinMoin.Page import Page
54 +
55 +def execute(pagename, request):
56 + """ Remove the current wiki page from the user's quicklinks """
57 + _ = request.getText
58 + msg = None
59 +
60 + if not request.user.valid:
61 + msg = _("You must login to remove a quicklink.", formatted=False)
62 + elif request.user.isQuickLinkedTo([pagename]):
63 + if request.user.removeQuicklink(pagename):
64 + msg = _('Your quicklink to this page has been removed.', formatted=False)
65 + else: # should not happen
66 + msg = _('Your quicklink to this page could not be removed.', formatted=False)
67 + else:
68 + msg = _('You need to have a quicklink to this page to remove it.', formatted=False)
69 +
70 + Page(request, pagename).send_page(msg=msg)
71
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.