changeset 5090:3aed6e5c26e5

fix info action's edit links for twikidraw/anywikidraw drawings
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 12 Sep 2009 19:02:41 +0200
parents 899b4b2cd7d5
children 6cfcb25278a7
files MoinMoin/action/info.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/info.py	Sat Sep 12 18:44:26 2009 +0200
+++ b/MoinMoin/action/info.py	Sat Sep 12 19:02:41 2009 +0200
@@ -143,7 +143,13 @@
                     if line.action == 'ATTNEW':
                         actions.append(render_action(_('view'), {'action': 'AttachFile', 'do': 'view', 'target': '%s' % filename}))
                     elif line.action == 'ATTDRW':
-                        actions.append(render_action(_('edit'), {'action': 'AttachFile', 'drawing': '%s' % filename.replace(".tdraw", "")}))
+                        if filename.endswith('.tdraw'):
+                            action = 'twikidraw'
+                            target = filename[:-6]
+                        elif filename.endswith('.adraw'):
+                            action = 'anywikidraw'
+                            target = filename[:-6]
+                        actions.append(render_action(_('edit'), dict(action=action, target=target)))
 
                     actions.append(render_action(_('get'), {'action': 'AttachFile', 'do': 'get', 'target': '%s' % filename}))
                     if request.user.may.delete(pagename):