3944: [NarWeb] Alternate Locations on places site in web report vers. 3.2.2

svn: r15876
This commit is contained in:
Benny Malengier 2010-09-11 15:17:25 +00:00
parent 55afdd8296
commit de436d58ca

View File

@ -125,7 +125,6 @@ DESCRHEAD = _("Description")
_EVENT = _("Event") _EVENT = _("Event")
GRAMPSID = _("Gramps ID") GRAMPSID = _("Gramps ID")
LATITUDE = _("Latitude") LATITUDE = _("Latitude")
LOCATIONS = _("Alternate Locations")
LONGITUDE = _("Longitude") LONGITUDE = _("Longitude")
NHEAD = _("Notes") NHEAD = _("Notes")
PARENTS = _("Parents") PARENTS = _("Parents")
@ -142,7 +141,7 @@ STREET = _("Street")
THEAD = _("Type") THEAD = _("Type")
TEMPLE = _("Temple") TEMPLE = _("Temple")
VHEAD = _("Value") VHEAD = _("Value")
ALTERNATE_LOCATIONS = _("Alternate Locations") ALT_LOCATIONS = _("Alternate Locations")
# initialize global variable # initialize global variable
place_lat_long = [] place_lat_long = []
@ -1946,7 +1945,7 @@ class BasePage(object):
(COUNTRY, ml.country), (COUNTRY, ml.country),
(LATITUDE, place.lat), (LATITUDE, place.lat),
(LONGITUDE, place.long), (LONGITUDE, place.long),
(ALTERNATE_LOCATIONS, place.get_alternate_locations() ) ]: (ALT_LOCATIONS, place.get_alternate_locations() ) ]:
if data: if data:
trow = Html("tr") + ( trow = Html("tr") + (
Html("td", label, class_ = "ColumnAttribute", inline = True), Html("td", label, class_ = "ColumnAttribute", inline = True),
@ -1954,6 +1953,30 @@ class BasePage(object):
) )
tbody += trow tbody += trow
altloc = place.get_alternate_locations()
if altloc:
table += Html("tr") + Html("td", " ", colspan = 2)
trow = Html("tr") + (
Html("th", ALT_LOCATIONS, colspan = 2, class_ = "ColumnAttribute", inline = True),
)
table += trow
for loc in (nonempt for nonempt in altloc if not nonempt.is_empty()):
for (label, data) in [
(STREET, loc.street),
(CITY, loc.city),
(PARISH, loc.parish),
(COUNTY, loc.county),
(STATE, loc.state),
(POSTAL, loc.postal),
(COUNTRY, loc.country),]:
if data:
trow = Html("tr") + (
Html("td", label, class_ = "ColumnAttribute", inline = True),
Html("td", data, class_ = "ColumnValue", inline = True)
)
table += trow
table += Html("tr") + Html("td", " ", colspan = 2)
# return place table to its callers # return place table to its callers
return table return table
@ -3435,12 +3458,12 @@ class SourceListPage(BasePage):
class SourcePage(BasePage): class SourcePage(BasePage):
def __init__(self, report, title, handle, src_list, gid = None): def __init__(self, report, title, handle, src_list):
db = report.database db = report.database
source = db.get_source_from_handle(handle) source = db.get_source_from_handle(handle)
if source is not None: if source is not None:
BasePage.__init__(self, report, title, gid) BasePage.__init__(self, report, title, source.gramps_id)
of = self.report.create_file(source.get_handle(), "src") of = self.report.create_file(source.get_handle(), "src")
self.up = True self.up = True
@ -3466,8 +3489,8 @@ class SourcePage(BasePage):
table += tbody table += tbody
grampsid = None grampsid = None
if not self.noid and gid: if not self.noid and self.gid:
grampsid = gid grampsid = self.gid
for (label, val) in [ for (label, val) in [
(GRAMPSID, grampsid), (GRAMPSID, grampsid),