From 06017f562e83153cdbe0340deb86381e3a33dfbb Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Mon, 16 Nov 2009 21:10:49 +0000 Subject: [PATCH] Fixed if hyper: cconditional in class MediaPage, lines 2554-2563. svn: r13598 --- src/plugins/webreport/NarrativeWeb.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index b71a0b57f..23148190c 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -2550,19 +2550,15 @@ class MediaPage(BasePage): with Html("div", id = "GalleryDisplay") as mediadisplay: summaryarea += mediadisplay + + img_url = self.report.build_url_fname(path, None, self.up) if target_exists: # TODO. Convert disk path to URL url = self.report.build_url_fname(newpath, None, self.up) - hyper = Html("a", href = url) - # TODO. Mixup url and path - # path = convert_disk_path_to_url(path) - url = self.report.build_url_fname(path, None, self.up) - if hyper: - hyper += Html("img", src = url, alt = html_escape(self.page_title)) - else: - hyper = Html("img", src = url, alt = html_escape(self.page_title)) - if target_exists: - mediadisplay += hyper + hyper = Html("a", href = url) + ( + Html("img", src = img_url, alt = html_escape(self.page_title)) + ) + mediadisplay += hyper else: mediadisplay += missingimage else: