From 34148aea8abf1606fec179a9e5253c89ee8a8d74 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Wed, 10 Mar 2010 22:40:14 +0000 Subject: [PATCH] NarrativeWeb: Fixed Address Book not creating page if there was no address. Stylesheets: Cleanup to correctly show AddressBookList. svn: r14744 --- src/data/Web_Basic-Ash.css | 27 --------------------- src/data/Web_Basic-Cypress.css | 27 --------------------- src/data/Web_Basic-Lilac.css | 27 --------------------- src/data/Web_Basic-Peach.css | 27 --------------------- src/data/Web_Basic-Spruce.css | 27 --------------------- src/data/Web_Nebraska.css | 24 +++++++++++------- src/plugins/webreport/NarrativeWeb.py | 35 ++++++++++++--------------- 7 files changed, 31 insertions(+), 163 deletions(-) diff --git a/src/data/Web_Basic-Ash.css b/src/data/Web_Basic-Ash.css index 5af7c9ccc..b78a7ed3f 100644 --- a/src/data/Web_Basic-Ash.css +++ b/src/data/Web_Basic-Ash.css @@ -799,33 +799,6 @@ div#RepositoryList table.repolist tbody tr td.ColumnName { background-color: #FFF; } -/* Internet Address Book ------------------------------------------------------- */ -div#InternetAddressBook { - margin: 0; - padding: 0; -} -div#InternetAddressBook table.addressbook { - margin: .3em 0 .3em 0; -} -div#InternetAddressBook table.addressbook tbody tr.BeginName { - border-top: solid 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td { - background-color: #FFF; - border-bottom: dashed 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnType { - background-color: #CCC; - width: 15%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnName { - width: 30%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnLink { - width: 70%; -} - /* Address Book ------------------------------------------------------ */ div#AddressBookList, AddressBookDetail { diff --git a/src/data/Web_Basic-Cypress.css b/src/data/Web_Basic-Cypress.css index 3a82bb2d8..4a59d2265 100644 --- a/src/data/Web_Basic-Cypress.css +++ b/src/data/Web_Basic-Cypress.css @@ -826,33 +826,6 @@ div#RepositoryList table.repolist tbody tr td.ColumnName { background-color: #FFF; } -/* Internet Address Book ------------------------------------------------------- */ -div#InternetAddressBook { - margin: 0; - padding: 0; -} -div#InternetAddressBook table.addressbook { - margin: .3em 0 .3em 0; -} -div#InternetAddressBook table.addressbook tbody tr.BeginName { - border-top: solid 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td { - background-color: #FFF; - border-bottom: dashed 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnType { - background-color: #E0E6E0; - width: 15%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnName { - width: 30%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnLink { - width: 70%; -} - /* Address Book ------------------------------------------------------ */ div#AddressBookList, AddressBookDetail { diff --git a/src/data/Web_Basic-Lilac.css b/src/data/Web_Basic-Lilac.css index 92e642d7a..daf01fec4 100644 --- a/src/data/Web_Basic-Lilac.css +++ b/src/data/Web_Basic-Lilac.css @@ -776,33 +776,6 @@ div#RepositoryList table.repolist tbody tr td.ColumnName { background-color: #FFF; } -/* Internet Address Book ------------------------------------------------------- */ -div#InternetAddressBook { - margin: 0; - padding: 0; -} -div#InternetAddressBook table.addressbook { - margin: .3em 0 .3em 0; -} -div#InternetAddressBook table.addressbook tbody tr.BeginName { - border-top: solid 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td { - background-color: #FFF; - border-bottom: dashed 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnType { - background-color: #E0E0E9; - width: 15%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnName { - width: 30%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnLink { - width: 70%; -} - /* Address Book ------------------------------------------------------ */ div#AddressBookList, AddressBookDetail { diff --git a/src/data/Web_Basic-Peach.css b/src/data/Web_Basic-Peach.css index 84eb713e0..d8d8a1eb6 100644 --- a/src/data/Web_Basic-Peach.css +++ b/src/data/Web_Basic-Peach.css @@ -779,33 +779,6 @@ div#RepositoryList table.repolist tbody tr td.ColumnName { background-color: #FFF; } -/* Internet Address Book ------------------------------------------------------- */ -div#InternetAddressBook { - margin: 0; - padding: 0; -} -div#InternetAddressBook table.addressbook { - margin: .3em 0 .3em 0; -} -div#InternetAddressBook table.addressbook tbody tr.BeginName { - border-top: solid 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td { - background-color: #FFF; - border-bottom: dashed 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnType { - background-color: #FFFBE7; - width: 15%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnName { - width: 30%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnLink { - width: 70%; -} - /* Address Book ------------------------------------------------------ */ div#AddressBookList, AddressBookDetail { diff --git a/src/data/Web_Basic-Spruce.css b/src/data/Web_Basic-Spruce.css index f0c1969a9..770668484 100644 --- a/src/data/Web_Basic-Spruce.css +++ b/src/data/Web_Basic-Spruce.css @@ -777,33 +777,6 @@ div#RepositoryList table.repolist tbody tr td.ColumnName { background-color: #FFF; } -/* Internet Address Book ------------------------------------------------------- */ -div#InternetAddressBook { - margin: 0; - padding: 0; -} -div#InternetAddressBook table.addressbook { - margin: .3em 0 .3em 0; -} -div#InternetAddressBook table.addressbook tbody tr.BeginName { - border-top: solid 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td { - background-color: #FFF; - border-bottom: dashed 1px #000; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnType { - background-color: #EAEEF4; - width: 15%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnName { - width: 30%; -} -div#InternetAddressBook table.addressbook tbody tr td.ColumnLink { - width: 70%; -} - /* Address Book ------------------------------------------------------ */ div#AddressBookList, AddressBookDetail { diff --git a/src/data/Web_Nebraska.css b/src/data/Web_Nebraska.css index 3ee219918..4c47e55a4 100644 --- a/src/data/Web_Nebraska.css +++ b/src/data/Web_Nebraska.css @@ -819,31 +819,37 @@ div#RepositoryList table.repolist tbody tr td.ColumnName { background-color: #FFF; } -/* Internet Address Book +/* Address Book ------------------------------------------------------ */ -div#InternetAddressBook { +div#AddressBookList { margin: 0; padding: 0; } -div#InternetAddressBook table.addressbook { +div#AddressBookList table.addressbook { margin: .3em 0 .3em 0; } -div#InternetAddressBook table.addressbook tbody tr.BeginName { +div#AddressBookList table.addressbook tbody tr.BeginName { border-top: solid 1px #000; } -div#InternetAddressBook table.addressbook tbody tr td { +div#AddressBookList table.addressbook tbody tr td { background-color: #FFF; border-bottom: dashed 1px #000; } -div#InternetAddressBook table.addressbook tbody tr td.ColumnType { +div#AddressBookList table.addressbook tbody tr td.ColumnRowLabel { background-color: #F6F2EE; width: 15%; } -div#InternetAddressBook table.addressbook tbody tr td.ColumnName { +div#AddressBookList table.addressbook tbody tr td.ColumnName { width: 30%; } -div#InternetAddressBook table.addressbook tbody tr td.ColumnLink { - width: 70%; +div#AddressBookList table.addressbook tbody tr td.ColumnAddress { + width: 8%; +} +div#AddressBookList table.addressbook tbody tr td.ColumnResidence { + width: 8%; +} +div#AddressBookList table.addressbook tbody tr td.ColumnWebLinks { + width: 8%; } /* Subsections diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 5532643bc..0768c4cc5 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -7,7 +7,7 @@ # Copyright (C) 2007-2009 Stephane Charette # Copyright (C) 2008-2009 Brian G. Matherly # Copyright (C) 2008 Jason M. Simanek -# Copyright (C) 2008-2009 Rob G. Healey +# Copyright (C) 2008-2010 Rob G. Healey # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -4734,7 +4734,8 @@ class AddressBookListPage(BasePage): of = self.report.create_file("addressbook") # Add xml, doctype, meta and stylesheets - addressbooklistpage, body = self.write_header("%s - %s" % (title, _("Address Book")), _KEYPERSON) + addressbooklistpage, body = self.write_header("%s - %s" % (title, + _("Address Book")), _KEYPERSON) # begin AddressBookList division with Html("div", class_ = "content", id = "AddressBookList") as addressbooklist: @@ -4771,7 +4772,7 @@ class AddressBookListPage(BasePage): table += tbody # local counters for total line - index, countadd, countres, counturl = 0, 0, 0, 0 + index, countadd, countres, counturl, countfb = 0, 0, 0, 0, 0 for (sort_name, person_handle, has_add, has_res, has_url) in has_url_address: person = db.get_person_from_handle(person_handle) @@ -4780,6 +4781,7 @@ class AddressBookListPage(BasePage): address = None residence = None weblinks = None + facebook = None # has address but no residence event if has_add and not has_res: @@ -4860,26 +4862,20 @@ class AddressBookPage(BasePage): # begin address book page division and section title with Html("div", class_ = "content", id = "AddressBookDetail") as addressbookdetail: body += addressbookdetail - addressbookdetail += Html("h3", self.get_name(person), inline = True) + # individual has an address + if has_add: + addressbookdetail += self.display_addr_list(has_add, None) + + # individual has a residence + if has_res: + addressbookdetail += self.dump_residence(has_res) + # individual has a url if has_url: addressbookdetail += self.display_url_list(has_url) - # individual has an address, and not a residence event - if has_add and not has_res: - addressbookdetail += self.display_addr_list(has_add, None) - - # individual has a residence event and no addresses - elif has_res and not has_add: - addressbookdetail += self.dump_residence(has_res) - - # individual has both - elif has_add and has_res: - addressbookdetail += self.display_addr_list(has_add, None) - addressbookdetail += self.dump_residence(has_res) - # add fullclear for proper styling # and footer section to page footer = self.write_footer() @@ -5402,12 +5398,12 @@ class NavWebReport(Report): has_add = None has_url = None + has_res = None if addrlist: has_add = addrlist if urllist: has_url = urllist - has_res = None for event_ref in evt_ref_list: event = db.get_event_from_handle(event_ref.ref) @@ -5427,10 +5423,11 @@ class NavWebReport(Report): # Determine if we build Address Book if has_url_address: has_url_address.sort() - AddressBookListPage(self, self.title, has_url_address) self.progress.set_pass(_("Creating address book pages ..."), len(has_url_address)) + AddressBookListPage(self, self.title, has_url_address) + for (sort_name, person_handle, has_add, has_res, has_url) in has_url_address: self.progress.step()