Added Internet Address Book to NarrativeWeb. Added styles for it and OneDay elements for WebCal. Updated printer stylesheet to current work.

svn: r13503
This commit is contained in:
Rob G. Healey
2009-11-05 18:18:49 +00:00
parent f697451301
commit 1605254b2d
9 changed files with 1108 additions and 285 deletions

View File

@ -777,6 +777,33 @@ div#RepositoryList table.repolist tbody tr td.ColumnName {
background-color: #FFF; 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%;
}
/* Subsections /* Subsections
----------------------------------------------------- */ ----------------------------------------------------- */
#Home, #Introduction, #Contact { #Home, #Introduction, #Contact {
@ -1317,3 +1344,27 @@ body#fullyearlinked table.calendar thead tr th.monthName {
body#fullyearlinked table.calendar tbody tr td { body#fullyearlinked table.calendar tbody tr td {
height:3em; height:3em;
} }
/* Calendar: OneDay
--------------------------------------------------------------------------------- */
body#OneDay h3 {
color: #000;
font-weight: bold;
text-align: center;
}
table.oneday {
margin: .3em 0 .3em 0;
padding: 0;
}
table.oneday tbody tr td {
border-bottom: dashed 1px #000;
}
table.oneday tbody tr td.ColumnRowLabel {
width: 5%;
}
table.oneday tbody tr td.ColumnText {
width: 85%;
}
table.oneday tbody tr td.ColumnEvent {
width; 10%;
}

View File

@ -784,8 +784,10 @@ table.download td.Modified {
/* Repositories /* Repositories
------------------------------------------------------ */ ------------------------------------------------------ */
div#RepositoryList { } div#RepositoryList {
margin: 0;
padding: 0;
}
div#RepositoryList table.repolist tbody tr td { div#RepositoryList table.repolist tbody tr td {
} }
div#RepositoryList table.repolist tbody tr td a { div#RepositoryList table.repolist tbody tr td a {
@ -802,6 +804,33 @@ div#RepositoryList table.repolist tbody tr td.ColumnName {
background-color: #FFF; 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%;
}
/* Subsections /* Subsections
----------------------------------------------------- */ ----------------------------------------------------- */
#Home, #Introduction, { #Home, #Introduction, {
@ -1324,3 +1353,27 @@ body#WebCal #CreatorInfo a, body#WebCal #CreatorInfo a:hover {
color:#9DBF9D; color:#9DBF9D;
background-color:#E0E6E0; background-color:#E0E6E0;
} }
/* Calendar: OneDay
--------------------------------------------------------------------------------- */
body#OneDay h3 {
color: #000;
font-weight: bold;
text-align: center;
}
table.oneday {
margin: .3em 0 .3em 0;
padding: 0;
}
table.oneday tbody tr td {
border-bottom: dashed 1px #000;
}
table.oneday tbody tr td.ColumnRowLabel {
width: 5%;
}
table.oneday tbody tr td.ColumnText {
width: 85%;
}
table.oneday tbody tr td.ColumnEvent {
width; 10%;
}

View File

@ -733,8 +733,10 @@ table.download td.Modified {
/* Repositories /* Repositories
------------------------------------------------------ */ ------------------------------------------------------ */
div#RepositoryList { } div#RepositoryList {
margin: 0;
padding: 0;
}
div#RepositoryList table.repolist tbody tr td { div#RepositoryList table.repolist tbody tr td {
background-color: #D8F3D6; background-color: #D8F3D6;
} }
@ -752,6 +754,33 @@ div#RepositoryList table.repolist tbody tr td.ColumnName {
background-color: #FFF; 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%;
}
/* Subsections /* Subsections
----------------------------------------------------- */ ----------------------------------------------------- */
#Home, #Introduction, #Contact { #Home, #Introduction, #Contact {
@ -1344,3 +1373,27 @@ body#fullyearlinked table.calendar thead tr th.monthName {
body#fullyearlinked table.calendar tbody tr td { body#fullyearlinked table.calendar tbody tr td {
height:3em; height:3em;
} }
/* Calendar: OneDay
--------------------------------------------------------------------------------- */
body#OneDay h3 {
color: #000;
font-weight: bold;
text-align: center;
}
table.oneday {
margin: .3em 0 .3em 0;
padding: 0;
}
table.oneday tbody tr td {
border-bottom: dashed 1px #000;
}
table.oneday tbody tr td.ColumnRowLabel {
width: 5%;
}
table.oneday tbody tr td.ColumnText {
width: 85%;
}
table.oneday tbody tr td.ColumnEvent {
width; 10%;
}

View File

