From 6a5c1a97099e57860fb4e072e4f20b8565af34a0 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 2 Oct 2023 18:10:27 +0200 Subject: [PATCH] Add attribute citations --- gramps/plugins/webreport/basepage.py | 13 ++++++------- gramps/plugins/webreport/narrativeweb.py | 3 +++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gramps/plugins/webreport/basepage.py b/gramps/plugins/webreport/basepage.py index 74e2a7a2089..4e905590b79 100644 --- a/gramps/plugins/webreport/basepage.py +++ b/gramps/plugins/webreport/basepage.py @@ -912,13 +912,12 @@ 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 f4f6098b5af..dfff24de9da 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