From e2f6a57f746ee4bb7973ee12622d10250435d2b5 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Thu, 15 Apr 2010 01:59:10 +0000 Subject: [PATCH] Fixed class SourcePage where information would not be created if 'Suppress Gramps IDs' was selected. svn: r15124 --- src/Makefile.am | 1 + src/plugins/webreport/NarrativeWeb.py | 41 ++++++++++++++------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index e14534393..58d53ee1a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,6 +28,7 @@ gdir_PYTHON = \ Bookmarks.py\ config.py\ const.py\ + constfunc.py\ DateEdit.py\ Date.py\ DbState.py\ diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 721160d4e..1e2f2438e 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -3100,11 +3100,11 @@ class SourceListPage(BasePage): class SourcePage(BasePage): - def __init__(self, report, title, handle, src_list): + def __init__(self, report, title, handle, src_list, gid = None): db = report.database source = db.get_source_from_handle(handle) - BasePage.__init__(self, report, title, source.gramps_id) + BasePage.__init__(self, report, title, gid) of = self.report.create_file(source.get_handle(), "src") self.up = True @@ -3130,19 +3130,21 @@ class SourcePage(BasePage): table += tbody grampsid = None - if not self.noid: - grampsid = source.gramps_id + if not self.noid and gid: + grampsid = gid - for (label, val) in [(GRAMPSID, grampsid), - (_("Author"), source.author), - (_("Publication information"), source.pubinfo), - (_("Abbreviation"), source.abbrev)]: - if val: - trow = Html("tr") + ( - Html("td", label, class_ = "ColumnAttribute"), - Html("td", val, class_ = "ColumnValue") - ) - tbody += trow + for (label, val) in [ + (GRAMPSID, grampsid), + (_("Author"), source.author), + (_("Publication information"), source.pubinfo), + (_("Abbreviation"), source.abbrev) ]: + + if val: + trow = Html("tr") + ( + Html("td", label, class_ = "ColumnAttribute"), + Html("td", val, class_ = "ColumnValue") + ) + tbody += trow # additional media sourcemedia = self.display_additional_images_as_gallery(media_list) @@ -3150,15 +3152,14 @@ class SourcePage(BasePage): section += sourcemedia # additional notes - notelist = source.get_note_list() - if notelist: - notelist = self.display_note_list(notelist) + notelist = self.display_note_list( source.get_note_list() ) + if notelist is not None: section += notelist # references - src_references = self.display_references(src_list[source.handle]) - if src_references is not None: - section += src_references + references = self.display_references(src_list[source.handle]) + if references is not None: + section += references # add clearline for proper styling # add footer section