Fix for part of 0006009: Media objects attached to Marriage events and Sources are not included in Narrative Web Site. Some references show as "Unknown", and family event media are missing if event pages are not generated. (Media objects for sources NOT fixed)

svn: r20584
This commit is contained in:
Tim G L Lyons 2012-10-24 12:30:33 +00:00
parent 2331392dc0
commit 35af1c2e41

View File

@ -3254,6 +3254,8 @@ class FamilyPage(BasePage):
self.bibli = Bibliography() self.bibli = Bibliography()
self.place_list = place_list self.place_list = place_list
self.up = True self.up = True
# determine if husband and wife, husband only, or spouse only....
self.page_title = _("Family of ") + self.get_family_string(family)
birthorder = report.options["birthorder"] birthorder = report.options["birthorder"]
self.familymappages = report.options["familymappages"] self.familymappages = report.options["familymappages"]
@ -3269,6 +3271,12 @@ class FamilyPage(BasePage):
# delete thumbnail so that it won't display again in the Gallery List later on... # delete thumbnail so that it won't display again in the Gallery List later on...
if self.create_media: if self.create_media:
media_list = family.get_media_list() media_list = family.get_media_list()
# If Event pages are not being created, then we need to display
# the family event media here
if not self.inc_events:
for evt_ref in family.get_event_ref_list():
event = self.dbase_.get_event_from_handle(evt_ref.ref)
media_list += event.get_media_list()
thumbnail = self.display_first_image_as_thumbnail(media_list, family) thumbnail = self.display_first_image_as_thumbnail(media_list, family)
if thumbnail: if thumbnail:
relationshipdetail += thumbnail relationshipdetail += thumbnail
@ -3291,8 +3299,6 @@ class FamilyPage(BasePage):
elif spouse_handle: elif spouse_handle:
self.person = spouse self.person = spouse
# determine if husband and wife, husband only, or spouse only....
self.page_title = _("Family of ") + self.get_family_string(family)
relationshipdetail += Html("h2", self.page_title, inline = True) relationshipdetail += Html("h2", self.page_title, inline = True)
# display relationships # display relationships
@ -3777,6 +3783,8 @@ class EventPage(BasePage):
self.up = True self.up = True
subdirs = True subdirs = True
evt_type = str(event.get_type())
self.page_title = "%(eventtype)s" % {'eventtype' : evt_type}
self.bibli = Bibliography() self.bibli = Bibliography()
of, sio = self.report.create_file(event_handle, "evt") of, sio = self.report.create_file(event_handle, "evt")
@ -3791,9 +3799,7 @@ class EventPage(BasePage):
eventdetail += thumbnail eventdetail += thumbnail
# display page title # display page title
evt_type = str(event.get_type()) eventdetail += Html("h3", self.page_title, inline = True)
title = "%(eventtype)s" % {'eventtype' : evt_type}
eventdetail += Html("h3", title, inline = True)
# begin eventdetail table # begin eventdetail table
with Html("table", class_ = "infolist eventlist") as table: with Html("table", class_ = "infolist eventlist") as table: