Fix bug in Narrative Web source page. Small performance enhancements in display_source_refs.
svn: r13626
This commit is contained in:
parent
c495226344
commit
50029fbb16
@ -1375,9 +1375,12 @@ class BasePage(object):
|
|||||||
# Add this source and its references to the page
|
# Add this source and its references to the page
|
||||||
source = db.get_source_from_handle(shandle)
|
source = db.get_source_from_handle(shandle)
|
||||||
title = source.get_title()
|
title = source.get_title()
|
||||||
list = Html("li", inline = True) + (
|
list = Html("li") + (
|
||||||
Html("a", self.source_link(source.handle, title, source.gramps_id, True),
|
Html("a",
|
||||||
name = "sref%d" % cindex)
|
self.source_link(source.handle, title, source.gramps_id,
|
||||||
|
up=True),
|
||||||
|
name="sref%d" % cindex,
|
||||||
|
inline=True)
|
||||||
)
|
)
|
||||||
ordered += list
|
ordered += list
|
||||||
|
|
||||||
@ -1389,22 +1392,26 @@ class BasePage(object):
|
|||||||
confidence = Utils.confidence.get(sref.confidence, _('Unknown'))
|
confidence = Utils.confidence.get(sref.confidence, _('Unknown'))
|
||||||
if confidence == _('Normal'):
|
if confidence == _('Normal'):
|
||||||
confidence = None
|
confidence = None
|
||||||
|
|
||||||
|
tmp.extend("%s: %s" % (label, data)
|
||||||
for (label, data) in [(DHEAD, format_date(sref.date)),
|
for (label, data) in [(DHEAD, format_date(sref.date)),
|
||||||
(_PAGE, sref.page),
|
(_PAGE, sref.page),
|
||||||
(_CONFIDENCE, confidence)]:
|
(_CONFIDENCE, confidence)]
|
||||||
if data:
|
if data)
|
||||||
tmp.append("%s: %s" % (label, data))
|
|
||||||
|
|
||||||
notelist = sref.get_note_list()
|
tmp.extend(_TEXT + ': ' +
|
||||||
for notehandle in notelist:
|
self.get_note_format(
|
||||||
note = db.get_note_from_handle(notehandle)
|
db.get_note_from_handle(handle)
|
||||||
note_text = self.get_note_format(note)
|
) for handle in sref.get_note_list())
|
||||||
tmp.append("%s: %s" % (_TEXT, note_text))
|
|
||||||
if len(tmp):
|
if tmp:
|
||||||
list1 = Html("li", inline = True) + (
|
list1 = Html("li", inline=True) + (
|
||||||
Html("a", '; '.join(tmp), name = "sref%d%s" % (cindex, key))
|
Html("a", '; '.join(tmp),
|
||||||
|
name = "sref%d%s" % (cindex, key))
|
||||||
)
|
)
|
||||||
|
|
||||||
ordered1 += list1
|
ordered1 += list1
|
||||||
|
if citation_ref_list:
|
||||||
list += ordered1
|
list += ordered1
|
||||||
ordered += list
|
ordered += list
|
||||||
section += ordered
|
section += ordered
|
||||||
@ -2988,7 +2995,9 @@ class SourceListPage(BasePage):
|
|||||||
Html("td", index + 1, class_ = "ColumnRowLabel", inline = True)
|
Html("td", index + 1, class_ = "ColumnRowLabel", inline = True)
|
||||||
)
|
)
|
||||||
tbody += trow
|
tbody += trow
|
||||||
trow += Html("td", self.source_link(handle, "", source.get_title(), source.gramps_id),
|
trow += Html("td",
|
||||||
|
self.source_link(handle, source.get_title(),
|
||||||
|
source.gramps_id),
|
||||||
class_ = "ColumnName")
|
class_ = "ColumnName")
|
||||||
|
|
||||||
# add clearline for proper styling
|
# add clearline for proper styling
|
||||||
@ -5497,7 +5506,7 @@ class NavWebReport(Report):
|
|||||||
Imagine we run gramps on Windows (heaven forbits), we don't want to
|
Imagine we run gramps on Windows (heaven forbits), we don't want to
|
||||||
see backslashes in the URL.
|
see backslashes in the URL.
|
||||||
"""
|
"""
|
||||||
if ( Utils.win ):
|
if Utils.win():
|
||||||
fname = fname.replace('\\',"/")
|
fname = fname.replace('\\',"/")
|
||||||
subdirs = self.build_subdirs(subdir, fname, up)
|
subdirs = self.build_subdirs(subdir, fname, up)
|
||||||
return "/".join(subdirs + [fname])
|
return "/".join(subdirs + [fname])
|
||||||
|
Loading…
Reference in New Issue
Block a user