Attachment 'text_html.diff'
Download 1 --- text_html_old.py 2007-02-18 15:42:50.000000000 +0100
2 +++ text_html.py 2007-02-18 16:56:40.000000000 +0100
3 @@ -642,9 +642,13 @@
4 wikiutil.url_quote_plus(fname))),
5 linktext % {'filename': self.text(fname)})
6 target = AttachFile.getAttachUrl(pagename, filename, self.request)
7 - return (self.url(1, target, css='attachment', title="attachment:%s" % url) +
8 + fsize = float(os.stat(fpath)[6]) # in byte
9 + fsize = "%.1f" % (fsize / 1024)
10 + title = _('Attachment: %(url)s')
11 + return (self.url(1, target, css='attachment', title=title % {'url': self.text(url)}) +
12 self.text(text) +
13 - self.url(0))
14 + self.url(0) +
15 + self.text(' (%(fsize)s KB)' % {'fsize': fsize}))
16
17 def attachment_image(self, url, **kw):
18 _ = self.request.getText
19 @@ -659,8 +663,12 @@
20 (wikiutil.quoteWikinameURL(pagename),
21 wikiutil.url_quote_plus(fname))),
22 linktext % {'filename': self.text(fname)})
23 + title = _('Attachment: %(url)s') % {'url': self.text(url)}
24 + if not 'alt' in kw:
25 + kw['alt'] = _('Inlined image: %(url)s') % {'url': self.text(url)}
26 return self.image(
27 - title="attachment:%s" % url,
28 + title=title,
29 + alt=kw['alt'],
30 src=AttachFile.getAttachUrl(pagename, filename, self.request, addts=1),
31 css="attachment")
32
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.