Skip to content

Commit 120aa12

Browse files
committed
Add more context to the detail column.
The additional context is to help the user understand what data the action will be adding to the family tree.
1 parent a79acec commit 120aa12

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Form/UK1841.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def get_actions(dbstate, citation, form_event):
129129
birth_range = (birth_date - 5).get_dmy() + (False,) + birth_date.get_dmy() + (False,)
130130
birth_date.set(Date.QUAL_NONE, Date.MOD_RANGE, birth_date.get_calendar(), birth_range, newyear=birth_date.get_new_year())
131131
birth_date.set_quality(Date.QUAL_CALCULATED)
132-
133-
actions.append((name_displayer.display(person), date_displayer.display(birth_date),
132+
detail = _('Age: {age}\nDate: {date}').format(age=age_string, date=date_displayer.display(birth_date))
133+
actions.append((name_displayer.display(person), detail,
134134
lambda dbstate, uistate, track, citation_handle = citation.handle, person_handle = person.handle, birth_date_ = birth_date: actionutils.add_event_to_person(dbstate, uistate, track, person_handle, EventType.BIRTH, birth_date_, None, citation_handle, EventRoleType.PRIMARY)))
135135
return (_("Add Birth event"), actions)
136136

@@ -142,7 +142,7 @@ def get_actions(dbstate, citation, form_event):
142142
for (person, attr) in actionutils.get_form_person_attr(db, form_event.get_handle(), 'Occupation'):
143143
occupation = attr.get_value()
144144
if (occupation) :
145-
actions.append((name_displayer.display(person), occupation,
145+
actions.append((name_displayer.display(person), _('Description: {occupation}').format(occupation=occupation),
146146
lambda dbstate, uistate, track, citation_handle = citation.handle, person_handle = person.handle, occupation_ = occupation: actionutils.add_event_to_person(dbstate, uistate, track, person_handle, EventType.OCCUPATION, form_event.get_date_object(), occupation_, citation_handle, EventRoleType.PRIMARY)))
147147
return (_("Add Occupation event"), actions)
148148

@@ -160,10 +160,11 @@ def get_actions(dbstate, citation, form_event):
160160
people.append((person.get_handle(), EventRoleType.PRIMARY))
161161
actions = []
162162
if people:
163-
place = None
163+
detail = None
164164
if form_event.get_place_handle():
165165
place = place_displayer.display(db, db.get_place_from_handle(form_event.get_place_handle()))
166-
actions.append((get_participant_from_event(db, form_event.get_handle()), place,
166+
detail = _('Place: {place}').format(place=place)
167+
actions.append((get_participant_from_event(db, form_event.get_handle()), detail,
167168
lambda dbstate, uistate, track, citation_handle = citation.handle, people_handles = people: ResidenceEvent.command(dbstate, uistate, track, citation_handle, form_event.get_date_object(), form_event.get_place_handle(), people_handles)))
168169
return (_("Add Residence event"), actions)
169170

0 commit comments

Comments
 (0)