From def3e1f1c1a7452713670222608386836826bf93 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 19 Apr 2010 13:46:37 +0000 Subject: [PATCH] 3863: Narrative Web report : role not displayed when not primary svn: r15233 --- src/plugins/webreport/NarrativeWeb.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index baed381e8..1cb115ea4 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -69,7 +69,7 @@ log = logging.getLogger(".WebPage") from gen.ggettext import sgettext as _ import gen.lib from gen.lib import UrlType, EventType, Person, date, Date, ChildRefType, \ - FamilyRelType, NameType, Name, NoteType + FamilyRelType, NameType, Name, NoteType, EventRoleType import const import Sort from gen.plug.menu import PersonOption, NumberOption, StringOption, \ @@ -459,7 +459,7 @@ class BasePage(object): # return note list to its callers return ul - def display_event_row(self, evt, evt_ref, subdirs, hyp): + def display_event_row(self, evt, evt_ref, subdirs, hyp, omit): """ display the event row for IndividualPage @@ -467,6 +467,7 @@ class BasePage(object): @param: evt_ref = event reference @param: subdirs = add [".."] * 3 for subdirectories or not @params: hyp = add a hyperlink or not + @params: omit = role to be omitted in output """ db = self.report.database @@ -485,8 +486,7 @@ class BasePage(object): # get event type and hyperlink to it or not? etype = str(evt.type) - if (not evt_ref.get_role().is_primary() and - not evt_ref.get_role().is_family()): + if not evt_ref.get_role() == omit: etype += " (%s)" % evt_ref.get_role() evt_hyper = self.event_link(etype, evt_ref.ref, evt.gramps_id, subdirs) if hyp else etype trow += Html("td", evt_hyper, class_ = "ColumnEvent") @@ -4180,8 +4180,10 @@ class IndividualPage(BasePage): @param: event_ref = event reference @param: subdirs = True or False @param: hyp = show hyperlinked evt type or not? + @params: omit = role to be omitted in output """ - tbody += self.display_event_row(event, evt_ref, True, True) + tbody += self.display_event_row(event, evt_ref, True, True, + EventRoleType.PRIMARY) # return section to its caller return section @@ -4744,8 +4746,10 @@ class IndividualPage(BasePage): @param: event_ref = event reference @param: up = True or False: attach subdirs or not? @param: hyp = show hyperlinked evt type or not? + @params: omit = role to be omitted in output """ - tbody += self.display_event_row(event, event_ref, True, True) + tbody += self.display_event_row(event, event_ref, True, True, + EventRoleType.FAMILY) # return table to its callers return table