Added code to handle when the event has multiple participants such as a census record.

svn: r18753
This commit is contained in:
Rob G. Healey 2012-01-19 08:48:41 +00:00
parent 523406f38c
commit 5dc85473b7
11 changed files with 98 additions and 45 deletions

View File

@ -4500,6 +4500,9 @@ class SourcePage(BasePage):
for (sort_value, event_handle) in data_list: for (sort_value, event_handle) in data_list:
event = self.dbase_.get_event_from_handle(event_handle) event = self.dbase_.get_event_from_handle(event_handle)
if (event and event_handle in db_event_handles): if (event and event_handle in db_event_handles):
event_date = _dd.display(event.get_date_object())
# marriage or Divorce Event...
if event.get_type() in [gen.lib.EventType.MARRIAGE, gen.lib.EventType.DIVORCE]: if event.get_type() in [gen.lib.EventType.MARRIAGE, gen.lib.EventType.DIVORCE]:
for (classname, newhandle) in self.dbase_.find_backlink_handles(event_handle, ["Family"]): for (classname, newhandle) in self.dbase_.find_backlink_handles(event_handle, ["Family"]):
@ -4525,24 +4528,48 @@ class SourcePage(BasePage):
family.get_gramps_id(), self.up) family.get_gramps_id(), self.up)
if spouse and husband: if spouse and husband:
title_str = (_("Marriage of ") + "%s" % hlink + _(" and ") + "%s" % slink) title_str = ("%s" % hlink + _(" and ") + "%s" % slink + ", %s" % event_date)
ordered4.extend( ordered4.extend(
Html("li", title_str) Html("li", title_str)
) )
elif spouse: elif spouse:
ordered4.extend( ordered4.extend(
Html("li", slink, inline = True) Html("li", slink + ", %s" % event_date, inline = True)
) )
elif husband: elif husband:
ordered4.extend( ordered4.extend(
Html("li", hlink, inline = True) Html("li", hlink + ", %s" % event_date, inline = True)
) )
# any other event type...
# this occurs when an event has multiple participants...
else: else:
back_handle_list = self.dbase_.find_backlink_handles(event_handle, ["Person"])
back_handle_list = [(classname, handle) for (classname, handle) in back_handle_list]
if back_handle_list:
if len(back_handle_list) == 1:
for (classname, newhandle) in back_handle_list:
obj = self.dbase_.get_person_from_handle(newhandle)
if obj:
ordered4.extend( ordered4.extend(
Html("li", self.event_link(event_handle, Html("li", self.event_link(event_handle, self.get_name(obj) + ", %s" % event_date,
_dd.display(event.get_date_object()) or event_type,
event.get_gramps_id(), self.up)) event.get_gramps_id(), self.up))
) )
else:
list4 = Html("li", event_date)
# ordered and list item #5, Multiple Participants...
ordered5 = Html("ol", class_ = "Col5 Multiple-Participants")
for (classname, newhandle) in back_handle_list:
obj = self.dbase_.get_person_from_handle(newhandle)
if obj:
ordered5.extend(
Html("li", self.event_link(event_handle, self.get_name(obj),
event.get_gramps_id(), self.up))
)
list4 += ordered5
ordered4 += list4
list3 += ordered4 list3 += ordered4
ordered3 += list3 ordered3 += list3
list2 += ordered3 list2 += ordered3

View File

@ -368,16 +368,19 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Contact /* Contact

View File

@ -783,7 +783,9 @@ div#SourceCitationReferents ol.Col3 {
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: square list-style-type: square
} }
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
}
/* Repositories /* Repositories
------------------------------------------------------ */ ------------------------------------------------------ */

View File

@ -406,16 +406,19 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Contact /* Contact

View File

@ -407,16 +407,19 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Contact /* Contact

View File

@ -407,16 +407,19 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Contact /* Contact

View File

@ -407,16 +407,19 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Contact /* Contact

View File

@ -359,16 +359,19 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Contact /* Contact

View File

@ -518,9 +518,11 @@ div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: square list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Relationships /* Relationships
================================================= */ ================================================= */

View File

@ -295,18 +295,20 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Individuals /* Individuals
----------------------------------------------------- */ ----------------------------------------------------- */

View File

@ -964,18 +964,20 @@ div#SourceDetail {
margin: 0 auto; margin: 0 auto;
} }
div#SourceCitationReferents ol.Col1 { div#SourceCitationReferents ol.Col1 {
list-style-type: decimal-leading-zero; list-style-type: decimal
} }
div#SourceCitationReferents ol.Col2 { div#SourceCitationReferents ol.Col2 {
list-style-type: upper-alpha; list-style-type: upper-alpha
} }
div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col3 {
list-style-type: lower-alpha; list-style-type: lower-alpha
} }
div#SourceCitationReferents ol.Col4 { div#SourceCitationReferents ol.Col4 {
list-style-type: upper-roman;; list-style-type: disc
}
div#SourceCitationReferents ol.Col5 {
list-style-type: lower-roman
} }
/* Repositories /* Repositories