Cleanup of class PlaceListPage()
svn: r18124
This commit is contained in:
parent
1f290c934d
commit
87460f0788
@ -3027,14 +3027,14 @@ class PlaceListPage(BasePage):
|
||||
thead += trow
|
||||
|
||||
trow.extend(
|
||||
Html("th", label, class_ = "Column" + colclass, inline = True)
|
||||
Html("th", label, class_ =colclass, inline =True)
|
||||
for (label, colclass) in [
|
||||
[" ", "Letter"],
|
||||
[_("Place Name | Name"), "Name"],
|
||||
[_("State"), "State"],
|
||||
[_("Country"), "Country"],
|
||||
[_("Latitude"), "Latitude"],
|
||||
[_("Longitude"), "Longitude"] ]
|
||||
[_("Letter"), "ColumnLetter"],
|
||||
[_("Place Name | Name"), "ColumnName"],
|
||||
[_("State"), "ColumnState"],
|
||||
[_("Country"), "ColumnCountry"],
|
||||
[_("Latitude"), "ColumnLatitude"],
|
||||
[_("Longitude"), "ColumnLongitude"] ]
|
||||
)
|
||||
|
||||
sort = Sort.Sort(db)
|
||||
@ -3047,10 +3047,14 @@ class PlaceListPage(BasePage):
|
||||
|
||||
for handle in handle_list:
|
||||
place = db.get_place_from_handle(handle)
|
||||
if place:
|
||||
place_title = place.get_title()
|
||||
ml = place.get_main_location()
|
||||
|
||||
if place_title:
|
||||
letter = first_letter(place_title)
|
||||
else:
|
||||
letter = ' '
|
||||
|
||||
trow = Html("tr")
|
||||
tbody += trow
|
||||
@ -3066,23 +3070,29 @@ class PlaceListPage(BasePage):
|
||||
else:
|
||||
tcell += " "
|
||||
|
||||
trow += Html("td", self.place_link(place.handle, place_title, place.gramps_id),
|
||||
trow += Html("td", self.place_link(place.get_handle(), place_title, place.get_gramps_id() ),
|
||||
class_ = "ColumnName")
|
||||
|
||||
trow.extend(
|
||||
Html("td", data or " ", class_ = "Column" + colclass, inline = True)
|
||||
Html("td", data or " ", class_ =colclass, inline =True)
|
||||
for (colclass, data) in [
|
||||
["State", ml.state],
|
||||
["Country", ml.country] ]
|
||||
["ColumnState", ml.state],
|
||||
["ColumnCountry", ml.country] ]
|
||||
)
|
||||
|
||||
latitude, longitude = False, False
|
||||
if (place and (place.lat and place.long)):
|
||||
tcell1 = Html("td", class_ ="ColumnLatitude", inline =True)
|
||||
tcell2 = Html("td", class_ ="ColumnLongitude", inline =True)
|
||||
trow += (tcell1, tcell2)
|
||||
|
||||
if (place.lat and place.long):
|
||||
latitude, longitude = conv_lat_lon(place.lat,
|
||||
place.long,
|
||||
"DEG")
|
||||
trow += Html("td", latitude or " ", class_ = "ColumnLatitude", inline = True)
|
||||
trow += Html("td", longitude or " ", class_ = "ColumnLongitude", inline = True)
|
||||
tcell1 += latitude
|
||||
tcell2 += longitude
|
||||
else:
|
||||
tcell1 += ' '
|
||||
tcell2 += ' '
|
||||
|
||||
# add clearline for proper styling
|
||||
# add footer section
|
||||
|
Loading…
Reference in New Issue
Block a user