@ -733,8 +733,10 @@ table.download td.Modified {
/* Repositories /* Repositories
------------------------------------------------------ */ ------------------------------------------------------ */
div#RepositoryList { } div#RepositoryList {
margin: 0;
padding: 0;
}
div#RepositoryList table.repolist tbody tr td { div#RepositoryList table.repolist tbody tr td {
background-color: #FFE09F; background-color: #FFE09F;
} }
@ -752,6 +754,33 @@ div#RepositoryList table.repolist tbody tr td.ColumnName {
background-color: #FFF; 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%;
}
/* Subsections /* Subsections
----------------------------------------------------- */ ----------------------------------------------------- */
#Home, #Introduction, #Contact { #Home, #Introduction, #Contact {
@ -1344,3 +1373,27 @@ body#fullyearlinked table.calendar thead tr th.monthName {
body#fullyearlinked table.calendar tbody tr td { body#fullyearlinked table.calendar tbody tr td {
height:3em; height:3em;
} }
/* Calendar: OneDay
--------------------------------------------------------------------------------- */
body#OneDay h3 {
color: #000;
font-weight: bold;
text-align: center;
}
table.oneday {
margin: .3em 0 .3em 0;
padding: 0;
}
table.oneday tbody tr td {
border-bottom: dashed 1px #000;
}
table.oneday tbody tr td.ColumnRowLabel {
width: 5%;
}
table.oneday tbody tr td.ColumnText {
width: 85%;
}
table.oneday tbody tr td.ColumnEvent {
width; 10%;
}

View File

@ -733,8 +733,10 @@ table.download td.Modified {
/* Repositories /* Repositories
------------------------------------------------------ */ ------------------------------------------------------ */
div#RepositoryList { } div#RepositoryList {
margin: 0;
padding: 0;
}
div#RepositoryList table.repolist tbody tr td { div#RepositoryList table.repolist tbody tr td {
background-color: #EAFFE4; background-color: #EAFFE4;
} }
@ -752,6 +754,33 @@ div#RepositoryList table.repolist tbody tr td.ColumnName {
background-color: #FFF; 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%;
}
/* Subsections /* Subsections
----------------------------------------------------- */ ----------------------------------------------------- */
#Home, #Introduction, #Contact { #Home, #Introduction, #Contact {
@ -1344,3 +1373,27 @@ body#fullyearlinked table.calendar thead tr th.monthName {
body#fullyearlinked table.calendar tbody tr td { body#fullyearlinked table.calendar tbody tr td {
height:3em; height:3em;
} }
/* Calendar: OneDay
--------------------------------------------------------------------------------- */
body#OneDay h3 {
color: #000;
font-weight: bold;
text-align: center;
}
table.oneday {
margin: .3em 0 .3em 0;
padding: 0;
}
table.oneday tbody tr td {
border-bottom: dashed 1px #000;
}
table.oneday tbody tr td.ColumnRowLabel {
width: 5%;
}
table.oneday tbody tr td.ColumnText {
width: 85%;
}
table.oneday tbody tr td.ColumnEvent {
width; 10%;
}

View File

@ -772,6 +772,56 @@ table.download td.Modified {
font-weight:bold; font-weight:bold;
} }
/* Repositories
------------------------------------------------------ */
div#RepositoryList {
margin: 0;
padding: 0;
}
div#RepositoryList table.repolist tbody tr td {
background-color: #C1B398;
}
div#RepositoryList table.repolist tbody tr td a {
display: block;
padding: .3em 10px;
}
div#RepositoryList table.repolist tbody tr td.ColumnRowLabel {
width: 9%;
}
div#RepositoryList table.repolist tbody tr td.ColumnType {
width: 15%;
}
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: #F6F2EE;
width: 15%;
}
div#InternetAddressBook table.addressbook tbody tr td.ColumnName {
width: 30%;
}
div#InternetAddressBook table.addressbook tbody tr td.ColumnLink {
width: 70%;
}
/* Subsections /* Subsections
----------------------------------------------------- */ ----------------------------------------------------- */
#Home, #Introduction, #Contact { #Home, #Introduction, #Contact {
@ -1367,3 +1417,27 @@ body#fullyearlinked table.calendar thead tr th.monthName {
body#fullyearlinked table.calendar tbody tr td { body#fullyearlinked table.calendar tbody tr td {
height:3em; height:3em;
} }
/* Calendar: OneDay
--------------------------------------------------------------------------------- */
body#OneDay h3 {
color: #000;
font-weight: bold;
text-align: center;
}
table.oneday {
margin: .3em 0 .3em 0;
padding: 0;
}
table.oneday tbody tr td {
border-bottom: dashed 1px #000;
}
table.oneday tbody tr td.ColumnRowLabel {
width: 5%;
}
table.oneday tbody tr td.ColumnText {
width: 85%;
}
table.oneday tbody tr td.ColumnEvent {
width; 10%;
}

File diff suppressed because it is too large Load Diff

View File

