diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index ee62b598a..8acf48e16 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -88,6 +88,7 @@ import Utils import ThumbNails import ImgManip import Mime +from Utils import probably_alive from QuestionDialog import ErrorDialog, WarningDialog from BasicUtils import name_displayer as _nd from DateHandler import displayer as _dd @@ -282,7 +283,7 @@ class BasePage: def get_alpha_list(ind_list): """ Will produce the active letters in the alphabet """ - alpha_list = [] + firstletter_list = [] for person_handle in ind_list: person = self.report.database.get_person_from_handle(person_handle) primary_name = person.get_primary_name() @@ -290,30 +291,19 @@ class BasePage: alpha_name = primary_name.get_surname() if alpha_name: - alpha_ltr = alpha_name[0].upper() - if alpha_ltr in alpha_list: - pass - else: - alpha_list.append(alpha_ltr) + alpha_ltr = alpha_name[0] + if alpha_ltr not in firstletter_list: + firstletter_list.append(alpha_ltr) - if len(alpha_list) > 1: - alpha_list.sort() - return alpha_list + firstletter_list.sort() + return firstletter_list - alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] - - alpha_list = get_alpha_list(ind_list) + namedict = get_alpha_list(ind_list) of.write('\t
\n') @@ -382,7 +372,7 @@ class BasePage: of.write('\t\n' % self.report.encoding) of.write('\t\n') - of.write('\y\n') of.write('\t\n' % self.author) @@ -2009,6 +1999,23 @@ class IndividualPage(BasePage): of.write('\t%s | \n' % _('Name Type')) + of.write('\t\t\t\t%s | \n' % type_) + else: + of.write('\t\t\t\t%s | \n' % type_) + of.write('\t\t\t\t%s | \n' % pname) + of.write('\t\t\t
%s | \n' % self.person.gramps_id) of.write('\t\t\t|||
%s | \n' % type_) - of.write('\t\t\t\t%s' % pname) - of.write(' | \n') - of.write('\t\t\t||
%s | \n' % _('Nickname')) - of.write('\t\t\t\t%s | \n' % nick) + call_name = primary_name.get_call_name() + first_name = primary_name.get_first_name() + + # if (nick and call_name) != first_name??? + if (nick is not first_name and call_name is not first_name): + nick_name = True + + if nick_name: + if call_name: + of.write('\t\t\t\t%s | \n' + % _('Nick Name')) + of.write('\t\t\t\t%s | \n' % call_name) of.write('\t\t\t%s | \n' % gender) of.write('\t\t\t\n') + + # Age At Death??? + birth_ref = self.person.get_birth_ref() + birth_date = None + if birth_ref: + birth_event = self.report.database.get_event_from_handle(birth_ref.ref) + birth_date = birth_event.get_date_object() + + if (birth_date is not None and birth_date.get_valid()): + alive = probably_alive(self.person, self.report.database, gen.lib.date.Today()) + death_ref = self.person.get_death_ref() + death_date = None + if death_ref: + death_event = self.report.database.get_event_from_handle(death_ref.ref) + death_date = death_event.get_date_object() + + if not alive and (death_date is not None and death_date.is_valid()): + of.write('\t\t\t
%s | \n' + % _('Age at Death')) + nyears = death_date - birth_date + nyears.format(precision=3) + of.write('\t\t\t\t%s | \n' % nyears) + of.write('\t\t\t