Cleanup of little things in WebCal.
svn: r13775
This commit is contained in:
parent
8af5f5f532
commit
1f6d87182b
@ -1121,20 +1121,20 @@ class WebCalReport(Report):
|
|||||||
if (self.birthday and birth_date is not None and birth_date.is_valid()):
|
if (self.birthday and birth_date is not None and birth_date.is_valid()):
|
||||||
|
|
||||||
year = birth_date.get_year()
|
year = birth_date.get_year()
|
||||||
month = birth_date.get_month()
|
month = birth_date.get_month() or 1
|
||||||
day = birth_date.get_day()
|
day = birth_date.get_day() or 1
|
||||||
|
|
||||||
# date to figure if someone is still alive
|
# date to figure if someone is still alive
|
||||||
|
# current year of calendar, month nd day is their birth month and birth day
|
||||||
prob_alive_date = Date(this_year, month, day)
|
prob_alive_date = Date(this_year, month, day)
|
||||||
|
|
||||||
# add some things to handle maiden name:
|
# add some things to handle maiden name:
|
||||||
father_surname = None # husband, actually
|
father_surname = None # husband, actually
|
||||||
sex = person.gender
|
if person.gender == Person.FEMALE:
|
||||||
if sex == Person.FEMALE:
|
|
||||||
|
|
||||||
# get husband's last name:
|
# get husband's last name:
|
||||||
if self.maiden_name in ['spouse_first', 'spouse_last']:
|
if self.maiden_name in ['spouse_first', 'spouse_last']:
|
||||||
if len(family_list) > 0:
|
if family_list:
|
||||||
if self.maiden_name == 'spouse_first':
|
if self.maiden_name == 'spouse_first':
|
||||||
fhandle = family_list[0]
|
fhandle = family_list[0]
|
||||||
else:
|
else:
|
||||||
@ -1147,15 +1147,15 @@ class WebCalReport(Report):
|
|||||||
father = self.database.get_person_from_handle(father_handle)
|
father = self.database.get_person_from_handle(father_handle)
|
||||||
if father is not None:
|
if father is not None:
|
||||||
father_name = father.primary_name
|
father_name = father.primary_name
|
||||||
father_surname = _get_regular_surname(sex, father_name)
|
father_surname = _get_regular_surname(person.gender, father_name)
|
||||||
short_name = self.get_name(person, father_surname)
|
short_name = self.get_name(person, father_surname)
|
||||||
alive = probably_alive(person, self.database, prob_alive_date)
|
alive = probably_alive(person, self.database, prob_alive_date)
|
||||||
if (self.alive and alive) or not self.alive:
|
if (self.alive and alive) or not self.alive:
|
||||||
|
|
||||||
# add link to NarrativeWeb
|
# add link to NarrativeWeb
|
||||||
if self.link_to_narweb:
|
if self.link_to_narweb:
|
||||||
text = Html('a', short_name,
|
text = Html("a", short_name,
|
||||||
href=self.build_url_fname_html(person.handle, 'ppl',
|
href = self.build_url_fname_html(person.handle, "ppl",
|
||||||
prefix = self.narweb_prefix))
|
prefix = self.narweb_prefix))
|
||||||
else:
|
else:
|
||||||
text = short_name
|
text = short_name
|
||||||
|
Loading…
Reference in New Issue
Block a user