Patch from Gary Burton: provide fallback dates on Narrative Web pages (Issue #0001258).

svn: r9025
This commit is contained in:
Brian Matherly 2007-09-28 12:16:12 +00:00
parent 374b8ac050
commit 88c35d8fa9
2 changed files with 37 additions and 16 deletions

View File

@ -1,3 +1,7 @@
2007-09-28 Gary Burton <gary.burton@zen.co.uk>
* src/plugins/NarrativeWeb.py: provide fallback dates on Narrative Web pages
Issue #0001258
2007-09-27 Zsolt Foldvari <zfoldvar@users.sourceforge.net> 2007-09-27 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/docgen/GtkPrint.py (paperstyle_to_pagesetup): Fix paper name and * src/docgen/GtkPrint.py (paperstyle_to_pagesetup): Fix paper name and
custom size conversion. custom size conversion.

View File

@ -3,6 +3,7 @@
# #
# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com> # Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com>
# Copyright (C) 2007 Gary Burton <gary.burton@zen.co.uk>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pubilc License as published by # it under the terms of the GNU General Pubilc License as published by
@ -726,19 +727,27 @@ class IndividualListPage(BasePage):
# birth column # birth column
if self.showbirth: if self.showbirth:
of.write('<td class="field">') of.write('<td class="field">')
birth_ref = person.get_birth_ref() birth = ReportUtils.get_birth_or_fallback(db, person)
if birth_ref: if birth:
birth = db.get_event_from_handle(birth_ref.ref) if birth.get_type() == RelLib.EventType.BIRTH:
of.write(_dd.display(birth.get_date_object())) of.write(_dd.display(birth.get_date_object()))
else:
of.write('<em>')
of.write(_dd.display(birth.get_date_object()))
of.write('</em>')
of.write('</td>') of.write('</td>')
# death column # death column
if self.showdeath: if self.showdeath:
of.write('<td class="field">') of.write('<td class="field">')
death_ref = person.get_death_ref() death = ReportUtils.get_death_or_fallback(db, person)
if death_ref: if death:
death = db.get_event_from_handle(death_ref.ref) if death.get_type() == RelLib.EventType.DEATH:
of.write(_dd.display(death.get_date_object())) of.write(_dd.display(death.get_date_object()))
else:
of.write('<em>')
of.write(_dd.display(death.get_date_object()))
of.write('</em>')
of.write('</td>') of.write('</td>')
# spouse (partner) column # spouse (partner) column
@ -840,19 +849,27 @@ class SurnamePage(BasePage):
# birth column # birth column
if self.showbirth: if self.showbirth:
of.write('<td class="field">') of.write('<td class="field">')
birth_ref = person.get_birth_ref() birth = ReportUtils.get_birth_or_fallback(db, person)
if birth_ref: if birth:
birth = db.get_event_from_handle(birth_ref.ref) if birth.get_type() == RelLib.EventType.BIRTH:
of.write(_dd.display(birth.get_date_object())) of.write(_dd.display(birth.get_date_object()))
else:
of.write('<em>')
of.write(_dd.display(birth.get_date_object()))
of.write('</em>')
of.write('</td>') of.write('</td>')
# death column # death column
if self.showdeath: if self.showdeath:
of.write('<td class="field">') of.write('<td class="field">')
death_ref = person.get_death_ref() death = ReportUtils.get_death_or_fallback(db, person)
if death_ref: if death:
death = db.get_event_from_handle(death_ref.ref) if death.get_type() == RelLib.EventType.DEATH:
of.write(_dd.display(death.get_date_object())) of.write(_dd.display(death.get_date_object()))
else:
of.write('<em>')
of.write(_dd.display(death.get_date_object()))
of.write('</em>')
of.write('</td>') of.write('</td>')
# spouse (partner) column # spouse (partner) column