Fixed Web Page events

svn: r396
This commit is contained in:
Don Allingham 2001-09-09 02:22:42 +00:00
parent 1e659878ba
commit 09e581000b

View File

@ -294,11 +294,7 @@ class IndividualPage:
if self.alive:
return
self.doc.start_paragraph("EventsTitle")
self.doc.write_text(_("Facts and Events"))
self.doc.end_paragraph()
self.doc.start_table("two","IndTable")
count = 0
event_list = [ self.person.getBirth(), self.person.getDeath() ]
event_list = event_list + self.person.getEventList()
@ -308,24 +304,50 @@ class IndividualPage:
continue
name = _(event.getName())
date = event.getDate()
if event.getPlace():
descr = event.getDescription()
place = event.getPlaceName()
srcref = event.getSourceRef()
if date == "" and descr == "" and place == "" and srcref.getBase() == None:
continue
if count == 0:
self.doc.start_paragraph("EventsTitle")
self.doc.write_text(_("Facts and Events"))
self.doc.end_paragraph()
self.doc.start_table("two","IndTable")
count = 1
if place != "" and place[-1] == ".":
place = place[0:-1]
else:
place = ""
description = event.getDescription()
if descr != "" and descr[-1] == ".":
descr = descr[0:-1]
if date == "":
if place == "":
continue
if descr == "":
val = ""
else:
val = "%s. %s" % (place,description)
val = "%s." % descr
else:
if descr == "":
val = ""
else:
val = "%s. %s." % (place,descr)
else:
if place == "":
val = "%s. %s" % (date,description)
if descr == "":
val = "%s." % date
else:
val = "%s, %s. %s" % (date,place,description)
val = "%s. %s." % (date,descr)
else:
val = "%s, %s. %s." % (date,place,descr)
self.write_normal_row(name, val, event.getSourceRef())
self.write_normal_row(name, val, srcref)
if count != 0:
self.doc.end_table()
#--------------------------------------------------------------------
@ -357,21 +379,38 @@ class IndividualPage:
return
name = event.getName()
date = event.getDate()
if event.getPlace():
place = event.getPlaceName()
else:
place = ""
description = event.getDescription()
descr = event.getDescription()
if descr != "" and descr[-1] == ".":
descr = descr[0:-1]
if place != "" and place[-1] == ".":
place = place[0:-1]
if date == "" and place == "" and descr == "":
return
if date == "":
if place == "":
return
if descr == "":
val = ""
else:
val = "%s. %s" % (place,description)
val = "%s." % descr
else:
if descr == "":
val = "%s." % place
else:
val = "%s. %s." % (place,descr)
else:
if place == "":
val = "%s. %s" % (date,description)
if descr == "":
val = "%s." % date
else:
val = "%s, %s. %s" % (date,place,description)
val = "%s. %s." % (date,descr)
else:
if descr == "":
val = "%s, %s." % (date,place)
else:
val = "%s, %s. %s." % (date,place,descr)
self.write_marriage_row([name, val])
@ -381,6 +420,9 @@ class IndividualPage:
#
#--------------------------------------------------------------------
def write_families(self):
if len(self.person.getFamilyList()) == 0:
return
self.doc.start_paragraph("FamilyTitle")
self.doc.write_text(_("Marriages/Children"))
self.doc.end_paragraph()