3863: Narrative Web report : role not displayed when not primary
svn: r15234
This commit is contained in:
parent
441c7fb720
commit
4d51c49508
@ -69,7 +69,7 @@ log = logging.getLogger(".NarrativeWeb")
|
||||
#------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
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 Sort
|
||||
from gen.plug.menu import PersonOption, NumberOption, StringOption, \
|
||||
@ -462,7 +462,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
|
||||
|
||||
@ -470,6 +470,7 @@ class BasePage(object):
|
||||
@param: evt_ref = event reference
|
||||
@param: subdirs = add [".."] * 3 for subdirectories or not
|
||||
@param: hyp = add a hyperlink or not
|
||||
@params: omit = role to be omitted in output
|
||||
"""
|
||||
db = self.report.database
|
||||
|
||||
@ -488,8 +489,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")
|
||||
@ -4126,8 +4126,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
|
||||
@ -4656,8 +4658,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
|
||||
|
Loading…
Reference in New Issue
Block a user