Tr- erote the display_relationships() on class IndividualPage.

svn: r18233
This commit is contained in:
Rob G. Healey 2011-10-02 01:53:12 +00:00
parent 7940d8e80d
commit 78685cb16f
2 changed files with 77 additions and 75 deletions

View File

@ -1870,7 +1870,7 @@ class BasePage(object):
return Html("a", _("Family Map"), href = url, title = _("Family Map"), return Html("a", _("Family Map"), href = url, title = _("Family Map"),
class_ = "familymap", inline = True) class_ = "familymap", inline = True)
def display_ind_families(self, family_handle_list, ppl_handle_list, place_lat_long): def display_relationships(self, ppl_handle_list, place_lat_long):
""" """
Displays a person's relationships ... Displays a person's relationships ...
@ -1878,50 +1878,47 @@ class BasePage(object):
@param: ppl_handle_list -- people in this report database @param: ppl_handle_list -- people in this report database
@param: place_lat_long -- for use in Family Map Pages @param: place_lat_long -- for use in Family Map Pages
""" """
if not family_handle_list:
return None
db = self.report.database db = self.report.database
birthorder = self.report.options["birthorder"] birthorder = self.report.options["birthorder"]
# begin families division and section title family_list = self.person.get_family_handle_list()
with Html("div", class_ = "subsection", id = "families") as section: if not family_list:
return None
with Html("div", id ="families", class_ ="subsection") as section:
section += Html("h4", _("Families"), inline =True) section += Html("h4", _("Families"), inline =True)
# begin families table
table_class = "infolist" table_class = "infolist"
if len(family_handle_list) > 1: if len(family_list) > 1:
table_class += " fixed_subtables" table_class += " fixed_subtables"
with Html("table", class_ = table_class) as table: with Html("table", class_ = table_class) as table:
section += table section += table
for fhandle in family_handle_list: for fhandle in family_list:
family = db.get_family_from_handle(fhandle) family = db.get_family_from_handle(fhandle)
if family: if family:
self.display_spouse(family, table, ppl_handle_list, place_lat_long)
self.display_partner(family, table, ppl_handle_list, place_lat_long)
childlist = family.get_child_ref_list() childlist = family.get_child_ref_list()
if childlist: if childlist:
trow = Html("tr") + ( trow = Html("tr") + (
Html("td", " ", class_ = "ColumnType", inline = True), Html("td", " ", class_ = "ColumnType", inline = True),
Html("td", _("Children"), class_ = "ColumnAttribute", inline = True) Html("td", _("Children"), class_ = "ColumnAttribute", inline = True)
) )
table += trow table += trow
tcell = Html("td", class_ = "ColumnValue") tcell = Html("td", class_ = "ColumnValue")
trow += tcell trow += tcell
ordered = Html("ol") ordered = Html("ol")
tcell += ordered tcell += ordered
childlist = [child_ref.ref for child_ref in childlist] childlist = [child_ref.ref for child_ref in childlist]
# add individual's children event's place to family map # add individual's children event places to family map...
if self.familymappages: if self.familymappages:
for handle in childlist: for handle in childlist:
child = db.get_person_from_handle(handle) child = db.get_person_from_handle(handle)
self._get_event_place(child, self.ind_list, place_lat_long) self._get_event_place(child, ppl_handle_list, place_lat_long)
children = add_birthdate(db, childlist) children = add_birthdate(db, childlist)
if birthorder: if birthorder:
@ -1958,11 +1955,9 @@ class BasePage(object):
dummy, attrtable = self.display_attribute_header() dummy, attrtable = self.display_attribute_header()
tcell += attrtable tcell += attrtable
self.display_attr_list(family_attribute_list, attrtable) self.display_attr_list(family_attribute_list, attrtable)
# return section to its caller
return section return section
def display_partner(self, family, table, ppl_handle_list, place_lat_long): def display_spouse(self, family, table, ppl_handle_list, place_lat_long):
""" """
display an individual's partner display an individual's partner
@ -1971,14 +1966,12 @@ class BasePage(object):
@param: ppl_handle_list -- people handle list from the filter that was applied to database @param: ppl_handle_list -- people handle list from the filter that was applied to database
@param: place_lat_long -- for use in Family Map Pages @param: place_lat_long -- for use in Family Map Pages
""" """
if not family: db = self.report.database
return
gender = self.person.get_gender() gender = self.person.get_gender()
reltype = family.get_relationship() reltype = family.get_relationship()
db = self.report.database
if reltype == FamilyRelType.MARRIED: if reltype == gen.lib.FamilyRelType.MARRIED:
if gender == gen.lib.Person.FEMALE: if gender == gen.lib.Person.FEMALE:
relstr = _("Husband") relstr = _("Husband")
elif gender == gen.lib.Person.MALE: elif gender == gen.lib.Person.MALE:
@ -1988,40 +1981,41 @@ class BasePage(object):
else: else:
relstr = _("Partner") relstr = _("Partner")
partner_handle = ReportUtils.find_spouse(self.person, family) spouse = False
if partner_handle: spouse_handle = ReportUtils.find_spouse(self.person, family)
partner = db.get_person_from_handle(partner_handle) if spouse_handle:
partner_name = self.get_name(partner) spouse = db.get_person_from_handle(spouse_handle)
else:
partner_name = _("Unknown")
# family relationship type
rtype = str(family.get_relationship()) rtype = str(family.get_relationship())
trow = Html("tr", class_ = "BeginFamily") + (
Html("td", rtype, class_ = "ColumnType", inline = True), # display family relationship status...
Html("td", relstr, class_ = "ColumnAttribute", inline = True) if spouse:
if self.familymappages:
self._get_event_place(spouse, ppl_handle_list, place_lat_long)
trow = Html("tr", class_ ="BeginFamily") + (
Html("td", rtype, class_ ="ColumnType", inline =True),
Html("td", relstr, class_ ="ColumnAttribute", inline =True)
) )
table += trow table += trow
tcell = Html("td", class_ ="ColumnValue")
trow += tcell
tcell = Html("td", class_ = "ColumnValue") use_link = check_person_database(spouse, ppl_handle_list)
trow += tcell gid = spouse.get_gramps_id()
if use_link:
# display partner's name url = self.report.build_url_fname_html(spouse_handle, "ppl", True)
if partner_handle: tcell += self.person_link(url, spouse, _NAME_STYLE_DEFAULT, gid =gid)
if check_person_database(partner_handle, ppl_handle_list):
url = self.report.build_url_fname_html(partner_handle, "ppl", True)
tcell += self.person_link(url, partner, _NAME_STYLE_DEFAULT, gid = partner.gramps_id)
else: else:
tcell += partner_name reltionships
# display family events; such as marriage and divorce...
# display family events; such as marriage and divorce events
family_events = family.get_event_ref_list() family_events = family.get_event_ref_list()
if family_events: if family_events:
trow = Html("tr") + ( trow = Html("tr") + (
Html("td", " ", class_ = "ColumnType", inline = True), Html("td", " ", class_ = "ColumnType", inline = True),
Html("td", " ", class_ = "ColumnAttribute", inline = True), Html("td", " ", class_ = "ColumnAttribute", inline = True),
Html("td", self.format_family_events(family_events, place_lat_long), class_ = "ColumnValue") Html("td", self.format_family_events(family_events, place_lat_long), class_ = "ColumnValue")
) )
table += trow table += trow
def display_child_link(self, chandle, ppl_handle_list): def display_child_link(self, chandle, ppl_handle_list):
@ -2836,15 +2830,15 @@ class FamilyPage(BasePage):
def __init__(self, report, title, person, family, place_list, ppl_handle_list, place_lat_long): def __init__(self, report, title, person, family, place_list, ppl_handle_list, place_lat_long):
if (not person or not family): if (not person or not family):
return return
db = report.database db = report.database
BasePage.__init__(self, report, title, family.get_gramps_id())
self.bibli = Bibliography() self.bibli = Bibliography()
self.person = person self.person = person
self.place_list = place_list self.place_list = place_list
self.up = True self.up = True
birthorder = self.report.options["birthorder"] birthorder = self.report.options["birthorder"]
self.familymappages = self.report.options["familymappages"]
BasePage.__init__(self, report, title, family.get_gramps_id())
of = self.report.create_file(family.get_handle(), "fam") of = self.report.create_file(family.get_handle(), "fam")
familydetailpage, head, body = self.write_header(_("Family/ Relationship")) familydetailpage, head, body = self.write_header(_("Family/ Relationship"))
@ -4680,6 +4674,9 @@ class IndividualPage(BasePage):
self.name = self.get_name(person) self.name = self.get_name(person)
db = report.database db = report.database
# for use in family map pages...
self.familymappages = self.report.options["familymappages"]
of = self.report.create_file(person.get_handle(), "ppl") of = self.report.create_file(person.get_handle(), "ppl")
self.up = True self.up = True
indivdetpage, head, body = self.write_header(self.sort_name) indivdetpage, head, body = self.write_header(self.sort_name)
@ -4714,10 +4711,9 @@ class IndividualPage(BasePage):
individualdetail += sect3 individualdetail += sect3
# display relationships # display relationships
person_family_handle_list = self.person.get_family_handle_list() relationships = self.display_relationships(ind_list, place_lat_long)
sect4 = self.display_ind_families(person_family_handle_list, ind_list, place_lat_long) if relationships is not None:
if sect4 is not None: individualdetail += relationships
individualdetail += sect4
# display LDS ordinance # display LDS ordinance
sect5 = self.display_lds_ordinance(person) sect5 = self.display_lds_ordinance(person)
@ -5626,7 +5622,7 @@ class IndividualPage(BasePage):
if not first: if not first:
trow = Html("tr") + ( trow = Html("tr") + (
Html("td", " ", colspan =2, inline = True) Html("td", " ", colspan =2, inline = True)
) )
table += trow table += trow
else: else:
first = False first = False
@ -5635,23 +5631,23 @@ class IndividualPage(BasePage):
father_handle = family.get_father_handle() father_handle = family.get_father_handle()
if father_handle: if father_handle:
father = db.get_person_from_handle(father_handle) father = db.get_person_from_handle(father_handle)
if father:
trow = Html("tr") trow = Html("tr") + \
table += trow (self.display_parent(father_handle, _("Father"), frel)
)
tcell1, tcell2 = self.display_parent(father_handle, _("Father"), frel) table += trow
trow += (tcell1, tcell2)
# get the mother # get the mother
mother_handle = family.get_mother_handle() mother_handle = family.get_mother_handle()
if mother_handle: if mother_handle:
mother = db.get_person_from_handle(mother_handle) mother = db.get_person_from_handle(mother_handle)
if mother:
trow = Html("tr") trow = Html("tr") + \
table += trow (self.display_parent(mother_handle, _("Mother"), mrel)
)
tcell1, tcell2 = self.display_parent(mother_handle, _("Mother"), mrel) table += trow
trow += (tcell1, tcell2)
first = False first = False
if len(child_ref_list) > 1: if len(child_ref_list) > 1:

