Skip to content

Commit

Permalink
Allow user format option
Browse files Browse the repository at this point in the history
Allows all place names to reflect the format created by the user. The fmt=0 was forcing all place names to utilize the default "Full" option.
  • Loading branch information
DaveSch-gramps committed Oct 8, 2023
1 parent 238d3b3 commit 45035a0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions gramps/plugins/webreport/basepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ def append_to_place_lat_long(self, place, event, place_lat_long):
data[3] == place_handle and data[4] == event_date for data in place_lat_long
)
if not found:
placetitle = _pd.display(self.r_db, place, fmt=0)
placetitle = _pd.display(self.r_db, place)
latitude = place.get_latitude()
longitude = place.get_longitude()
if latitude and longitude:
Expand Down Expand Up @@ -1085,7 +1085,7 @@ def get_event_data(self, evt, evt_ref, uplink, gid=None):

place_hyper = None
if place:
place_name = _pd.display(self.r_db, place, evt.get_date_object(), fmt=0)
place_name = _pd.display(self.r_db, place, evt.get_date_object())
place_hyper = self.place_link(place_handle, place_name, uplink=uplink)

evt_desc = evt.get_description()
Expand Down Expand Up @@ -1157,7 +1157,7 @@ def dump_ordinance(self, ldsobj, ldssealedtype, toggle=True):
if place_handle:
place = self.r_db.get_place_from_handle(place_handle)
if place:
place_title = _pd.display(self.r_db, place, fmt=0)
place_title = _pd.display(self.r_db, place)
place_hyper = self.place_link(
place_handle,
place_title,
Expand Down Expand Up @@ -2307,7 +2307,7 @@ def media_ref_rect_regions(self, handle, linkurl=True):
_linkurl = self.report.build_url_fname_html(_obj.handle, "evt", True)
elif classname == "Place":
_obj = self.r_db.get_place_from_handle(newhandle)
_name = _pd.display(self.r_db, _obj, fmt=0)
_name = _pd.display(self.r_db, _obj)
if not _name:
_name = self._("Unknown")
_linkurl = self.report.build_url_fname_html(newhandle, "plc", True)
Expand Down
4 changes: 2 additions & 2 deletions gramps/plugins/webreport/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ def sort_places(dbase, handle_list, rlocale=glocale):
else:
continue
place = dbase.get_place_from_handle(hdle)
pname = _pd.display(dbase, place, fmt=0)
apname = _pd.display_event(dbase, event, fmt=0)
pname = _pd.display(dbase, place)
apname = _pd.display_event(dbase, event)

pname_sub[pname].append(hdle)
pname_sub[apname].append((hdle, pname, cname, sname))
Expand Down
2 changes: 1 addition & 1 deletion gramps/plugins/webreport/narrativeweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def _add_place(self, place_handle, bkref_class, bkref_handle, event):
else:
name = ""
if config.get("preferences.place-auto"):
place_name = _pd.display_event(self._db, event, fmt=0)
place_name = _pd.display_event(self._db, event)
if event:
cplace_name = place_name.split()[-1]
if len(place_name.split()) > 1:
Expand Down
4 changes: 2 additions & 2 deletions gramps/plugins/webreport/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -1841,14 +1841,14 @@ def display_ind_general(self):
birth = self.r_db.get_event_from_handle(birth_ref.ref)
if birth:
birth_date = birth.get_date_object()
p_birth = _pd.display_event(self.r_db, birth, fmt=0)
p_birth = _pd.display_event(self.r_db, birth)

death_ref = self.person.get_death_ref()
p_death = ""
if death_ref:
death = self.r_db.get_event_from_handle(death_ref.ref)
if death:
p_death = _pd.display_event(self.r_db, death, fmt=0)
p_death = _pd.display_event(self.r_db, death)

death_date = _find_death_date(self.r_db, self.person)
if birth_date and birth_date is not Date.EMPTY:
Expand Down
4 changes: 2 additions & 2 deletions gramps/plugins/webreport/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def display_pages(self, the_lang, the_title):
p_fname += self.ext
plc_dict = (p_fname, place_name, place.gramps_id, None)
self.report.obj_dict[Place][place_ref] = plc_dict
p_name = _pd.display(self.r_db, place, fmt=0)
p_name = _pd.display(self.r_db, place)
cplace_name = p_name.split()[-1]
if len(place_name.split()) > 1:
splace_name = place_name.split()[-2]
Expand Down Expand Up @@ -430,7 +430,7 @@ def placepage(self, report, the_lang, the_title, place_handle, place_name):
BasePage.__init__(self, report, the_lang, the_title, place.get_gramps_id())
self.bibli = Bibliography()
ldatec = place.get_change_time()
apname = _pd.display(self.r_db, place, fmt=0)
apname = _pd.display(self.r_db, place)

# if place_name: # != apname: # store only the primary named page
output_file, sio = self.report.create_file(place_handle, "plc")
Expand Down

0 comments on commit 45035a0

Please sign in to comment.