Fixed name sorting in AddressBookListPage. Fixed has_residence in AddressBookPage. Fixed some elements in style sheet.
svn: r15577
This commit is contained in:
parent
24978e4ba6
commit
1f9033cb44
@ -337,7 +337,6 @@ table.infolist thead tr th a:hover {
|
|||||||
table.infolist tr td {
|
table.infolist tr td {
|
||||||
font: normal 1.1em/1.4em serif;
|
font: normal 1.1em/1.4em serif;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
border-bottom: dashed 1px #000;
|
|
||||||
background-color: #BCEAF6;
|
background-color: #BCEAF6;
|
||||||
padding: 6px 0 6px 10px;
|
padding: 6px 0 6px 10px;
|
||||||
}
|
}
|
||||||
@ -560,6 +559,9 @@ div#EventList, div#EventDetail {
|
|||||||
div#events table.eventlist {
|
div#events table.eventlist {
|
||||||
margin-top: .3cm;
|
margin-top: .3cm;
|
||||||
}
|
}
|
||||||
|
table.eventlist tbody tr td {
|
||||||
|
border-bottom: dashed 1px #000;
|
||||||
|
}
|
||||||
table.eventlist tbody tr td.ColumnEvent {
|
table.eventlist tbody tr td.ColumnEvent {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
@ -1178,7 +1180,7 @@ div#summaryarea table.infolist tbody tr td.ColumnAttribute {
|
|||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Subsections : Weblinks
|
/* Subsections : We Llinks
|
||||||
----------------------------------------------------- */
|
----------------------------------------------------- */
|
||||||
div#WebLinks {
|
div#WebLinks {
|
||||||
margin : 0 auto;
|
margin : 0 auto;
|
||||||
@ -1189,6 +1191,7 @@ table.WebLinks {
|
|||||||
}
|
}
|
||||||
table.WebLinks tbody tr td {
|
table.WebLinks tbody tr td {
|
||||||
color: #000;
|
color: #000;
|
||||||
|
border-bottom: dashed 1px #000;
|
||||||
}
|
}
|
||||||
table.weblinks tbody tr td.ColumnType {
|
table.weblinks tbody tr td.ColumnType {
|
||||||
width: 15%;
|
width: 15%;
|
||||||
|
@ -4916,12 +4916,12 @@ class RepositoryPage(BasePage):
|
|||||||
|
|
||||||
class AddressBookListPage(BasePage):
|
class AddressBookListPage(BasePage):
|
||||||
|
|
||||||
def __init__(self, report, title, has_url_address):
|
def __init__(self, report, title, has_url_addr_res):
|
||||||
"""
|
"""
|
||||||
Create a list of individual's that have either internet addresses or
|
Create a list of individual's that have either internet addresses or
|
||||||
address/ Residence events
|
address/ Residence events
|
||||||
|
|
||||||
@param: has_url_address -- a list of (sort_name, person_handle, has_add, has_rtes, and has_url
|
@param: has_url_addr_res -- a list of (sort_name, person_handle, has_add, has_rtes, and has_url
|
||||||
"""
|
"""
|
||||||
BasePage.__init__(self, report, title)
|
BasePage.__init__(self, report, title)
|
||||||
db = report.database
|
db = report.database
|
||||||
@ -4930,18 +4930,18 @@ class AddressBookListPage(BasePage):
|
|||||||
of = self.report.create_file("addressbook")
|
of = self.report.create_file("addressbook")
|
||||||
|
|
||||||
# Add xml, doctype, meta and stylesheets
|
# Add xml, doctype, meta and stylesheets
|
||||||
addressbooklistpage, head, body = self.write_header("%s - %s" % (title, _("Address Book")))
|
addressbooklistpage, head, body = self.write_header(_("Address Book"))
|
||||||
|
|
||||||
# begin AddressBookList division
|
# begin AddressBookList division
|
||||||
with Html("div", class_ = "content", id = "AddressBookList") as addressbooklist:
|
with Html("div", class_ = "content", id = "AddressBookList") as addressbooklist:
|
||||||
body += addressbooklist
|
body += addressbooklist
|
||||||
|
|
||||||
# Internet Address Book Page message
|
# Address Book Page message
|
||||||
msg = _("This page contains an index of all the individuals in the "
|
msg = _("This page contains an index of all the individuals in the "
|
||||||
"database, sorted by their surname, with one of the "
|
"database, sorted by their surname, with one of the "
|
||||||
"following: Address, Residence, or Web Links. Selecting the "
|
"following: Address, Residence, or Web Links. Selecting the "
|
||||||
"person’s name will take you to their Address "
|
"person’s name will take you to their individual Address "
|
||||||
"Book’s individual page.")
|
"Book page.")
|
||||||
addressbooklist += Html("p", msg, id = "description")
|
addressbooklist += Html("p", msg, id = "description")
|
||||||
|
|
||||||
# begin Address Book table
|
# begin Address Book table
|
||||||
@ -4968,7 +4968,7 @@ class AddressBookListPage(BasePage):
|
|||||||
table += tbody
|
table += tbody
|
||||||
|
|
||||||
index = 1
|
index = 1
|
||||||
for (sort_name, person_handle, has_add, has_res, has_url) in has_url_address:
|
for (sort_name, person_handle, has_add, has_res, has_url) in has_url_addr_res:
|
||||||
|
|
||||||
address = None
|
address = None
|
||||||
residence = None
|
residence = None
|
||||||
@ -5025,6 +5025,7 @@ class AddressBookPage(BasePage):
|
|||||||
@param: has_url -- list of url handles or None
|
@param: has_url -- list of url handles or None
|
||||||
"""
|
"""
|
||||||
db = report.database
|
db = report.database
|
||||||
|
self.bibli = Bibliography()
|
||||||
|
|
||||||
person = db.get_person_from_handle(person_handle)
|
person = db.get_person_from_handle(person_handle)
|
||||||
BasePage.__init__(self, report, title, person.gramps_id)
|
BasePage.__init__(self, report, title, person.gramps_id)
|
||||||
@ -5032,20 +5033,25 @@ class AddressBookPage(BasePage):
|
|||||||
|
|
||||||
# set the file name and open file
|
# set the file name and open file
|
||||||
of = self.report.create_file(person_handle, "addr")
|
of = self.report.create_file(person_handle, "addr")
|
||||||
addressbookpage, head, body = self.write_header("%s - %s" % (title, _("Address Book")))
|
addressbookpage, head, body = self.write_header(_("Address Book"))
|
||||||
|
|
||||||
# begin address book page division and section title
|
# begin address book page division and section title
|
||||||
with Html("div", class_ = "content", id = "AddressBookDetail") as addressbookdetail:
|
with Html("div", class_ = "content", id = "AddressBookDetail") as addressbookdetail:
|
||||||
body += addressbookdetail
|
body += addressbookdetail
|
||||||
addressbookdetail += Html("h3", self.get_name(person), inline = True)
|
|
||||||
|
url = self.report.build_url_fname_html(person.handle, "ppl", True)
|
||||||
|
addressbookdetail += Html("h3", self.person_link(url, person, True))
|
||||||
|
|
||||||
# individual has an address
|
# individual has an address
|
||||||
if has_add:
|
if has_add:
|
||||||
addressbookdetail += self.display_addr_list(has_add, None)
|
addressbookdetail += self.display_addr_list(has_add, True)
|
||||||
|
|
||||||
# individual has a residence
|
# individual has a residence
|
||||||
if has_res:
|
if has_res:
|
||||||
addressbookdetail += self.dump_residence(has_res)
|
addressbookdetail.extend(
|
||||||
|
self.dump_residence(res)
|
||||||
|
for res in has_res
|
||||||
|
)
|
||||||
|
|
||||||
# individual has a url
|
# individual has a url
|
||||||
if has_url:
|
if has_url:
|
||||||
@ -5598,7 +5604,7 @@ class NavWebReport(Report):
|
|||||||
Creates classes AddressBookListPage and AddressBookPage
|
Creates classes AddressBookListPage and AddressBookPage
|
||||||
"""
|
"""
|
||||||
|
|
||||||
has_url_address = []
|
has_url_addr_res = []
|
||||||
|
|
||||||
for person_handle in ind_list:
|
for person_handle in ind_list:
|
||||||
|
|
||||||
@ -5609,7 +5615,7 @@ class NavWebReport(Report):
|
|||||||
|
|
||||||
has_add = None
|
has_add = None
|
||||||
has_url = None
|
has_url = None
|
||||||
has_res = None
|
has_res = []
|
||||||
|
|
||||||
if addrlist:
|
if addrlist:
|
||||||
has_add = addrlist
|
has_add = addrlist
|
||||||
@ -5620,28 +5626,27 @@ class NavWebReport(Report):
|
|||||||
event = self.database.get_event_from_handle(event_ref.ref)
|
event = self.database.get_event_from_handle(event_ref.ref)
|
||||||
|
|
||||||
# get event type
|
# get event type
|
||||||
evt_type = str(event.get_type() )
|
if event.get_type() == gen.lib.EventType.RESIDENCE:
|
||||||
if evt_type == "Residence":
|
has_res.append(event)
|
||||||
has_res = event
|
|
||||||
break
|
|
||||||
|
|
||||||
if has_add or has_res or has_url:
|
if has_add or has_res or has_url:
|
||||||
primary_name = person.get_primary_name()
|
primary_name = person.get_primary_name()
|
||||||
sort_name = ''.join([primary_name.get_surname(), ", ", primary_name.get_first_name()])
|
sort_name = ''.join([primary_name.get_surname(), ", ",
|
||||||
|
primary_name.get_first_name()])
|
||||||
|
|
||||||
data = (sort_name, person_handle, has_add, has_res, has_url)
|
has_url_addr_res.append( (sort_name, person_handle, has_add, has_res, has_url) )
|
||||||
has_url_address.append(data)
|
|
||||||
|
|
||||||
AddressBookListPage(self, self.title, has_url_address)
|
# determine if there are a list and pages to be created
|
||||||
# Determine if we build Address Book
|
if has_url_addr_res:
|
||||||
if has_url_address:
|
has_url_addr_res.sort()
|
||||||
has_url_address.sort()
|
|
||||||
|
|
||||||
addr_size = len(has_url_address)
|
AddressBookListPage(self, self.title, has_url_addr_res)
|
||||||
|
|
||||||
|
addr_size = len(has_url_addr_res)
|
||||||
# begin Address Book pages
|
# begin Address Book pages
|
||||||
self.progress.set_pass(_("Creating address book pages ..."), addr_size)
|
self.progress.set_pass(_("Creating address book pages ..."), addr_size)
|
||||||
|
|
||||||
for (sort_name, person_handle, has_add, has_res, has_url) in has_url_address:
|
for (sort_name, person_handle, has_add, has_res, has_url) in has_url_addr_res:
|
||||||
|
|
||||||
AddressBookPage(self, self.title, person_handle, has_add, has_res, has_url)
|
AddressBookPage(self, self.title, person_handle, has_add, has_res, has_url)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user