Fixed Web Page events
svn: r396
This commit is contained in:
parent
1e659878ba
commit
09e581000b
@ -294,12 +294,8 @@ class IndividualPage:
|
|||||||
|
|
||||||
if self.alive:
|
if self.alive:
|
||||||
return
|
return
|
||||||
self.doc.start_paragraph("EventsTitle")
|
count = 0
|
||||||
self.doc.write_text(_("Facts and Events"))
|
|
||||||
self.doc.end_paragraph()
|
|
||||||
|
|
||||||
self.doc.start_table("two","IndTable")
|
|
||||||
|
|
||||||
event_list = [ self.person.getBirth(), self.person.getDeath() ]
|
event_list = [ self.person.getBirth(), self.person.getDeath() ]
|
||||||
event_list = event_list + self.person.getEventList()
|
event_list = event_list + self.person.getEventList()
|
||||||
event_list.sort(by_date)
|
event_list.sort(by_date)
|
||||||
@ -308,25 +304,51 @@ class IndividualPage:
|
|||||||
continue
|
continue
|
||||||
name = _(event.getName())
|
name = _(event.getName())
|
||||||
date = event.getDate()
|
date = event.getDate()
|
||||||
if event.getPlace():
|
descr = event.getDescription()
|
||||||
place = event.getPlaceName()
|
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:
|
else:
|
||||||
place = ""
|
place = ""
|
||||||
description = event.getDescription()
|
if descr != "" and descr[-1] == ".":
|
||||||
|
descr = descr[0:-1]
|
||||||
|
|
||||||
if date == "":
|
if date == "":
|
||||||
if place == "":
|
if place == "":
|
||||||
continue
|
if descr == "":
|
||||||
|
val = ""
|
||||||
|
else:
|
||||||
|
val = "%s." % descr
|
||||||
else:
|
else:
|
||||||
val = "%s. %s" % (place,description)
|
if descr == "":
|
||||||
|
val = ""
|
||||||
|
else:
|
||||||
|
val = "%s. %s." % (place,descr)
|
||||||
else:
|
else:
|
||||||
if place == "":
|
if place == "":
|
||||||
val = "%s. %s" % (date,description)
|
if descr == "":
|
||||||
|
val = "%s." % date
|
||||||
|
else:
|
||||||
|
val = "%s. %s." % (date,descr)
|
||||||
else:
|
else:
|
||||||
val = "%s, %s. %s" % (date,place,description)
|
val = "%s, %s. %s." % (date,place,descr)
|
||||||
|
|
||||||
self.write_normal_row(name, val, event.getSourceRef())
|
self.write_normal_row(name, val, srcref)
|
||||||
|
|
||||||
self.doc.end_table()
|
if count != 0:
|
||||||
|
self.doc.end_table()
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -357,21 +379,38 @@ class IndividualPage:
|
|||||||
return
|
return
|
||||||
name = event.getName()
|
name = event.getName()
|
||||||
date = event.getDate()
|
date = event.getDate()
|
||||||
if event.getPlace():
|
place = event.getPlaceName()
|
||||||
place = event.getPlaceName()
|
descr = event.getDescription()
|
||||||
else:
|
if descr != "" and descr[-1] == ".":
|
||||||
place = ""
|
descr = descr[0:-1]
|
||||||
description = event.getDescription()
|
if place != "" and place[-1] == ".":
|
||||||
|
place = place[0:-1]
|
||||||
|
|
||||||
|
if date == "" and place == "" and descr == "":
|
||||||
|
return
|
||||||
|
|
||||||
if date == "":
|
if date == "":
|
||||||
if place == "":
|
if place == "":
|
||||||
return
|
if descr == "":
|
||||||
|
val = ""
|
||||||
|
else:
|
||||||
|
val = "%s." % descr
|
||||||
else:
|
else:
|
||||||
val = "%s. %s" % (place,description)
|
if descr == "":
|
||||||
|
val = "%s." % place
|
||||||
|
else:
|
||||||
|
val = "%s. %s." % (place,descr)
|
||||||
else:
|
else:
|
||||||
if place == "":
|
if place == "":
|
||||||
val = "%s. %s" % (date,description)
|
if descr == "":
|
||||||
|
val = "%s." % date
|
||||||
|
else:
|
||||||
|
val = "%s. %s." % (date,descr)
|
||||||
else:
|
else:
|
||||||
val = "%s, %s. %s" % (date,place,description)
|
if descr == "":
|
||||||
|
val = "%s, %s." % (date,place)
|
||||||
|
else:
|
||||||
|
val = "%s, %s. %s." % (date,place,descr)
|
||||||
|
|
||||||
self.write_marriage_row([name, val])
|
self.write_marriage_row([name, val])
|
||||||
|
|
||||||
@ -381,6 +420,9 @@ class IndividualPage:
|
|||||||
#
|
#
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
def write_families(self):
|
def write_families(self):
|
||||||
|
if len(self.person.getFamilyList()) == 0:
|
||||||
|
return
|
||||||
|
|
||||||
self.doc.start_paragraph("FamilyTitle")
|
self.doc.start_paragraph("FamilyTitle")
|
||||||
self.doc.write_text(_("Marriages/Children"))
|
self.doc.write_text(_("Marriages/Children"))
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
Loading…
Reference in New Issue
Block a user