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

Show other roles for an event in the narrative web report #1633

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

V-Smeets
Copy link
Contributor

Include an option to the Narrative Web Page generator to also include other roles for an event.

A person can have multiple events. The events where the person is the primary person, are normally shown in the report. With the additional option "Include other roles" enabled (default disabled), the report will also show the persons that also have some role in that event.

The result looks like this:
image

@emyoulation
Copy link
Contributor

How timely! A user asked for a comparable enhancement to show all Shared Event participants in the Complete Individual Report on Discourse

https://gramps.discourse.group/t/shared-events-and-participants-reporting/4712

@drjimbouk
Copy link

Hi Vincent.
I'm that user!
How do I get copies of the updated files? I don't know my way around GitHub.
I would like to see whether it would work for the forms construct for data entry of census data, for example.
TIA,
James

@emyoulation
Copy link
Contributor

There is a discussion about how to introduce non-programmers to Pull Requests in GitHub. There is a 1st draft describing how the patches can be applied to the Gramps on their local machine :

https://gramps.discourse.group/t/create-guidance-document-for-users-about-patching/4699

@SNoiraud
Copy link
Member

It will not work on a gramps 5.1
You need to have gramps 5.2.

@SNoiraud
Copy link
Member

It does not work for me.

File "/home/gramps/pull-gramps-1/gramps/plugins/webreport/basepage.py", line 929, in display_event_row
witnessed_person_handles = find_witnessed_people(self.r_db, self.person)
AttributeError: 'FamilyPages' object has no attribute 'person'

@SNoiraud
Copy link
Member

SNoiraud commented Jan 23, 2024

You added a new page name "other roles".
I have two things to say:
1 - either your patch is incomplete and we have a missing module that is not called.
2 - either the new page should be removed in the gramps navigation sidebar
If you add no module, you should remove the lines 1897 and 2078

Another thing:
If you want your modification works in family pages, you should replace the line 927:

if self.inc_other_roles:

by
if self.inc_other_roles and not omit:

@V-Smeets
Copy link
Contributor Author

I have removed the lines in 1897 and 2078. That was a copy/paste error on my side.

The problem on line 927 is different. I only considered events on persons and not on families. Your fix "and not omit" is not correct. I'm working on a better fix that will work.

@SNoiraud
Copy link
Member

Your fix "and not omit" is not correct

Yes, it is the only solution for that problem. The omit variable is set only in the family page. I tested on my database with 15000 persons, 23000 events and 5200 families. No crash and I have the other roles for the persons.

@fooltech
Copy link

Thanks Serge your fix worked for me by tree is about the same size as yours
to V-Smeets good patch
Phil

@SNoiraud
Copy link
Member

I'm working on a better fix that will work.

Do you want to add "other roles" for familes events ?

@V-Smeets
Copy link
Contributor Author

I'm working on a better fix that will work.

Do you want to add "other roles" for familes events ?

Yes, that's what I'm working on.

@V-Smeets V-Smeets marked this pull request as draft January 24, 2024 16:02
@fooltech
Copy link

OK so where I am now the Report is working, I now have a Tab for other roles ( which generates the error "file not found" which is to be expected) and I can see other roles when I go into either of Individuals or Surnames. Could I ask what is the logic by behind extending to Families when by definition "another role" is an individual who is present at the Event of a second individual. I am not saying it would not be valid I am just trying to get my head round the concept.
Phil

@V-Smeets
Copy link
Contributor Author

I just pushed some commits. The tab "Other roles" is now removed.

A Person can have events (with a role) and a Family can also have events (with a role). That means that an event can be referenced by a Person or a Family.
My current commit can only show multiple roles for a person on a PersonPage. On that PersonPage, it will not show any families that also have a role in that same event.

My goal is to extend everywhere where an event is shown (PersonPage and FamilyPage), to also show the other objects (Person or Family) that also have a role in that event.

@fooltech
Copy link

fooltech commented Jan 24, 2024 via email

@emyoulation
Copy link
Contributor

