5223: NarWeb, first image thumbnail description errors
svn: r18133
This commit is contained in:
parent
5bf9b8217e
commit
2c52c8cc42
@ -1506,6 +1506,7 @@ class BasePage(object):
|
|||||||
photo_handle = photolist[0].get_reference_handle()
|
photo_handle = photolist[0].get_reference_handle()
|
||||||
photo = self.report.database.get_object_from_handle(photo_handle)
|
photo = self.report.database.get_object_from_handle(photo_handle)
|
||||||
mime_type = photo.get_mime_type()
|
mime_type = photo.get_mime_type()
|
||||||
|
descr = photo.get_description()
|
||||||
|
|
||||||
# begin snapshot division
|
# begin snapshot division
|
||||||
with Html("div", class_ = "snapshot") as snapshot:
|
with Html("div", class_ = "snapshot") as snapshot:
|
||||||
@ -1523,7 +1524,8 @@ class BasePage(object):
|
|||||||
newpath = copy_thumbnail(self.report, photo_handle, photo, region)
|
newpath = copy_thumbnail(self.report, photo_handle, photo, region)
|
||||||
newpath = self.report.build_url_fname(newpath, up = True)
|
newpath = self.report.build_url_fname(newpath, up = True)
|
||||||
|
|
||||||
snapshot += self.media_link(photo_handle, newpath, '', up = True)
|
snapshot += self.media_link(photo_handle, newpath, descr,
|
||||||
|
up=True, usedescr=False)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
real_path, newpath = self.report.prepare_copy_media(photo)
|
real_path, newpath = self.report.prepare_copy_media(photo)
|
||||||
@ -1542,22 +1544,22 @@ class BasePage(object):
|
|||||||
style="left:%d%%; top:%d%%; width:%d%%; height:%d%%;"
|
style="left:%d%%; top:%d%%; width:%d%%; height:%d%%;"
|
||||||
% (x, y, w, h)) + Html("a", name, href = linkurl)
|
% (x, y, w, h)) + Html("a", name, href = linkurl)
|
||||||
# Need to add link to mediadisplay to get the links:
|
# Need to add link to mediadisplay to get the links:
|
||||||
mediadisplay += self.media_link(photo_handle, newpath, '', up = True)
|
mediadisplay += self.media_link(photo_handle,
|
||||||
|
newpath, descr, up=True, usedescr=False)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|
||||||
# begin hyperlink
|
# begin hyperlink
|
||||||
# description is given only for the purpose of the alt tag in img element
|
# description is given only for the purpose of the alt tag in img element
|
||||||
snapshot += self.media_link(photo_handle, newpath, '', up = True)
|
snapshot += self.media_link(photo_handle, newpath,
|
||||||
|
descr, up=True, usedescr=False)
|
||||||
|
|
||||||
except (IOError, OSError), msg:
|
except (IOError, OSError), msg:
|
||||||
WarningDialog(_("Could not add photo to page"), str(msg))
|
WarningDialog(_("Could not add photo to page"), str(msg))
|
||||||
else:
|
else:
|
||||||
# get media description
|
|
||||||
descr = photo.get_description()
|
|
||||||
|
|
||||||
# begin hyperlink
|
# begin hyperlink
|
||||||
snapshot += self.doc_link(photo_handle, descr, up = True)
|
snapshot += self.doc_link(photo_handle, descr, up=True,
|
||||||
|
usedescr=False)
|
||||||
|
|
||||||
lnk = (self.report.cur_fname, self.page_title, self.gid)
|
lnk = (self.report.cur_fname, self.page_title, self.gid)
|
||||||
# FIXME. Is it OK to add to the photo_list of report?
|
# FIXME. Is it OK to add to the photo_list of report?
|
||||||
|
Loading…
Reference in New Issue
Block a user