Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Citations not included on the Narrative Web - Re: Add citations to event references #1608

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gramps/gen/proxy/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
24 changes: 17 additions & 7 deletions gramps/plugins/webreport/basepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,12 @@ 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
Expand All @@ -911,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", "&nbsp")
+ Html("td", attrdesc, colspan=3)
+ Html("td", attrrefs)
)
htmllist.extend(attr_row)

# also output notes attached to the attributes
notelist = attr.get_note_list()
Expand Down
9 changes: 9 additions & 0 deletions gramps/plugins/webreport/narrativeweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,11 @@ 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)
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
Expand Down Expand Up @@ -753,6 +758,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)
Expand Down
Loading