@ -280,10 +280,10 @@ div#navigation, div#subnavigation {
} }
div#navigation ul, div#subnavigation ul { div#navigation ul, div#subnavigation ul {
list-style:none; list-style:none;
min-width:770px; min-width: 900px;
height: 50px; height: 40px;
margin:0; margin:0;
padding: 0px 0px 0px 20px; padding: 0px 0px 0px 6px;
border-bottom: solid 2px #5D835F; border-bottom: solid 2px #5D835F;
} }
div#navigation ul li, div#subnavigation ul li { div#navigation ul li, div#subnavigation ul li {
@ -291,9 +291,9 @@ div#navigation ul li, div#subnavigation ul li {
} }
div#navigation ul li a, div#subnavigation ul li a { div#navigation ul li a, div#subnavigation ul li a {
display: block; display: block;
padding: 12px 10px 14px 1px; padding: 12px 6px 14px 1px;
float:left; float:left;
font: 1em/1.5em bold italic small-caps verdana, serif; font: .8em bold italic small-caps verdana, serif;
color: #000; color: #000;
text-decoration:none; text-decoration:none;
margin:0; margin:0;
@ -878,10 +878,13 @@ div#SourceDetail div#references ol li {
padding-bottom:.5em; padding-bottom:.5em;
} }
/* Repositories /* Repositories
------------------------------------------------------ */ ------------------------------------------------------ */
div#RepositoryList { } div#RepositoryList {
margin: 0;
padding: 0;
}
div#RepositoryList table.repolist tbody tr td { div#RepositoryList table.repolist tbody tr td {
background-color: #D8F3D6; background-color: #D8F3D6;
} }
@ -899,6 +902,33 @@ div#RepositoryList table.repolist tbody tr td.ColumnName {
background-color: #FFF; 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: #D8F3D6;
width: 15%;
}
div#InternetAddressBook table.addressbook tbody tr td.ColumnName {
width: 30%;
}
div#InternetAddressBook table.addressbook tbody tr td.ColumnLink {
width: 70%;
}
/* Subsections /* Subsections
----------------------------------------------------- */ ----------------------------------------------------- */
#Home, #Introduction, #Contact { #Home, #Introduction, #Contact {
@ -1561,7 +1591,7 @@ body#fullyearlinked able.calendar tbody tr td.sunday {
border:solid 2px #000; border:solid 2px #000;
} }
/* Calendar: OneDay /* Calendar: OneDay
--------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------- */
body#OneDay h3 { body#OneDay h3 {
color: #228A22; color: #228A22;

View File

