From cd2387bc317e84fccf05cfaa40312e3df1a2be90 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 2 Oct 2023 18:08:58 +0200 Subject: [PATCH 1/3] New citations not included on the Narrative Web Fixes #13046 --- gramps/plugins/webreport/basepage.py | 3 ++- gramps/plugins/webreport/narrativeweb.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/webreport/basepage.py b/gramps/plugins/webreport/basepage.py index 843aa631f93..4581b36b4e7 100644 --- a/gramps/plugins/webreport/basepage.py +++ b/gramps/plugins/webreport/basepage.py @@ -896,7 +896,8 @@ def display_event_row( trow2 = Html("tr") # get event source references - srcrefs = self.get_citation_links(event.get_citation_list()) or " " + srcrefs = self.get_citation_links(event.get_citation_list() + + event_ref.get_citation_list()) or " " trow += Html("td", srcrefs, class_="ColumnSources", rowspan=2) # get event notes diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index ecd762bf2d8..2ce90965511 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -723,6 +723,8 @@ def _add_person(self, person_handle, bkref_class, bkref_handle): for citation_handle in event.get_citation_list(): self._add_citation(citation_handle, Person, person_handle) + for citation_handle in evt_ref.get_citation_list(): + self._add_citation(citation_handle, Person, person_handle) ############### Families section ############## # Tell the families tab to display this individuals families @@ -753,6 +755,10 @@ def _add_person(self, person_handle, bkref_class, bkref_handle): self._add_citation( cite_hdl, Person, person_handle ) + for cite_hdl in evt_ref.get_citation_list(): + self._add_citation( + cite_hdl, Person, person_handle + ) # add the family media and the family event media if the # families page is not being displayed (If it is displayed, # the media are linked from the families page) From e0aa9c8dfe8df46d42d19fcc6e2a29ee5e877075 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 2 Oct 2023 18:10:27 +0200 Subject: [PATCH 2/3] Add attribute citations --- gramps/plugins/webreport/basepage.py | 25 ++++++++++++++++-------- gramps/plugins/webreport/narrativeweb.py | 3 +++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/gramps/plugins/webreport/basepage.py b/gramps/plugins/webreport/basepage.py index 4581b36b4e7..bbae7d08365 100644 --- a/gramps/plugins/webreport/basepage.py +++ b/gramps/plugins/webreport/basepage.py @@ -896,8 +896,12 @@ def display_event_row( trow2 = Html("tr") # get event source references - srcrefs = self.get_citation_links(event.get_citation_list() + - event_ref.get_citation_list()) or " " + srcrefs = ( + self.get_citation_links( + event.get_citation_list() + event_ref.get_citation_list() + ) + or " " + ) trow += Html("td", srcrefs, class_="ColumnSources", rowspan=2) # get event notes @@ -912,13 +916,18 @@ def display_event_row( # cached original attrlist.extend(event_ref.get_attribute_list()) for attr in attrlist: - htmllist.extend( - Html( - "p", - self._("%(str1)s: %(str2)s") - % {"str1": Html("b", attr.get_type()), "str2": attr.get_value()}, - ) + attrrefs = self.get_citation_links(attr.get_citation_list()) + attrdesc = self._("%(str1)s: %(str2)s") % { + "str1": Html("b", attr.get_type()), + "str2": attr.get_value(), + } + attr_row = ( + Html("tr") + + Html("td", " ") + + Html("td", attrdesc, colspan=3) + + Html("td", attrrefs) ) + htmllist.extend(attr_row) # also output notes attached to the attributes notelist = attr.get_note_list() diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index 2ce90965511..e07090b03e2 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -725,6 +725,9 @@ def _add_person(self, person_handle, bkref_class, bkref_handle): self._add_citation(citation_handle, Person, person_handle) for citation_handle in evt_ref.get_citation_list(): self._add_citation(citation_handle, Person, person_handle) + for attr in evt_ref.get_attribute_list(): + for citation_handle in attr.get_citation_list(): + self._add_citation(citation_handle, Event, evt_ref.ref) ############### Families section ############## # Tell the families tab to display this individuals families From 220e1b6b0563a0406057e831a73837a70d3096f2 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 9 Oct 2023 19:19:10 +0200 Subject: [PATCH 3/3] Add new event reference citations to the private proxy --- gramps/gen/proxy/private.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gramps/gen/proxy/private.py b/gramps/gen/proxy/private.py index 1a8c77f9b37..9e0c8d18da1 100644 --- a/gramps/gen/proxy/private.py +++ b/gramps/gen/proxy/private.py @@ -830,6 +830,7 @@ def sanitize_event_ref(db, event_ref): new_ref.set_reference_handle(event_ref.get_reference_handle()) new_ref.set_role(event_ref.get_role()) + copy_citation_ref_list(db, event_ref, new_ref) copy_notes(db, event_ref, new_ref) copy_attributes(db, event_ref, new_ref)