From e6f434a686e02a717eb8436890e2f98fe275be71 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Mon, 29 Aug 2005 12:41:04 +0000 Subject: [PATCH] * src/plugins/NavWebPage.py: Correct link to Surname list page; Better handling for not existing media object files and note-only objects; thumbnails are always png images svn: r5137 --- gramps2/ChangeLog | 5 ++ gramps2/src/plugins/NavWebPage.py | 98 ++++++++++++++++++++++--------- 2 files changed, 74 insertions(+), 29 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 2b957378d..344765f66 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2005-08-29 Martin Hawlisch + * src/plugins/NavWebPage.py: Correct link to Surname list page; + Better handling for not existing media object files and note-only + objects; thumbnails are always png images + 2005-08-28 Don Allingham * src/plugins/NavWebPage.py: handle resticted living people better, producing name and relationships instead of just Private. diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 1adf42c08..1a5051baa 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -155,7 +155,7 @@ class BasePage: ext = os.path.splitext(photo.get_path())[1] real_path = "%s/%s" % (self.build_path(handle,'images'),handle+ext) - thumb_path = "%s/%s" % (self.build_path(handle,'thumb'),handle+ext) + thumb_path = "%s/%s.png" % (self.build_path(handle,'thumb'),handle) return (real_path,thumb_path) def create_file(self,name): @@ -314,10 +314,21 @@ class BasePage: of.write('\n') except (IOError,OSError),msg: WarningDialog(_("Could not add photo to page"),str(msg)) + else: + of.write('
\n') + self.doc_link(of,photo_handle, + photo.get_description(),up=True) + of.write('
\n') + lnk = (self.cur_name,self.page_title,self.gid) + if self.photo_list.has_key(photo_handle): + if lnk not in self.photo_list[photo_handle]: + self.photo_list[photo_handle].append(lnk) + else: + self.photo_list[photo_handle] = [lnk] def display_additional_images_as_gallery( self, of, db, photolist=None): - if not photolist and len(photolist) == 0: + if not photolist or not self.use_gallery: return of.write('\n') of.write('\n') @@ -836,7 +873,13 @@ class SurnameListPage(BasePage): of.write('
\n\n') of.write('\n' % _('Letter')) - of.write('\n' % ("surnames", self.ext, _('Surname'))) + + use_home = self.options.handler.options_dict['NWEBhomenote'] != "" + if not use_home and not self.use_intro: + of.write('\n' % ("index", self.ext, _('Surname'))) + else: + of.write('\n' % ("surnames", self.ext, _('Surname'))) + of.write('\n' % ("surnames_count", self.ext, _('Number of people'))) of.write('\n\n') @@ -1956,12 +1999,9 @@ class WebReport(Report.Report): next = None else: next = photo_keys[index] - try: - MediaPage(self.database, self.title, photo_handle, source_list, - self.options, archive, self.photo_list[photo_handle], - (prev, next, index, total)) - except (IOError,OSError),msg: - WarningDialog(_("Missing media object"),str(msg)) + MediaPage(self.database, self.title, photo_handle, source_list, + self.options, archive, self.photo_list[photo_handle], + (prev, next, index, total)) self.progress.step() prev = photo_handle index += 1
%s%s%s%s%s