@ -529,14 +529,14 @@ class BasePage(object):
def event_link(self, eventtype, handle, gid = None, up = False): def event_link(self, eventtype, handle, gid = None, up = False):
""" createsa hyperlink for an event based on its type """ """ createsa hyperlink for an event based on its type """
url = self.report.build_url_fname_html(handle, 'evt', up) url = self.report.build_url_fname_html(handle, "evt", up)
# if event pages are being created, then hyperlink the event type # if event pages are being created, then hyperlink the event type
if self.inc_events: if self.inc_events:
evt_hyper = Html("a", eventtype, href = url, title = eventtype) evt_hyper = Html("a", eventtype, href = url, title = eventtype)
if not self.noid and gid: if not self.noid and gid:
evt_hyper += Html("span", " [%s] " % gid, class_ = "grampsid", evt_hyper += Html("span", " [%s]" % gid, class_ = "grampsid",
inline = True) inline = True)
# return event hyper link to its callers # return event hyper link to its callers
@ -682,7 +682,7 @@ class BasePage(object):
def source_link(self, handle, hyper_name, name, gid = None, up = False): def source_link(self, handle, hyper_name, name, gid = None, up = False):
url = self.report.build_url_fname_html(handle, 'src', up) url = self.report.build_url_fname_html(handle, "src", up)
# begin hyperlink # begin hyperlink
hyper = Html("a", html_escape(name), href = url, title = html_escape(name)) hyper = Html("a", html_escape(name), href = url, title = html_escape(name))
@ -917,7 +917,7 @@ class BasePage(object):
if home_person: if home_person:
home_person_url = self.report.build_url_fname_html( home_person_url = self.report.build_url_fname_html(
home_person.handle, home_person.handle,
'ppl', "ppl",
self.up) self.up)
home_person_name = self.get_name(home_person) home_person_name = self.get_name(home_person)
@ -1042,17 +1042,18 @@ class BasePage(object):
inc_repos = False inc_repos = False
navs = [ navs = [
(self.report.index_fname, _("Html|Home"), self.report.use_home), (self.report.index_fname, _("Html|Home"), self.report.use_home),
(self.report.intro_fname, _("Introduction"), self.report.use_intro), (self.report.intro_fname, _("Introduction"), self.report.use_intro),
(self.report.surname_fname, _("Surnames"), True), (self.report.surname_fname, _("Surnames"), True),
('individuals', _("Individuals"), True), ('individuals', _("Individuals"), True),
('places', _("Places"), True), ('places', _("Places"), True),
('events', _("Events"), self.report.inc_events), ('events', _("Events"), self.report.inc_events),
('media', _("Media"), self.create_media), ('media', _("Media"), self.create_media),
('download', _("Download"), self.report.inc_download), ('download', _("Download"), self.report.inc_download),
('contact', _("Contact"), self.report.use_contact), ('contact', _("Contact"), self.report.use_contact),
('sources', SHEAD, True), ('sources', SHEAD, True),
('repositories', _("Repositories"), inc_repos), ('repositories', _("Repositories"), inc_repos),
("Internet_Address_Book", _("Internet Address Book"), self.report.add_book)
] ]
navigation = Html("div", id = 'navigation') navigation = Html("div", id = 'navigation')
@ -1090,11 +1091,14 @@ class BasePage(object):
if "plc" in self.report.cur_fname: if "plc" in self.report.cur_fname:
cs = True cs = True
elif nav_text == _("Events"): elif nav_text == _("Events"):
if 'evt' in self.report.cur_fname: if "evt" in self.report.cur_fname:
cs = True cs = True
elif nav_text == _("Media"): elif nav_text == _("Media"):
if "img" in self.report.cur_fname: if "img" in self.report.cur_fname:
cs = True cs = True
elif nav_text == _("Internet Address Book"):
if "iab" in self.report.cur_fname:
cs = True
cs = cs and 'class="CurrentSection"' or '' cs = cs and 'class="CurrentSection"' or ''
ul += (Html("li", attr = cs, inline = True) + ul += (Html("li", attr = cs, inline = True) +
@ -1254,8 +1258,7 @@ class BasePage(object):
with Html("div", class_ = "subsection", id = "weblinks") as section: with Html("div", class_ = "subsection", id = "weblinks") as section:
# begin web title # begin web title
title = Html("h4", _("Web Links"), inline = True) section += Html("h4", _("Web Links"), inline = True)
section += title
# ordered list # ordered list
ordered = Html("ol") ordered = Html("ol")
@ -1463,22 +1466,19 @@ class BasePage(object):
return hyper return hyper
def place_link(self, handle, name, gid = None, up = False): def place_link(self, handle, name, gid = None, up = False):
url = self.report.build_url_fname_html(handle, 'plc', up) url = self.report.build_url_fname_html(handle, "plc", up)
hyper = Html("a", html_escape(name), href = url, title = name) hyper = Html("a", html_escape(name), href = url, title = name)
if not self.noid and gid: if not self.noid and gid:
hyper += Html("span", " [%s] " % gid, class_ = "grampsid", inline = True) hyper += Html("span", " [%s]" % gid, class_ = "grampsid", inline = True)
# return hyperlink to its callers # return hyperlink to its callers
return hyper return hyper
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
#
# # Web Page Fortmatter and writer # # Web Page Fortmatter and writer
#
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
def XHTMLWriter(self, htmlinstance, of):
def mywriter(self, htmlinstance, of):
""" """
Will format, write, and close the file Will format, write, and close the file
@ -1578,7 +1578,7 @@ class IndividualListPage(BasePage):
first = False first = False
# firstname column # firstname column
url = self.report.build_url_fname_html(person.handle, 'ppl') url = self.report.build_url_fname_html(person.handle, "ppl")
trow += Html("td", self.person_link(url, person, False, gid = person.gramps_id), trow += Html("td", self.person_link(url, person, False, gid = person.gramps_id),
class_ = "ColumnName") class_ = "ColumnName")
@ -1634,7 +1634,7 @@ class IndividualListPage(BasePage):
if not first_family: if not first_family:
tcell += ", " tcell += ", "
if partner_handle in report_handle_list: if partner_handle in report_handle_list:
url = self.report.build_url_fname_html(partner_handle, 'ppl') url = self.report.build_url_fname_html(partner_handle, "ppl")
tcell += self.person_link(url, partner, True, gid = partner.gramps_id) tcell += self.person_link(url, partner, True, gid = partner.gramps_id)
else: else:
tcell += partner_name tcell += partner_name
@ -1678,9 +1678,12 @@ class IndividualListPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(indlistpage, of) self.XHTMLWriter(indlistpage, of)
class SurnamePage(BasePage): class SurnamePage(BasePage):
"""
This will create a list of individuals with the same surname
"""
def __init__(self, report, title, surname, person_handle_list, report_handle_list): def __init__(self, report, title, surname, person_handle_list, report_handle_list):
BasePage.__init__(self, report, title) BasePage.__init__(self, report, title)
@ -1692,7 +1695,7 @@ class SurnamePage(BasePage):
showpartner = report.options['showpartner'] showpartner = report.options['showpartner']
showparents = report.options['showparents'] showparents = report.options['showparents']
of = self.report.create_file(name_to_md5(surname), 'srn') of = self.report.create_file(name_to_md5(surname), "srn")
self.up = True self.up = True
surnamepage, body = self.write_header("%s - %s" % (_("Surname"), surname)) surnamepage, body = self.write_header("%s - %s" % (_("Surname"), surname))
@ -1743,7 +1746,7 @@ class SurnamePage(BasePage):
tbody += trow tbody += trow
# firstname column # firstname column
url = self.report.build_url_fname_html(person.handle, 'ppl', True) url = self.report.build_url_fname_html(person.handle, "ppl", True)
trow += Html("td", self.person_link(url, person, False, gid = person.gramps_id), trow += Html("td", self.person_link(url, person, False, gid = person.gramps_id),
class_ = "ColumnName") class_ = "ColumnName")
@ -1795,7 +1798,7 @@ class SurnamePage(BasePage):
if not first_family: if not first_family:
tcell += ',' tcell += ','
if partner_handle in report_handle_list: if partner_handle in report_handle_list:
url = self.report.build_url_fname_html(partner_handle, 'ppl', True) url = self.report.build_url_fname_html(partner_handle, "ppl", True)
tcell += self.person_link(url, partner, True, gid = partner.gramps_id) tcell += self.person_link(url, partner, True, gid = partner.gramps_id)
else: else:
tcell += partner_name tcell += partner_name
@ -1838,7 +1841,7 @@ class SurnamePage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(surnamepage, of) self.XHTMLWriter(surnamepage, of)
class PlaceListPage(BasePage): class PlaceListPage(BasePage):
@ -1920,7 +1923,7 @@ class PlaceListPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(placelistpage, of) self.XHTMLWriter(placelistpage, of)
class PlacePage(BasePage): class PlacePage(BasePage):
@ -1931,7 +1934,7 @@ class PlacePage(BasePage):
BasePage.__init__(self, report, title, place.gramps_id) BasePage.__init__(self, report, title, place.gramps_id)
self.src_list = src_list # TODO verify that this is correct self.src_list = src_list # TODO verify that this is correct
of = self.report.create_file(place.get_handle(), 'plc') of = self.report.create_file(place.get_handle(), "plc")
self.up = True self.up = True
self.page_title = ReportUtils.place_name(db, place_handle) self.page_title = ReportUtils.place_name(db, place_handle)
placepage, body = self.write_header(_("Places")) placepage, body = self.write_header(_("Places"))
@ -2016,7 +2019,7 @@ class PlacePage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(placepage, of) self.XHTMLWriter(placepage, of)
class EventListPage(BasePage): class EventListPage(BasePage):
@ -2079,7 +2082,7 @@ class EventListPage(BasePage):
# send page ut for processing # send page ut for processing
# and close the file # and close the file
self.mywriter(eventslistpage, of) self.XHTMLWriter(eventslistpage, of)
def write_event_row(self, person, partner, evt_type, evt, evt_ref, first): def write_event_row(self, person, partner, evt_type, evt, evt_ref, first):
""" """
@ -2101,7 +2104,7 @@ class EventListPage(BasePage):
trow.attr = 'class = "BeginName"' trow.attr = 'class = "BeginName"'
# get person's hyperlink # get person's hyperlink
url = self.report.build_url_fname_html(person.handle, 'ppl', subdirs) url = self.report.build_url_fname_html(person.handle, "ppl", subdirs)
person_hyper = self.person_link(url, person, True, first, gid = person.gramps_id) person_hyper = self.person_link(url, person, True, first, gid = person.gramps_id)
# get event data # get event data
@ -2129,7 +2132,7 @@ class EventListPage(BasePage):
if partner is not None: if partner is not None:
# get partner hyperlink # get partner hyperlink
url = self.report.build_url_fname_html(partner.handle, 'ppl', subdirs) url = self.report.build_url_fname_html(partner.handle, "ppl", subdirs)
partner_hyper = self.person_link(url, partner, True, gid = partner.gramps_id) partner_hyper = self.person_link(url, partner, True, gid = partner.gramps_id)
# determine if same row or not? # determine if same row or not?
@ -2148,7 +2151,7 @@ class EventPage(BasePage):
db = report.database db = report.database
subdirs = True subdirs = True
of = self.report.create_file(evt_ref.ref, 'evt') of = self.report.create_file(evt_ref.ref, "evt")
eventpage, body = self.write_header(_("Events")) eventpage, body = self.write_header(_("Events"))
# start event page division # start event page division
@ -2197,7 +2200,7 @@ class EventPage(BasePage):
tbody += trow tbody += trow
# get person hyperlink # get person hyperlink
url = self.report.build_url_fname_html(person.handle, 'ppl', self.up) url = self.report.build_url_fname_html(person.handle, "ppl", self.up)
person_hyper = self.person_link(url, person, True, gid = person.gramps_id) person_hyper = self.person_link(url, person, True, gid = person.gramps_id)
trow = [ Html("tr"), trow = [ Html("tr"),
Html("td", _('Person'), class_ = "ColumnAttribute", inline = True), Html("td", _('Person'), class_ = "ColumnAttribute", inline = True),
@ -2207,7 +2210,7 @@ class EventPage(BasePage):
# display partner if type is either Marriage or Divorce # display partner if type is either Marriage or Divorce
if partner is not None: if partner is not None:
url = self.report.build_url_fname_html(partner.handle, 'ppl', self.up) url = self.report.build_url_fname_html(partner.handle, "ppl", self.up)
partner_hyper = self.person_link(url, partner, True, gid = partner.gramps_id) partner_hyper = self.person_link(url, partner, True, gid = partner.gramps_id)
trow = [ Html("tr"), trow = [ Html("tr"),
Html("td", _('Partner'), class_ = "ColumnAttribute", inline = True), Html("td", _('Partner'), class_ = "ColumnAttribute", inline = True),
@ -2233,7 +2236,7 @@ class EventPage(BasePage):
# send page out for processing # send page out for processing
# and close the page # and close the page
self.mywriter(eventpage, of) self.XHTMLWriter(eventpage, of)
class MediaPage(BasePage): class MediaPage(BasePage):
@ -2272,7 +2275,7 @@ class MediaPage(BasePage):
_name = _obj.get_primary_name().get_call_name() _name = _obj.get_primary_name().get_call_name()
if not _name or _name == "": if not _name or _name == "":
_name = _obj.get_primary_name().get_first_name() _name = _obj.get_primary_name().get_first_name()
_linkurl = report.build_url_fname_html(_obj.handle, 'ppl', True) _linkurl = report.build_url_fname_html(_obj.handle, "ppl", True)
elif classname == "Event": elif classname == "Event":
_obj = db.get_event_from_handle( newhandle ) _obj = db.get_event_from_handle( newhandle )
_name = _obj.get_description() _name = _obj.get_description()
@ -2555,7 +2558,7 @@ class MediaPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(mediapage, of) self.XHTMLWriter(mediapage, of)
def gallery_nav_link(self, handle, name, up = False): def gallery_nav_link(self, handle, name, up = False):
@ -2734,10 +2737,10 @@ class SurnameListPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(surnamelistpage, of) self.XHTMLWriter(surnamelistpage, of)
def surname_link(self, fname, name, opt_val = None, up = False): def surname_link(self, fname, name, opt_val = None, up = False):
url = self.report.build_url_fname_html(fname, 'srn', up) url = self.report.build_url_fname_html(fname, "srn", up)
hyper = Html("a", name, href = url, title = name, inline = True) hyper = Html("a", name, href = url, title = name, inline = True)
if opt_val is not None: if opt_val is not None:
hyper += opt_val hyper += opt_val
@ -2780,7 +2783,7 @@ class IntroductionPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(intropage, of) self.XHTMLWriter(intropage, of)
class HomePage(BasePage): class HomePage(BasePage):
""" """
@ -2817,7 +2820,7 @@ class HomePage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(homepage, of) self.XHTMLWriter(homepage, of)
class SourceListPage(BasePage): class SourceListPage(BasePage):
@ -2885,7 +2888,7 @@ class SourceListPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(sourcelistpage, of) self.XHTMLWriter(sourcelistpage, of)
class SourcePage(BasePage): class SourcePage(BasePage):
@ -2895,7 +2898,7 @@ class SourcePage(BasePage):
source = db.get_source_from_handle(handle) source = db.get_source_from_handle(handle)
BasePage.__init__(self, report, title, source.gramps_id) 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
sourcepage, body = self.write_header(_('Sources')) sourcepage, body = self.write_header(_('Sources'))
@ -2956,7 +2959,7 @@ class SourcePage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(sourcepage, of) self.XHTMLWriter(sourcepage, of)
class MediaListPage(BasePage): class MediaListPage(BasePage):
@ -3025,7 +3028,7 @@ class MediaListPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(medialistpage, of) self.XHTMLWriter(medialistpage, of)
def media_ref_link(self, handle, name, up = False): def media_ref_link(self, handle, name, up = False):
@ -3168,7 +3171,7 @@ class DownloadPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(downloadpage, of) self.XHTMLWriter(downloadpage, of)
class ContactPage(BasePage): class ContactPage(BasePage):
@ -3233,7 +3236,7 @@ class ContactPage(BasePage):
# send page out for porcessing # send page out for porcessing
# and close the file # and close the file
self.mywriter(contactpage, of) self.XHTMLWriter(contactpage, of)
class IndividualPage(BasePage): class IndividualPage(BasePage):
""" """
@ -3257,7 +3260,7 @@ class IndividualPage(BasePage):
self.attribute_list = attribute_list self.attribute_list = attribute_list
db = report.database db = report.database
of = self.report.create_file(person.handle, 'ppl') of = self.report.create_file(person.handle, "ppl")
self.up = True self.up = True
indivdetpage, body = self.write_header(self.sort_name) indivdetpage, body = self.write_header(self.sort_name)
@ -3362,7 +3365,7 @@ class IndividualPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(indivdetpage, of) self.XHTMLWriter(indivdetpage, of)
def draw_box(self, center, col, person): def draw_box(self, center, col, person):
db = self.report.database db = self.report.database
@ -3395,7 +3398,7 @@ class IndividualPage(BasePage):
thumbnailUrl = "/".join(['..']*3 + [thumbnailUrl]) thumbnailUrl = "/".join(['..']*3 + [thumbnailUrl])
if ( Utils.win ): if ( Utils.win ):
thumbnailUrl = thumbnailUrl.replace('\\',"/") thumbnailUrl = thumbnailUrl.replace('\\',"/")
url = self.report.build_url_fname_html(person.handle, 'ppl', True) url = self.report.build_url_fname_html(person.handle, "ppl", True)
boxbg += self.person_link(url, person, name_style = True, boxbg += self.person_link(url, person, name_style = True,
thumbnailUrl=thumbnailUrl) thumbnailUrl=thumbnailUrl)
else: else:
@ -3875,7 +3878,7 @@ class IndividualPage(BasePage):
gid = child.gramps_id gid = child.gramps_id
list = Html("li") list = Html("li")
if child_handle in self.ind_list: if child_handle in self.ind_list:
url = self.report.build_url_fname_html(child_handle, 'ppl', True) url = self.report.build_url_fname_html(child_handle, "ppl", True)
list += self.person_link(url, child, True, gid = gid) list += self.person_link(url, child, True, gid = gid)
else: else:
@ -3896,7 +3899,7 @@ class IndividualPage(BasePage):
gid = person.gramps_id gid = person.gramps_id
if handle in self.ind_list: if handle in self.ind_list:
url = self.report.build_url_fname_html(handle, 'ppl', True) url = self.report.build_url_fname_html(handle, "ppl", True)
tcell2 += self.person_link(url, person, True, gid = gid) tcell2 += self.person_link(url, person, True, gid = gid)
else: else:
person_name = self.get_name(person) person_name = self.get_name(person)
@ -4248,7 +4251,7 @@ class IndividualPage(BasePage):
# display partner's name # display partner's name
if partner_handle: if partner_handle:
if partner_handle in self.ind_list: if partner_handle in self.ind_list:
url = self.report.build_url_fname_html(partner_handle, 'ppl', True) url = self.report.build_url_fname_html(partner_handle, "ppl", True)
tcell += self.person_link(url, partner, True, gid = partner.gramps_id) tcell += self.person_link(url, partner, True, gid = partner.gramps_id)
else: else:
tcell += partner_name tcell += partner_name
@ -4273,7 +4276,7 @@ class IndividualPage(BasePage):
person_name = self.get_name(person) person_name = self.get_name(person)
if person.handle in self.ind_list: if person.handle in self.ind_list:
url = self.report.build_url_fname_html(person.handle, 'ppl', True) url = self.report.build_url_fname_html(person.handle, "ppl", True)
hyper = self.person_link(url, person, name_style = True) hyper = self.person_link(url, person, name_style = True)
else: else:
hyper = person_name hyper = person_name
@ -4396,8 +4399,8 @@ class RepositoryListPage(BasePage):
BasePage.__init__(self, report, title) BasePage.__init__(self, report, title)
db = report.database db = report.database
of = self.report.create_file('repositories') of = self.report.create_file("repositories")
repolistpage, body = self.write_header(_('Repositories')) repolistpage, body = self.write_header(_("Repositories"))
# begin RepositoryList division # begin RepositoryList division
with Html("div", class_ = "content", id = "RepositoryList") as repositorylist: with Html("div", class_ = "content", id = "RepositoryList") as repositorylist:
@ -4462,14 +4465,14 @@ class RepositoryListPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(repolistpage, of) self.XHTMLWriter(repolistpage, of)
class RepositoryPage(BasePage): class RepositoryPage(BasePage):
""" """
will create the individual Repository Pages will create the individual Repository Pages
""" """
def __init__(self, report, title, repo, handle): def __init__(self, report, title, repo, handle, gid = None):
BasePage.__init__(self, report, title) BasePage.__init__(self, report, title)
db = report.database db = report.database
@ -4495,11 +4498,11 @@ class RepositoryPage(BasePage):
] ]
table += trow table += trow
if not self.noid: if not self.noid and gid:
# repo gramps id # repo gramps id
trow = [ Html("tr"), trow = [ Html("tr"),
Html("td", _("GRAMPS ID"), class_ = "ColumnType", inline = True), Html("td", _("GRAMPS ID"), class_ = "ColumnType", inline = True),
Html("td", repo.gramps_id, class_ = "ColumnAttribute", inline = True) Html("td", gid, class_ = "ColumnAttribute", inline = True)
] ]
table += trow table += trow
@ -4525,7 +4528,107 @@ class RepositoryPage(BasePage):
# send page out for processing # send page out for processing
# and close the file # and close the file
self.mywriter(repositorypage, of) self.XHTMLWriter(repositorypage, of)
class InternetAddressBook(BasePage):
"""
Will Create an Internet Address Book of people's web sites and email addresses
"""
def __init__(self, report, title, ind_list):
BasePage.__init__(self, report, title)
db = report.database
# Name the file, and create it
of = self.report.create_file("Internet_Address_Book")
# Add xml, doctype, meta and stylesheets
iabpage, body = self.write_header(_("Internet Address Book"))
# begin page division
with Html("div", class_ = "content", id = "InternetAddressBook") as addbook:
body += addbook
# Internet Address Book Page message
msg = _("This page contains an index of all the individuals in the "
"database, sorted by their GRAMPS ID. Selecting the person’s "
"name will take you to that person’s individual page. "
"Selecting a link will take you to their website or e-mail address.")
addbook += Html("p", msg, id = "description")
# begin Address Book table
with Html("table", class_ = "infolist addressbook") as table:
addbook += table
thead = Html("thead")
table += thead
trow = Html("tr") + (
Html("th", THEAD, class_ = "ColumnType", inline = True),
Html("th", _("Name"), class_ = "ColumnName", inline = True),
Html("th", _("Link"), class_ = "ColumnLink", inline = True)
)
thead += trow
tbody = Html("tbody")
table += tbody
for person_handle in ind_list:
person = db.get_person_from_handle(person_handle)
urllist = person.get_url_list()
first = True
for url in urllist:
trow = Html("tr")
tbody += trow
# Internet link type
trow += Html("td", str(url.get_type() ), class_ = "ColumnType", inline = True)
if first:
trow.attr = 'class = "BeginName"'
person_url = self.report.build_url_fname_html(person.handle, "ppl", False)
person_hyper = self.person_link(person_url, person, True, gid = person.gramps_id)
else:
person_hyper = " "
first = False
trow += Html("td", person_hyper, class_ = "ColumnName")
uri = url.get_path()
descr = url.get_description()
if not descr:
descr = uri
if url.get_type() == UrlType.EMAIL and not uri.startswith("mailto:"):
trow += Html("td", class_ = "ColumnLink") + (
Html("a",descr, href = 'mailto: %s' % url)
)
elif url.get_type() == UrlType.WEB_HOME and not uri.startswith("http://"):
trow += Html("td", class_ = "ColumnLink") + (
Html("a", descr, href = 'http://%s' % url)
)
elif url.get_type() == UrlType.WEB_FTP and not uri.startswith("ftp://"):
trow += Html("td", class_ = "ColumnLink") + (
Html("a", descr, href = 'ftp://%s' % url)
)
else:
trow += Html("td", class_ = "ColumnLink") + (
Html("a", descr, href = url)
)
# Add footer and clearline
footer = self.write_footer()
body += (fullclear, footer)
# write the file and close it
self.XHTMLWriter(iabpage, of)
class NavWebReport(Report): class NavWebReport(Report):
@ -4610,6 +4713,9 @@ class NavWebReport(Report):
# whether to display children in birthorder or entry order? # whether to display children in birthorder or entry order?
self.birthorder = self.options['birthorder'] self.birthorder = self.options['birthorder']
# get option for Internet Address Book
self.add_book = self.options["add_book"]
if self.use_home: if self.use_home:
self.index_fname = "index" self.index_fname = "index"
self.surname_fname = "surnames" self.surname_fname = "surnames"
@ -4731,6 +4837,11 @@ class NavWebReport(Report):
if len(repolist): if len(repolist):
self.repository_pages(repolist) self.repository_pages(repolist)
# build class InternetAddressBook
if self.add_book:
self.address_book_page(ind_list)
# if an archive is being used, close it? # if an archive is being used, close it?
if self.archive: if self.archive:
self.archive.close() self.archive.close()
@ -4937,7 +5048,7 @@ class NavWebReport(Report):
* field 6: date of death or burial (optional) * field 6: date of death or burial (optional)
* field 7: place of death or burial (optional) * field 7: place of death or burial (optional)
""" """
url = self.build_url_fname_html(person.handle, 'ppl') url = self.build_url_fname_html(person.handle, "ppl")
surname = person.get_primary_name().get_surname() surname = person.get_primary_name().get_surname()
fullname = person.get_primary_name().get_gedcom_name() fullname = person.get_primary_name().get_gedcom_name()
@ -5069,15 +5180,18 @@ class NavWebReport(Report):
# RepositoryListPage Class # RepositoryListPage Class
RepositoryListPage(self, self.title, repos_dict, keys) RepositoryListPage(self, self.title, repos_dict, keys)
index = 0
for index, key in enumerate(keys): for index, key in enumerate(keys):
(repo, handle) = repos_dict[key] (repo, handle) = repos_dict[key]
# RepositoryPage Class # RepositoryPage Class
RepositoryPage(self, self.title, repo, handle) RepositoryPage(self, self.title, repo, handle, repo.gramps_id)
self.progress.step() self.progress.step()
def address_book_page(self, ind_list):
InternetAddressBook(self, self.title, ind_list)
def add_image(self, option_name, height=0): def add_image(self, option_name, height=0):
pic_id = self.options[option_name] pic_id = self.options[option_name]
if pic_id: if pic_id:
@ -5562,6 +5676,10 @@ class NavWebOptions(MenuReportOptions):
inc_gendex.set_help(_('Whether to include a GENDEX file or not')) inc_gendex.set_help(_('Whether to include a GENDEX file or not'))
menu.add_option(category_name, 'inc_gendex', inc_gendex) menu.add_option(category_name, 'inc_gendex', inc_gendex)
add_book = BooleanOption(_("Include an Internet Address Book Page"), True)
add_book.set_help(_("Whether to add an Internet Address Book or not?"))
menu.add_option(category_name, "add_book", add_book)
def __archive_changed(self): def __archive_changed(self):
""" """
Update the change of storage: archive or directory Update the change of storage: archive or directory