Clean up work on media_link() and doc_link(). Corrected a lot of single quatation marks to double quoteations.

svn: r13379
This commit is contained in:
Rob G. Healey 2009-10-17 20:54:17 +00:00
parent a5ac560552
commit 054acb7337

View File

@ -125,27 +125,27 @@ from libhtmlbackend import HtmlBackend
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# Translatable strings for variables within this plugin # Translatable strings for variables within this plugin
# gettext carries a huge footprint with it. # gettext carries a huge footprint with it.
AHEAD = _('Attributes') AHEAD = _("Attributes")
CITY = _('City') CITY = _("City")
COUNTY = _('County') COUNTY = _("County")
COUNTRY = _('Country') COUNTRY = _("Country")
DHEAD = _('Date') DHEAD = _("Date")
DESCRHEAD = _('Description') DESCRHEAD = _("Description")
LATITUDE = _('Latitude') LATITUDE = _("Latitude")
LOCATIONS = _('Alternate Locations') LOCATIONS = _("Alternate Locations")
LONGITUDE = _('Longitude') LONGITUDE = _("Longitude")
NHEAD = _('Notes') NHEAD = _("Notes")
PARISH = _('Church Parish') PARISH = _("Church Parish")
PHEAD = _('Place') PHEAD = _("Place")
PHONE = _('Phone') PHONE = _("Phone")
POSTAL = _('Postal Code') POSTAL = _("Postal Code")
SHEAD = _('Sources') SHEAD = _("Sources")
ST = _('Status') ST = _("Status")
STATE = _('State/ Province') STATE = _("State/ Province")
STREET = _('Street') STREET = _("Street")
THEAD = _("Type") THEAD = _("Type")
TMPL = _('Temple') TMPL = _("Temple")
VHEAD = _('Value') VHEAD = _("Value")
# define clear blank line for proper styling # define clear blank line for proper styling
fullclear = Html("div", class_ = "fullclear", inline = True) fullclear = Html("div", class_ = "fullclear", inline = True)
@ -510,7 +510,7 @@ class BasePage(object):
# 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)
@ -603,17 +603,17 @@ class BasePage(object):
trow = Html("tr") trow = Html("tr")
header_row = [ header_row = [
[THEAD, 'LDSType' ], [THEAD, "LDSType"],
[DHEAD, 'LDSDate' ], [DHEAD, "LDSDate"],
[TMPL, 'LDSTemple' ], [TMPL, "LDSTemple"],
[PHEAD, 'LDSPlace' ], [PHEAD, "LDSPlace"],
[ST, 'LDSStatus' ], [ST, "LDSStatus"],
[_('Sealed to '), 'LDSSealed'], [_("Sealed to "), "LDSSealed"],
[SHEAD, 'LDSSources'] [SHEAD, "LDSSources"]
] ]
# finish the label's missing piece # finish the label's missing piece
header_row[5][0] += _('Parents') if LDSType == 'Person' else _('Spouse') header_row[5][0] += _("Parents") if LDSType == "Person" else _("Spouse")
for (label, colclass) in header_row: for (label, colclass) in header_row:
trow += Html("th", label, class_ = "Column%s" % colclass, inline = True) trow += Html("th", label, class_ = "Column%s" % colclass, inline = True)
@ -839,7 +839,7 @@ class BasePage(object):
# begin attributes division and section title # begin attributes division and section title
with Html("div", class_ = "ubsection", id = "attributes") as section: with Html("div", class_ = "ubsection", id = "attributes") as section:
section += Html('h4', _('Attributes'), inline = True) section += Html("h4", _("Attributes"), inline = True)
# begin attributes table # begin attributes table
with Html("table", class_ = "infolist attrlist") as table: with Html("table", class_ = "infolist attrlist") as table:
@ -1030,17 +1030,17 @@ 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', _('Sources'), True), ('sources', SHEAD, True),
('repositories', _('Repositories'), inc_repos), ('repositories', _("Repositories"), inc_repos),
] ]
navigation = Html("div", id='navigation') navigation = Html("div", id='navigation')
@ -1063,30 +1063,30 @@ class BasePage(object):
cs = False cs = False
if nav_text == currentsection: if nav_text == currentsection:
cs = True cs = True
elif nav_text == _('Surnames'): elif nav_text == _("Surnames"):
if "srn" in self.report.cur_fname: if "srn" in self.report.cur_fname:
cs = True cs = True
elif _('Surnames') in currentsection: elif _("Surnames") in currentsection:
cs = True cs = True
elif nav_text == _('Individuals'): elif nav_text == _("Individuals"):
if "ppl" in self.report.cur_fname: if "ppl" in self.report.cur_fname:
cs = True cs = True
elif nav_text == _('Sources'): elif nav_text == SHEAD:
if "src" in self.report.cur_fname: if "src" in self.report.cur_fname:
cs = True cs = True
elif nav_text == _('Places'): elif nav_text == _("Places"):
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
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) +
Html('a', nav_text, href=url) Html("a", nav_text, href=url)
) )
navigation += ul navigation += ul
@ -1150,11 +1150,9 @@ class BasePage(object):
return None return None
db = self.report.database db = self.report.database
# begin individualgallery division # begin individualgallery division and section title
with Html("div", class_ = "subsection", id = "indivgallery") as section: with Html("div", class_ = "subsection", id = "indivgallery") as section:
section += Html("h4", _("Gallery"), inline = True)
# begin section title
section += Html('h4', _('Gallery'), inline = True)
displayed = [] displayed = []
for mediaref in photolist: for mediaref in photolist:
@ -1227,7 +1225,7 @@ class BasePage(object):
note_text = unicode(str(note_text), errors='replace') note_text = unicode(str(note_text), errors='replace')
# add section title # add section title
section += Html('h4', _('Narrative'), inline = True) section += Html("h4", _("Narrative"), inline = True)
# attach note # attach note
section += note_text section += note_text
@ -1244,7 +1242,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', _('Weblinks'), inline = True) title = Html("h4", _("Web Links"), inline = True)
section += title section += title
# ordered list # ordered list
@ -1257,15 +1255,15 @@ class BasePage(object):
if not descr: if not descr:
descr = uri descr = uri
if url.get_type() == UrlType.EMAIL and not uri.startswith("mailto:"): if url.get_type() == UrlType.EMAIL and not uri.startswith("mailto:"):
ordered += Html('li') + Html('a',descr, href='mailto:%s' % url) ordered += Html("li") + Html("a",descr, href='mailto:%s' % url)
elif url.get_type() == UrlType.WEB_HOME and not uri.startswith("http://"): elif url.get_type() == UrlType.WEB_HOME and not uri.startswith("http://"):
ordered += Html('li') + Html('a', descr, href='http://%s' % url) ordered += Html("li") + Html("a", descr, href='http://%s' % url)
elif url.get_type() == UrlType.WEB_FTP and not uri.startswith("ftp://"): elif url.get_type() == UrlType.WEB_FTP and not uri.startswith("ftp://"):
ordered += Html('li') + Html('a', descr, href='ftp://%s' % url) ordered += Html("li") + Html("a", descr, href='ftp://%s' % url)
else: else:
ordered += Html('li') + Html('a', descr, href=url) ordered += Html("li") + Html("a", descr, href=url)
# return web links to its caller # return web links to its caller
return section return section
@ -1311,18 +1309,18 @@ class BasePage(object):
tmp = [] tmp = []
confidence = Utils.confidence.get(sref.confidence, _('Unknown')) confidence = Utils.confidence.get(sref.confidence, _('Unknown'))
if confidence == _('Normal'): if confidence == _("Normal"):
confidence = None confidence = None
for (label, data) in [(_('Date'), _dd.display(sref.date)), for (label, data) in [(DHEAD, _dd.display(sref.date)),
(_('Page'), sref.page), (_("Page"), sref.page),
(_('Confidence'), confidence)]: (_("Confidence"), confidence)]:
if data: if data:
tmp.append("%s: %s" % (label, data)) tmp.append("%s: %s" % (label, data))
notelist = sref.get_note_list() notelist = sref.get_note_list()
for notehandle in notelist: for notehandle in notelist:
note = db.get_note_from_handle(notehandle) note = db.get_note_from_handle(notehandle)
note_text = self.get_note_format(note) note_text = self.get_note_format(note)
tmp.append("%s: %s" % (_('Text'), note_text)) tmp.append("%s: %s" % (_("Text"), note_text))
if len(tmp) > 0: if len(tmp) > 0:
list2 = Html("li") + ( list2 = Html("li") + (
Html("a", ';   '.join(tmp), name = "sref%d%s" % (cindex, key), inline = True) Html("a", ';   '.join(tmp), name = "sref%d%s" % (cindex, key), inline = True)
@ -1339,14 +1337,14 @@ class BasePage(object):
# begin references division and title # begin references division and title
with Html("div", class_ = "subsection", id = "references") as section: with Html("div", class_ = "subsection", id = "references") as section:
section += Html('h4', _('References'), inline = True) section += Html("h4", _("References"), inline = True)
ordered = Html('ol') ordered = Html('ol')
section += ordered section += ordered
sortlist = sorted(handlelist, key=lambda x:locale.strxfrm(x[1])) sortlist = sorted(handlelist, key=lambda x:locale.strxfrm(x[1]))
for (path, name, gid) in sortlist: for (path, name, gid) in sortlist:
list = Html('li') list = Html("li")
ordered += list ordered += list
# Note. 'path' already has a filename extension # Note. 'path' already has a filename extension
@ -1380,7 +1378,7 @@ class BasePage(object):
person_name = person person_name = person
# 1. start building link to image or person # 1. start building link to image or person
hyper = Html('a', href=url) hyper = Html("a", href=url)
# 2. insert thumbnail if there is one, otherwise insert class = "noThumb" # 2. insert thumbnail if there is one, otherwise insert class = "noThumb"
if thumbnailUrl: if thumbnailUrl:
@ -1411,14 +1409,13 @@ class BasePage(object):
with Html("div", class_ = "thumbnail") as thumbnail: with Html("div", class_ = "thumbnail") as thumbnail:
# begin hyperlink # begin hyperlink
hyper = (Html('a', href=url, title=name) + hyper = (Html("a", href=url, title=name) +
Html('img', src=img_url, alt=name) + Html('img', src=img_url, alt=name) )
(Html("p", inline = True) +
html_escape(name) if usedescr else '')
)
# add hyperlink and description to thumbnail division
thumbnail += hyper thumbnail += hyper
if usedescr:
hyper += Html("p", html_escape(name), inline = True)
# return thumbnail division to its callers # return thumbnail division to its callers
return thumbnail return thumbnail
@ -1430,16 +1427,14 @@ class BasePage(object):
thumbnail = Html("div", class_ = "thumbnail") thumbnail = Html("div", class_ = "thumbnail")
# begin hyperlink # begin hyperlink
hyper = Html('a', href=url, title=name) hyper = Html("a", href = url, title = name)
url = self.report.build_url_image('document.png', 'images', up) thumbnail += hyper
hyper += Html('img', src=url, alt=html_escape(name))
if usedescr:
descr = Html("p", html_escape(name), inline = True)
else:
descr = ''
# add hyperlink and description to thumbnail division url = self.report.build_url_image("document.png", "images", up)
thumbnail += (hyper, descr) hyper += Html("img", src = url, alt = html_escape(name))
if usedescr:
hyper += Html("p", html_escape(name), inline = True)
# return thumbnail division to its callers # return thumbnail division to its callers
return thumbnail return thumbnail
@ -1448,7 +1443,7 @@ class BasePage(object):
url = self.report.build_url_fname_html(handle, 'repo', up) url = self.report.build_url_fname_html(handle, 'repo', up)
# begin hyperlink # begin hyperlink
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)
@ -1458,7 +1453,7 @@ class BasePage(object):
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)
@ -1501,7 +1496,7 @@ class IndividualListPage(BasePage):
showparents = report.options['showparents'] showparents = report.options['showparents']
of = self.report.create_file("individuals") of = self.report.create_file("individuals")
indlistpage, body = self.write_header(_('Individuals')) indlistpage, body = self.write_header(_("Individuals"))
# begin Individuals division # begin Individuals division
with Html("div", class_ = "content", id = "Individuals") as individuallist: with Html("div", class_ = "content", id = "Individuals") as individuallist:
@ -1688,7 +1683,7 @@ class SurnamePage(BasePage):
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))
# begin SurnameDetail division # begin SurnameDetail division
with Html("div", class_ = "content", id = "SurnameDetail") as surnamedetail: with Html("div", class_ = "content", id = "SurnameDetail") as surnamedetail:
@ -1840,7 +1835,7 @@ class PlaceListPage(BasePage):
db = report.database db = report.database
of = self.report.create_file("places") of = self.report.create_file("places")
placelistpage, body = self.write_header(_('Places')) placelistpage, body = self.write_header(_("Places"))
# begin places division # begin places division
with Html("div", class_ = "content", id = "Places") as placelist: with Html("div", class_ = "content", id = "Places") as placelist:
@ -1866,8 +1861,8 @@ class PlaceListPage(BasePage):
table += thead table += thead
trow = Html("tr") + ( trow = Html("tr") + (
Html("th", _('Letter'), class_ = "ColumnLetter", inline = True), Html("th", _("Letter"), class_ = "ColumnLetter", inline = True),
Html("th", _('Place name|Name'), class_ = "ColumnName", inline = True) Html("th", _("Place name |Name"), class_ = "ColumnName", inline = True)
) )
thead += trow thead += trow
@ -1894,7 +1889,7 @@ class PlaceListPage(BasePage):
last_letter = letter last_letter = letter
trow.attr = 'class = "BeginLetter" ' trow.attr = 'class = "BeginLetter" '
tcell = Html("td", class_ = "olumnLetter", inline = True) + ( tcell = Html("td", class_ = "olumnLetter", inline = True) + (
Html('a', last_letter, name=last_letter, Html("a", last_letter, name=last_letter,
title="Places beginning with letter %s" % last_letter) title="Places beginning with letter %s" % last_letter)
) )
else: else:
@ -1926,7 +1921,7 @@ class PlacePage(BasePage):
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"))
# begin PlaceDetail Division # begin PlaceDetail Division
with Html("div", class_ = "content", id = "PlaceDetail") as placedetail: with Html("div", class_ = "content", id = "PlaceDetail") as placedetail:
@ -1949,7 +1944,7 @@ class PlacePage(BasePage):
if not self.noid: if not self.noid:
trow = Html("tr") + ( trow = Html("tr") + (
Html("td", _('GRAMPS ID'), class_ = "ColumnAttribute", inline = True), Html("td", _("GRAMPS ID"), class_ = "ColumnAttribute", inline = True),
Html("td", place.gramps_id, class_ = "ColumnValue", inline = True) Html("td", place.gramps_id, class_ = "ColumnValue", inline = True)
) )
table += trow table += trow
@ -2017,7 +2012,7 @@ class EventListPage(BasePage):
db = report.database db = report.database
of = self.report.create_file("events") of = self.report.create_file("events")
eventslistpage, body = self.write_header(_('Events')) eventslistpage, body = self.write_header(_("Events"))
# begin events list division # begin events list division
with Html("div", class_ = "content", id = "EventList") as eventlist: with Html("div", class_ = "content", id = "EventList") as eventlist:
@ -2137,14 +2132,14 @@ class EventPage(BasePage):
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
with Html("div", class_ = "content", id = "EventDetail") as eventdetail: with Html("div", class_ = "content", id = "EventDetail") as eventdetail:
body += eventdetail body += eventdetail
# display page itle # display page itle
title = _('%(type)s of %(name)s') % {'type' : evt_type.lower(), title = _("%(type)s of %(name)s") % {'type' : evt_type.lower(),
'name' : self.get_name(person) } 'name' : self.get_name(person) }
# line is in place for Peter Lundgren # line is in place for Peter Lundgren
@ -2396,15 +2391,15 @@ class MediaPage(BasePage):
mediadisplay += ordered mediadisplay += ordered
while len(_region_items) > 0: while len(_region_items) > 0:
(name, x, y, w, h, linkurl) = _region_items.pop() (name, x, y, w, h, linkurl) = _region_items.pop()
ordered += Html('li', style='left:%d%%; top:%d%%; width:%d%%; height:%d%%;' ordered += Html("li", style='left:%d%%; top:%d%%; width:%d%%; height:%d%%;'
% (x, y, w, h)) +( % (x, y, w, h)) +(
Html('a', name, href=linkurl) Html("a", name, href=linkurl)
) )
# display the image # display the image
if initial_image_path != newpath: if initial_image_path != newpath:
url = self.report.build_url_fname(newpath, None, self.up) url = self.report.build_url_fname(newpath, None, self.up)
mediadisplay += Html('a', href=url) + ( mediadisplay += Html("a", href=url) + (
Html('img', width=new_width, height=new_height, src=url, Html('img', width=new_width, height=new_height, src=url,
alt=html_escape(self.page_title)) alt=html_escape(self.page_title))
) )
@ -2432,7 +2427,7 @@ class MediaPage(BasePage):
if target_exists: if target_exists:
# TODO. Convert disk path to URL # TODO. Convert disk path to URL
url = self.report.build_url_fname(newpath, None, self.up) url = self.report.build_url_fname(newpath, None, self.up)
hyper = Html('a', href=url) hyper = Html("a", href=url)
# TODO. Mixup url and path # TODO. Mixup url and path
# path = convert_disk_path_to_url(path) # path = convert_disk_path_to_url(path)
url = self.report.build_url_fname(path, None, self.up) url = self.report.build_url_fname(path, None, self.up)
@ -2504,7 +2499,7 @@ class MediaPage(BasePage):
mediadetail += fullclear mediadetail += fullclear
# add exif title header # add exif title header
mediadetail += Html('h4', _('Image Exif Tags'), inline = True) mediadetail += Html("h4", _('Image Exif Tags'), inline = True)
# begin exif table # begin exif table
with Html("table", class_ = "exifdata") as table: with Html("table", class_ = "exifdata") as table:
@ -2551,7 +2546,7 @@ class MediaPage(BasePage):
url = self.report.build_url_fname_html(handle, 'img', up) url = self.report.build_url_fname_html(handle, 'img', up)
name = html_escape(name) name = html_escape(name)
hyper = Html('a', name, id=name, href=url, title=name, inline = True) hyper = Html("a", name, id=name, href=url, title=name, inline = True)
# return hyperlink to its callers # return hyperlink to its callers
return hyper return hyper
@ -2661,13 +2656,13 @@ class SurnameListPage(BasePage):
fname = self.report.surname_fname + self.ext fname = self.report.surname_fname + self.ext
tcell = Html("th", class_ = "ColumnSurname", inline = True) tcell = Html("th", class_ = "ColumnSurname", inline = True)
trow += tcell trow += tcell
hyper = Html('a', _('Surname'), href=fname) hyper = Html("a", _('Surname'), href=fname)
tcell += hyper tcell += hyper
fname = "surnames_count" + self.ext fname = "surnames_count" + self.ext
tcell = Html("th", class_ = "ColumnQuantity", inline = True) tcell = Html("th", class_ = "ColumnQuantity", inline = True)
trow += tcell trow += tcell
hyper = Html('a', _('Number of People'), href=fname) hyper = Html("a", _('Number of People'), href=fname)
tcell += hyper tcell += hyper
# begin table body # begin table body
@ -2701,7 +2696,7 @@ class SurnameListPage(BasePage):
trow.attr = ' class="BeginLetter" ' trow.attr = ' class="BeginLetter" '
tcell = Html("td", class_ = "ColumnLetter", inline = True) + ( tcell = Html("td", class_ = "ColumnLetter", inline = True) + (
Html('a', last_letter, name=last_letter, Html("a", last_letter, name=last_letter,
title="Surnames starting with letter %s" % last_letter) ) title="Surnames starting with letter %s" % last_letter) )
trow += tcell trow += tcell
@ -2729,7 +2724,7 @@ class SurnameListPage(BasePage):
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) hyper = Html("a", name, href=url, title=name)
if opt_val is not None: if opt_val is not None:
hyper += opt_val hyper += opt_val
@ -3028,7 +3023,7 @@ class MediaListPage(BasePage):
name = html_escape(name) name = html_escape(name)
# begin hyper link # begin hyper link
hyper = Html('a', name, href=url, title=name) hyper = Html("a", name, href=url, title=name)
# return hyperlink to its callers # return hyperlink to its callers
return hyper return hyper
@ -3106,7 +3101,7 @@ class DownloadPage(BasePage):
fname = os.path.basename(dlfname1) fname = os.path.basename(dlfname1)
tcell = Html("td", class_ = "Filename") + ( tcell = Html("td", class_ = "Filename") + (
Html('a', fname, href=dlfname1, alt=dldescr1) Html("a", fname, href=dlfname1, alt=dldescr1)
) )
trow += tcell trow += tcell
@ -3134,7 +3129,7 @@ class DownloadPage(BasePage):
fname = os.path.basename(dlfname2) fname = os.path.basename(dlfname2)
tcell = Html("td", class_ = "Filename") + ( tcell = Html("td", class_ = "Filename") + (
Html('a', fname, href=dlfname2, alt=dldescr2) Html("a", fname, href=dlfname2, alt=dldescr2)
) )
trow += tcell trow += tcell
@ -3203,7 +3198,7 @@ class ContactPage(BasePage):
researcher += Html("span", r.country, id='country', inline = True) researcher += Html("span", r.country, id='country', inline = True)
if r.email: if r.email:
researcher += Html("span", id='email') + ( researcher += Html("span", id='email') + (
Html('a', r.email, href='mailto:%s?subject="from GRAMPS Web Site"' Html("a", r.email, href='mailto:%s?subject="from GRAMPS Web Site"'
% r.email, inline = True) % r.email, inline = True)
) )
@ -3444,7 +3439,7 @@ class IndividualPage(BasePage):
center = int(max_size/2) center = int(max_size/2)
with Html("div", id = "tree", class_ = "subsection") as tree: with Html("div", id = "tree", class_ = "subsection") as tree:
tree += Html('h4', _('Ancestors'), inline = True) tree += Html("h4", _('Ancestors'), inline = True)
with Html("div", id = "treeContainer", with Html("div", id = "treeContainer",
style="width:%dpx; height:%dpx;" % style="width:%dpx; height:%dpx;" %
(_XOFFSET+(generations)*_WIDTH+(generations-1)*_HGAP, (_XOFFSET+(generations)*_WIDTH+(generations-1)*_HGAP,
@ -3511,7 +3506,7 @@ class IndividualPage(BasePage):
# begin Associations division # begin Associations division
with Html("div", class_ = "subsection", id = "Associations") as section: with Html("div", class_ = "subsection", id = "Associations") as section:
section += Html('h4', _('Associations'), inline = True) section += Html("h4", _('Associations'), inline = True)
with Html("table", class_ = "infolist assoclist") as table: with Html("table", class_ = "infolist assoclist") as table:
section += table section += table
@ -3571,13 +3566,13 @@ class IndividualPage(BasePage):
child_ped(ol) child_ped(ol)
else: else:
child = db.get_person_from_handle(child_handle) child = db.get_person_from_handle(child_handle)
ol += Html('li') + self.pedigree_person(child) ol += Html("li") + self.pedigree_person(child)
else: else:
child_ped(ol) child_ped(ol)
return ol return ol
def child_ped(ol): def child_ped(ol):
ol += Html('li', class_ = "thisperson", inline = True) + self.name ol += Html("li", class_ = "thisperson", inline = True) + self.name
family = self.pedigree_family() family = self.pedigree_family()
if family: if family:
ol += Html('ol', class_ = "spouselist") + family ol += Html('ol', class_ = "spouselist") + family
@ -3599,24 +3594,24 @@ class IndividualPage(BasePage):
mother = None mother = None
with Html("div", id = "pedigree", class_ = "subsection") as ped: with Html("div", id = "pedigree", class_ = "subsection") as ped:
ped += Html('h4', _('Pedigree'), inline = True) ped += Html("h4", _('Pedigree'), inline = True)
with Html('ol', class_ = "pedigreegen") as pedol: with Html('ol', class_ = "pedigreegen") as pedol:
ped += pedol ped += pedol
if father and mother: if father and mother:
pedfa = Html('li') + self.pedigree_person(father) pedfa = Html("li") + self.pedigree_person(father)
pedol += pedfa pedol += pedfa
with Html('ol') as pedma: with Html('ol') as pedma:
pedfa += pedma pedfa += pedma
pedma += (Html('li', class_ = "spouse") + pedma += (Html("li", class_ = "spouse") +
self.pedigree_person(mother) + self.pedigree_person(mother) +
children_ped(Html('ol')) children_ped(Html('ol'))
) )
elif father: elif father:
pedol += (Html('li') + self.pedigree_person(father) + pedol += (Html("li") + self.pedigree_person(father) +
children_ped(Html('ol')) children_ped(Html('ol'))
) )
elif mother: elif mother:
pedol += (Html('li') + self.pedigree_person(mother) + pedol += (Html("li") + self.pedigree_person(mother) +
children_ped(Html('ol')) children_ped(Html('ol'))
) )
else: else:
@ -3759,7 +3754,7 @@ class IndividualPage(BasePage):
# begin events division and section title # begin events division and section title
with Html("div", class_ = "subsection", id = "events") as section: with Html("div", class_ = "subsection", id = "events") as section:
section += Html('h4', _('Events'), inline = True) section += Html("h4", _('Events'), inline = True)
# begin events table # begin events table
with Html("table", class_ = "infolist eventlist") as table: with Html("table", class_ = "infolist eventlist") as table:
@ -3810,7 +3805,7 @@ class IndividualPage(BasePage):
# begin addresses division and title # begin addresses division and title
with Html("div", class_ = "subsection", id = "Addresses") as section: with Html("div", class_ = "subsection", id = "Addresses") as section:
section += Html('h4', _('Addresses'), inline = True) section += Html("h4", _('Addresses'), inline = True)
# write out addresses() # write out addresses()
section += self.dump_addresses(self.person) section += self.dump_addresses(self.person)
@ -3830,7 +3825,7 @@ class IndividualPage(BasePage):
# begin LDS Ordinance division and section title # begin LDS Ordinance division and section title
with Html("div", class_ = "subsection", id = "LDSOrdinance") as section: with Html("div", class_ = "subsection", id = "LDSOrdinance") as section:
section += Html('h4', _('Latter-Day Saints (LDS) Ordinance'), inline = True) section += Html("h4", _('Latter-Day Saints (LDS) Ordinance'), inline = True)
# ump individual LDS ordinance list # ump individual LDS ordinance list
section += self.dump_ordinance(db, self.person) section += self.dump_ordinance(db, self.person)
@ -3846,7 +3841,7 @@ class IndividualPage(BasePage):
child = db.get_person_from_handle(child_handle) child = db.get_person_from_handle(child_handle)
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)
@ -3895,7 +3890,7 @@ class IndividualPage(BasePage):
# begin parents division # begin parents division
with Html("div", class_ = "subsection", id = "parents") as section: with Html("div", class_ = "subsection", id = "parents") as section:
section += Html('h4', _('Parents'), inline = True) section += Html("h4", _('Parents'), inline = True)
# begin parents table # begin parents table
with Html("table", class_ = "infolist") as table: with Html("table", class_ = "infolist") as table:
@ -4135,7 +4130,7 @@ class IndividualPage(BasePage):
# begin families division and section title # begin families division and section title
with Html("div", class_ = "subsection", id = "families") as section: with Html("div", class_ = "subsection", id = "families") as section:
section += Html('h4', _('Families'), inline = True) section += Html("h4", _('Families'), inline = True)
# begin families table # begin families table
with Html("table", class_ = "infolist") as table: with Html("table", class_ = "infolist") as table:
@ -4270,7 +4265,7 @@ class IndividualPage(BasePage):
spouse_handle = ReportUtils.find_spouse(self.person, rel_family) spouse_handle = ReportUtils.find_spouse(self.person, rel_family)
if spouse_handle: if spouse_handle:
spouse = db.get_person_from_handle(spouse_handle) spouse = db.get_person_from_handle(spouse_handle)
pedsp = (Html('li', class_ = "spouse") + pedsp = (Html("li", class_ = "spouse") +
self.pedigree_person(spouse) self.pedigree_person(spouse)
) )
ped += [pedsp] ped += [pedsp]
@ -4282,7 +4277,7 @@ class IndividualPage(BasePage):
pedsp += [childol] pedsp += [childol]
for child_ref in childlist: for child_ref in childlist:
child = db.get_person_from_handle(child_ref.ref) child = db.get_person_from_handle(child_ref.ref)
childol += (Html('li') + childol += (Html("li") +
self.pedigree_person(child) self.pedigree_person(child)
) )
return ped return ped