From 8547df54806b434242b84293170486287962f40b Mon Sep 17 00:00:00 2001 From: Gary Burton Date: Sat, 20 Oct 2007 21:26:43 +0000 Subject: [PATCH] 2007-10-20 Gary Burton * src/plugins/NarrativeWeb.py: display event reference notes and attributes svn: r9222 --- ChangeLog | 3 +++ src/plugins/NarrativeWeb.py | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5f1caaff..6966f6c87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-10-20 Gary Burton + * src/plugins/NarrativeWeb.py: display event reference notes and attributes + 2007-10-20 Benny Malengier * src/gramps_main.py: if error and terminate, don't show family manager before exit * src/gramps.py: terminate if wrong python version diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index 03b0474b4..12742fd35 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -1938,7 +1938,7 @@ class IndividualPage(BasePage): % (evt_name, event_ref.get_role())) of.write('\n') - of.write(self.format_event(event)) + of.write(self.format_event(event, event_ref)) of.write('\n') of.write('\n') of.write('\n') @@ -2163,7 +2163,7 @@ class IndividualPage(BasePage): of.write(' \n') of.write('%s\n' % evtType) of.write('\n') - of.write(self.format_event(event)) + of.write(self.format_event(event, event_ref)) of.write('\n\n') for attr in family.get_attribute_list(): attrType = str(attr.get_type()) @@ -2216,7 +2216,7 @@ class IndividualPage(BasePage): self.pedigree_person(of,child) of.write('\n') - def format_event(self,event): + def format_event(self,event,event_ref): lnk = (self.cur_name, self.page_title, self.gid) descr = event.get_description() place_handle = event.get_place_handle() @@ -2254,8 +2254,19 @@ class IndividualPage(BasePage): text = '\n' text += self.get_citation_links( event.get_source_references() ) - # if the event has a note attached to it, get the text and format it correctly + # if the event or event reference has a attributes attached to it, + # get the text and format it correctly + attr_list = event.get_attribute_list() + attr_list.extend(event_ref.get_attribute_list()) + for attr in attr_list: + text += _("
%(type)s: %(value)s") % { + 'type' : attr.get_type(), + 'value' : attr.get_value() } + + # if the event or event reference has a note attached to it, + # get the text and format it correctly notelist = event.get_note_list() + notelist.extend(event_ref.get_note_list()) for notehandle in notelist: nobj = self.db.get_note_from_handle(notehandle) if nobj: @@ -2268,14 +2279,6 @@ class IndividualPage(BasePage): text += u"

" text += u"
".join(note_text.split("\n")) text += u"

" - - # if the event has a attributes attached to it, get the text and format - # it correctly - for attr in event.get_attribute_list(): - text += _("

%(type)s: %(value)s

") % { - 'type' : attr.get_type(), - 'value' : attr.get_value() } - return text def get_citation_links(self, source_ref_list):