In general, Family secondary objects are things that apply to both spouses (not the Family's children or one spouse) in equal measure as "Primaries"

So they are good for a report/article that might list "Mr. and Mrs. John and Mary Smith" ... or "Dr. and Mrs. Jones". Both are considered as 'Primary' without the hassles of endless sharing.

@fooltech
Copy link

fooltech commented Jan 24, 2024 via email

@emyoulation
Copy link
Contributor

I'm surprised at that. Some people only use Family for Events that change the relationship: engagement, marriage, divorce, et cetera.

But when you consider Gallery, Notes, Sources; it is a lot broader. And then there are Residences, Property and such where to don't want doubling of pins on the Maps.

@fooltech
Copy link

fooltech commented Jan 24, 2024 via email

@SNoiraud
Copy link
Member

I'm surprised at that. Some people only use Family for Events that change the relationship: engagement,
marriage, divorce, et cetera.

This is how you should do. These are not person events.

@fooltech
Copy link

fooltech commented Jan 25, 2024 via email

@SNoiraud
Copy link
Member

For me you are wrong and this is how gramps is working.
A family start with a marriage event and end with either a divorce either the death of one of the two partners.
If you have a divorce then the two same partners remarry, you must create a second marriage with the new marriage event.
etc...

@fooltech
Copy link

fooltech commented Jan 25, 2024 via email

@Nick-Hall
Copy link
Member

Some people only use Family for Events that change the relationship: engagement,
marriage, divorce, et cetera.

Yes. We inherited this functionality from Gedcom.

When a Family is a participant in an event, the participants are the two people in the relationship. These events will typically be relationship events and the Family will have the role of "Family". This indicates that the role of the two people in the family is primary.

Although it is possible, I can't see a use for adding more than one family to an event, or setting the role for a Family to anything other than "Family". Does anyone do this?

It is also possible to add two people to a marriage event with the roles "Husband" and "Wife". Using this approach is likely to cause problems and is not recommended.

@V-Smeets V-Smeets marked this pull request as ready for review January 27, 2024 13:57
@V-Smeets
Copy link
Contributor Author

I have rewritten the code. It now works correctly on the person page and the family page. It shows for every event also the other percipitence (person or family) dat have some role in the event.

The lint check failed on my last commit. It complains about files that I haven't touched. The files I touch are correctly formatted.

To me, this PR is ready to be merged.

@Nick-Hall
Copy link
Member

The lint check failed on my last commit. It complains about files that I haven't touched. The files I touch are correctly formatted.

Don't worry about this. I'll fix it.

@Nick-Hall
Copy link
Member

Rebased.

@drjimbouk
Copy link

I've patched my system and run the web report against my data entered via forms. No hiccups and the changes address some of my wishes. A couple of observations: What is the purpose of the list of roles in each individual events section? Where a hyperlink exists it take the user to an individual's page rather that the event where the individual's role is detailed. Whilst I appreciate that this may be beyond the scope of the submitter's use case, it would be invaluable if other actors in the event where an individual had a role were also reported, together with associated attributes as is the case for marriage events.

@V-Smeets
Copy link
Contributor Author

Hi @drjimbouk,

To your questions:

  • What is the purpose of the list of roles in each individual events section?
    There can be multiple people that have some role in an event. For a baptising, the primary person is the one that is baptized. There can be some other people that were a witniss to the event. They can all be linked to the same event.
    When a family is moving to an other place, then you can assign all the persons of the family as having a primary role in that event. They all move to the new place.
  • Where a hyperlink exists it take the user to an individual's page rather that the event where the individual's role is detailed.
    There is no page that shows only a single event. So it is not possible to link to such a page. I had no intend to create such an event page.
    The show the other people that have a role in that same event. The name of the other person contains a link to the page of that person. There you will see the same event, but then viewed from that other person.
  • ... together with associated attributes
    What additional assiciated attribute are you expecting? It is not wise to add too much information (birthday, ...) to the names of the other persons. It would cluther the table with unrelated (to the primary person) information.

@drjimbouk
Copy link

drjimbouk commented Apr 25, 2024 via email

@Nick-Hall
Copy link
Member

@SNoiraud Is this PR ready to merge?

@SNoiraud
Copy link
Member

SNoiraud commented Jan 3, 2025

@SNoiraud Is this PR ready to merge?

I did not test it because I don't use this kind of feature.

@Nick-Hall Nick-Hall changed the title webreport.BasePage: Show other roles for an event. Show other roles for an event in the narrative web report Jan 7, 2025
@Nick-Hall Nick-Hall merged commit 6f4c599 into gramps-project:master Jan 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants