Attachment 'Thumbnail.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - Thumbnail Macro
4 Version 0.2
5
6 [[Thumbnail(file)]]
7 Displays a thumbnail of an image attachment
8
9 @copyright: 2007 by Kenneth Bull
10 @license: GNU GPL, see COPYING for details.
11
12 """
13
14 from MoinMoin import wikiutil
15
16 def execute(macro, args):
17 return macro.formatter.url(1, url="%(script)s/%(page)s?action=AttachFile&do=get&target=%(file)s" % {'script': macro.request.getScriptname(), 'page': wikiutil.url_quote(macro.formatter.page.page_name), 'file': wikiutil.url_quote(args)}, style="display:block; float:left; padding:1px;")+ \
18 macro.formatter.image("%(script)s/%(page)s?action=Thumbnail&target=%(file)s" % {'script': macro.request.getScriptname(), 'page': wikiutil.url_quote(macro.formatter.page.page_name), 'file': wikiutil.url_quote(args)}, style="border:1px solid blue;")+ \
19 macro.formatter.url(0)
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.