View File

@ -161,20 +161,19 @@ h2 {
float: center; float: center;
} }
h3 { h3 {
font:normal 2em/1.2em serif; font: normal 1.6em serif;
text-align:center; text-align: center;
margin:0; margin: 0 auto;
padding:.5em 20px .2em 20px; padding:.5em 20px .2em 20px;
border-bottom: double 4px #000; border-bottom: double 4px #000;
} }
h4 { h4 {
font: normal 1.2em/1.2em serif; font: normal 1em serif;
color: #FFF;
margin-top: .3cm;
padding: .2em 0 .2em 20px;
background-color: #00029D; background-color: #00029D;
color: #FFF;
padding: .2em 0 .2em 20px;
border-width: 4px 0px 4px 0px; border-width: 4px 0px 4px 0px;
border-style: solid; border-style: grooved;
border-color: #13A926; border-color: #13A926;
} }
h5, h6 { h5, h6 {
@ -426,11 +425,12 @@ div#IndividualDetail {
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
#IndividualDetail div table.infolist tr td { #IndividualDetail div#summaryarea table.infolist tr td {
font: normal .9em/1.2em sans-serif; font: normal .9em/1.2em sans-serif;
vertical-align: top; vertical-align: top;
border: none;
} }
div#IndividualDetail div table.infolist tr td a { div#IndividualDetail div#summaryarea table.infolist tr td a {
display: inline; display: inline;
} }
div#IndividualDetail table.infolist tr td a:hover { div#IndividualDetail table.infolist tr td a:hover {
@ -626,6 +626,9 @@ table.eventlist tbody tr td.ColumnSources {
table.eventlist tbody tr td.ColumnPerson { table.eventlist tbody tr td.ColumnPerson {
width: 35%; width: 35%;
} }
div#IndividualDetail div#families table.eventlist tr td {
border-bottom: dashed 1px #000;
}
div#EventList table.infolist tbody tr td { div#EventList table.infolist tbody tr td {
border-bottom: dashed 1px #000; border-bottom: dashed 1px #000;
} }
@ -1100,6 +1103,9 @@ div#parents table.infolist tbody tr td.ColumnValue ol {
div#parents table.infolist tbody tr td.ColumnValue ol li a { div#parents table.infolist tbody tr td.ColumnValue ol li a {
text-decoration: underline; text-decoration: underline;
} }
div#IndividualDetail div#parents table.infolist tr td {
border: none;
}
/* Subsections : Families /* Subsections : Families
----------------------------------------------------- */ ----------------------------------------------------- */