From 5dc85473b705a200817766d560330a4200fdb016 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Thu, 19 Jan 2012 08:48:41 +0000 Subject: [PATCH] Added code to handle when the event has multiple participants such as a census record. svn: r18753 --- src/plugins/webreport/NarrativeWeb.py | 43 +++++++++++++++---- src/plugins/webstuff/css/Web_Basic-Ash.css | 11 +++-- src/plugins/webstuff/css/Web_Basic-Blue.css | 4 +- .../webstuff/css/Web_Basic-Cypress.css | 11 +++-- src/plugins/webstuff/css/Web_Basic-Lilac.css | 11 +++-- src/plugins/webstuff/css/Web_Basic-Peach.css | 11 +++-- src/plugins/webstuff/css/Web_Basic-Spruce.css | 11 +++-- src/plugins/webstuff/css/Web_Mainz.css | 11 +++-- src/plugins/webstuff/css/Web_Nebraska.css | 6 ++- .../webstuff/css/Web_Print-Default.css | 12 +++--- src/plugins/webstuff/css/Web_Visually.css | 12 +++--- 11 files changed, 98 insertions(+), 45 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 7499b9f18..6420a17cd 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -4500,6 +4500,9 @@ class SourcePage(BasePage): for (sort_value, event_handle) in data_list: event = self.dbase_.get_event_from_handle(event_handle) 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]: 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) 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( Html("li", title_str) ) elif spouse: ordered4.extend( - Html("li", slink, inline = True) + Html("li", slink + ", %s" % event_date, inline = True) ) elif husband: 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: - ordered4.extend( - Html("li", self.event_link(event_handle, - _dd.display(event.get_date_object()) or event_type, - event.get_gramps_id(), self.up)) - ) + 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( + Html("li", self.event_link(event_handle, self.get_name(obj) + ", %s" % event_date, + 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 ordered3 += list3 list2 += ordered3 diff --git a/src/plugins/webstuff/css/Web_Basic-Ash.css b/src/plugins/webstuff/css/Web_Basic-Ash.css index 79f015e30..48b385b4b 100644 --- a/src/plugins/webstuff/css/Web_Basic-Ash.css +++ b/src/plugins/webstuff/css/Web_Basic-Ash.css @@ -368,16 +368,19 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } /* Contact diff --git a/src/plugins/webstuff/css/Web_Basic-Blue.css b/src/plugins/webstuff/css/Web_Basic-Blue.css index ac8f1d15d..2cd7f9885 100644 --- a/src/plugins/webstuff/css/Web_Basic-Blue.css +++ b/src/plugins/webstuff/css/Web_Basic-Blue.css @@ -783,7 +783,9 @@ div#SourceCitationReferents ol.Col3 { div#SourceCitationReferents ol.Col4 { list-style-type: square } - +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman +} /* Repositories ------------------------------------------------------ */ diff --git a/src/plugins/webstuff/css/Web_Basic-Cypress.css b/src/plugins/webstuff/css/Web_Basic-Cypress.css index 6fec81b5b..c4e620883 100644 --- a/src/plugins/webstuff/css/Web_Basic-Cypress.css +++ b/src/plugins/webstuff/css/Web_Basic-Cypress.css @@ -406,16 +406,19 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } /* Contact diff --git a/src/plugins/webstuff/css/Web_Basic-Lilac.css b/src/plugins/webstuff/css/Web_Basic-Lilac.css index becb87b4f..c3d7d6cc7 100644 --- a/src/plugins/webstuff/css/Web_Basic-Lilac.css +++ b/src/plugins/webstuff/css/Web_Basic-Lilac.css @@ -407,16 +407,19 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } /* Contact diff --git a/src/plugins/webstuff/css/Web_Basic-Peach.css b/src/plugins/webstuff/css/Web_Basic-Peach.css index abdec1a90..a09495e6f 100644 --- a/src/plugins/webstuff/css/Web_Basic-Peach.css +++ b/src/plugins/webstuff/css/Web_Basic-Peach.css @@ -407,16 +407,19 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } /* Contact diff --git a/src/plugins/webstuff/css/Web_Basic-Spruce.css b/src/plugins/webstuff/css/Web_Basic-Spruce.css index ea02f291f..ebe8e17e6 100644 --- a/src/plugins/webstuff/css/Web_Basic-Spruce.css +++ b/src/plugins/webstuff/css/Web_Basic-Spruce.css @@ -407,16 +407,19 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } /* Contact diff --git a/src/plugins/webstuff/css/Web_Mainz.css b/src/plugins/webstuff/css/Web_Mainz.css index ee6b2f6b3..07aa43686 100644 --- a/src/plugins/webstuff/css/Web_Mainz.css +++ b/src/plugins/webstuff/css/Web_Mainz.css @@ -359,16 +359,19 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } /* Contact diff --git a/src/plugins/webstuff/css/Web_Nebraska.css b/src/plugins/webstuff/css/Web_Nebraska.css index 079a7a098..b899cd553 100644 --- a/src/plugins/webstuff/css/Web_Nebraska.css +++ b/src/plugins/webstuff/css/Web_Nebraska.css @@ -518,9 +518,11 @@ div#SourceCitationReferents ol.Col3 { list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: square + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } - /* Relationships ================================================= */ diff --git a/src/plugins/webstuff/css/Web_Print-Default.css b/src/plugins/webstuff/css/Web_Print-Default.css index 6759dbdd6..5dcc9d3ef 100644 --- a/src/plugins/webstuff/css/Web_Print-Default.css +++ b/src/plugins/webstuff/css/Web_Print-Default.css @@ -295,18 +295,20 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } - /* Individuals ----------------------------------------------------- */ diff --git a/src/plugins/webstuff/css/Web_Visually.css b/src/plugins/webstuff/css/Web_Visually.css index 6a019e8a8..44b09f3e0 100644 --- a/src/plugins/webstuff/css/Web_Visually.css +++ b/src/plugins/webstuff/css/Web_Visually.css @@ -964,18 +964,20 @@ div#SourceDetail { margin: 0 auto; } div#SourceCitationReferents ol.Col1 { - list-style-type: decimal-leading-zero; + list-style-type: decimal } div#SourceCitationReferents ol.Col2 { - list-style-type: upper-alpha; + list-style-type: upper-alpha } div#SourceCitationReferents ol.Col3 { - list-style-type: lower-alpha; + list-style-type: lower-alpha } div#SourceCitationReferents ol.Col4 { - list-style-type: upper-roman;; + list-style-type: disc +} +div#SourceCitationReferents ol.Col5 { + list-style-type: lower-roman } - /* Repositories