3863: Narrative Web report : role not displayed when not primary

svn: r15234
This commit is contained in:
Doug Blank 2010-04-19 13:48:54 +00:00
parent 441c7fb720
commit 4d51c49508

View File

@ -69,7 +69,7 @@ log = logging.getLogger(".NarrativeWeb")
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from gen.ggettext import sgettext as _ from gen.ggettext import sgettext as _
import gen.lib import gen.lib
from gen.lib import UrlType, date, Date, FamilyRelType, NoteType from gen.lib import UrlType, date, Date, FamilyRelType, NoteType, EventRoleType
import const import const
import Sort import Sort
from gen.plug.menu import PersonOption, NumberOption, StringOption, \ from gen.plug.menu import PersonOption, NumberOption, StringOption, \
@ -462,7 +462,7 @@ class BasePage(object):
# return note list to its callers # return note list to its callers
return ul 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 display the event row for IndividualPage
@ -470,6 +470,7 @@ class BasePage(object):
@param: evt_ref = event reference @param: evt_ref = event reference
@param: subdirs = add [".."] * 3 for subdirectories or not @param: subdirs = add [".."] * 3 for subdirectories or not
@param: hyp = add a hyperlink or not @param: hyp = add a hyperlink or not
@params: omit = role to be omitted in output
""" """
db = self.report.database db = self.report.database
@ -488,8 +489,7 @@ class BasePage(object):
# get event type and hyperlink to it or not? # get event type and hyperlink to it or not?
etype = str(evt.type) etype = str(evt.type)
if (not evt_ref.get_role().is_primary() and if not evt_ref.get_role() == omit:
not evt_ref.get_role().is_family()):
etype += " (%s)" % evt_ref.get_role() etype += " (%s)" % evt_ref.get_role()
evt_hyper = self.event_link(etype, evt_ref.ref, evt.gramps_id, subdirs) if hyp else etype evt_hyper = self.event_link(etype, evt_ref.ref, evt.gramps_id, subdirs) if hyp else etype
trow += Html("td", evt_hyper, class_ = "ColumnEvent") trow += Html("td", evt_hyper, class_ = "ColumnEvent")
@ -4126,8 +4126,10 @@ class IndividualPage(BasePage):
@param: event_ref = event reference @param: event_ref = event reference
@param: subdirs = True or False @param: subdirs = True or False
@param: hyp = show hyperlinked evt type or not? @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 to its caller
return section return section
@ -4656,8 +4658,10 @@ class IndividualPage(BasePage):
@param: event_ref = event reference @param: event_ref = event reference
@param: up = True or False: attach subdirs or not? @param: up = True or False: attach subdirs or not?
@param: hyp = show hyperlinked evt type 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 to its callers
return table return table