Fixed person section of Event Pages.

svn: r13698
This commit is contained in:
Rob G. Healey 2009-12-03 19:10:20 +00:00
parent 362d9ae3fc
commit fc48e51d1c

View File

@ -2303,43 +2303,36 @@ class EventPage(BasePage):
for more information: see get_event_data() for more information: see get_event_data()
""" """
event_data = self.get_event_data(event, evt_ref, True, True, event_data = self.get_event_data(event, evt_ref, True, True,
False, True, subdirs, False, event.gramps_id) False, False, subdirs, False, event.gramps_id)
# the first ones are listed here, the rest are shown below for (label, colclass, data) in event_data:
# minus one because it starts at zero instead of one if data:
# minus one for note list which is shown below
for index in xrange(len(event_data) - 2):
label = event_data[index][0]
colclass = event_data[index][1]
data = event_data[index][2] or " "
# determine if we are using the same row or not? trow = Html("tr")
samerow = (data == " " or
colclass in ["Event", "Date"])
trow = Html("tr") + (
Html("td", label, class_ = "ColumnAttribute", inline = True),
Html('td', data, class_ = "Column" + colclass, inline = samerow)
)
tbody += trow tbody += trow
trow += Html("td", label, class_ = "ColumnAttribute", inline = True) + (
Html('td', data, class_ = "Column" + colclass)
)
# Person # Person
evt_type = event.type.xml_str()
if evt_type in ["Divorce", "Marriage"]: if evt_type in ["Divorce", "Marriage"]:
handle_list = db.find_backlink_handles(evt_ref.ref, handle_list = db.find_backlink_handles(evt_ref.ref,
include_classes = ['Person', 'Family']) include_classes = ['Person', 'Family'])
else: else:
handle_list = db.find_backlink_handles(evt_ref.ref, include_classes = ['Person']) handle_list = db.find_backlink_handles(evt_ref.ref, include_classes = ['Person'])
if handle_list:
first_person = True
trow = Html("tr") + ( trow = Html("tr") + (
Html("td", _PERSON, class_ = "ColumnAttribute", inline = True) Html("td", _PERSON, class_ = "ColumnAttribute", inline = True)
) )
tbody += trow
tcell = Html("td", class_ = "ColumnPerson") tcell = Html("td", class_ = "ColumnPerson")
trow += tcell trow += tcell
if handle_list:
first_person = True
# clasname can be either Person or Family # clasname can be either Person or Family
for (classname, handle) in handle_list: for (classname, handle) in handle_list:
@ -2374,12 +2367,11 @@ class EventPage(BasePage):
elif husband: elif husband:
tcell += Html("span", husband_name, class_ = "father") tcell += Html("span", husband_name, class_ = "father")
first_person = False first_person = False
else:
tcell += " "
# Narrative subsection # Narrative subsection
if shownote: notelist = event.get_note_list()
notelist = self.display_note_list( event_data[(len(event_data) - 1)][2] ) notelist.extend(evt_ref.get_note_list() )
notelist = self.display_note_list(notelist)
if notelist is not None: if notelist is not None:
eventdetail += notelist eventdetail += notelist
@ -2392,7 +2384,6 @@ class EventPage(BasePage):
# event source references # event source references
srcrefs = event.get_source_references() srcrefs = event.get_source_references()
self.bibli = Bibliography()
srcrefs = self.display_ind_sources(event) srcrefs = self.display_ind_sources(event)
if srcrefs is not None: if srcrefs is not None:
eventdetail += srcrefs eventdetail += srcrefs