NarrativeWeb and Ancestortree: returned back to gramps3.2.x code as it had gotten screwed up severely. Now working again except for generation#3.
svn: r15902
This commit is contained in:
@ -775,22 +775,22 @@ class BasePage(object):
|
|||||||
# return table to its callers
|
# return table to its callers
|
||||||
return table
|
return table
|
||||||
|
|
||||||
def source_link(self, handle, name, cindex = None, gid = None, up = False):
|
def source_link(self, source, cindex = None, up = False):
|
||||||
"""
|
"""
|
||||||
creates a link to the source object
|
creates a link to the source object
|
||||||
|
|
||||||
@param: handle - source handle
|
@param: source -- source object from database
|
||||||
@param: cindex - count index
|
@param: cindex - count index
|
||||||
@param: name - source title
|
|
||||||
@param: gid - source gramps_id
|
|
||||||
@param: up - rather to add back directories or not?
|
@param: up - rather to add back directories or not?
|
||||||
"""
|
"""
|
||||||
|
|
||||||
url = self.report.build_url_fname_html(handle, "src", up)
|
url = self.report.build_url_fname_html( source.handle, "src", up )
|
||||||
|
gid = source.get_gramps_id()
|
||||||
|
title = html_escape( source.get_title() )
|
||||||
|
|
||||||
# begin hyperlink
|
# begin hyperlink
|
||||||
hyper = Html("a", html_escape(name), href = url,
|
hyper = Html("a", title, href = url,
|
||||||
title = _("Source Reference: ") + html_escape(name), inline = True)
|
title = _("Source Reference: ") + title, inline = True)
|
||||||
|
|
||||||
# if not None, add name reference to hyperlink element
|
# if not None, add name reference to hyperlink element
|
||||||
if cindex:
|
if cindex:
|
||||||
@ -1671,10 +1671,6 @@ class BasePage(object):
|
|||||||
if bibli.get_citation_count() == 0:
|
if bibli.get_citation_count() == 0:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# local gettext variables
|
|
||||||
_PAGE = _("Page")
|
|
||||||
_CONFIDENCE = _("Confidence")
|
|
||||||
|
|
||||||
db = self.report.database
|
db = self.report.database
|
||||||
with Html("div", id = "sourcerefs", class_ = "subsection") as section:
|
with Html("div", id = "sourcerefs", class_ = "subsection") as section:
|
||||||
section += Html("h4", _("Source References"), inline = True)
|
section += Html("h4", _("Source References"), inline = True)
|
||||||
@ -1699,8 +1695,7 @@ 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)
|
||||||
if source is not None:
|
if source is not None:
|
||||||
title = source.get_title()
|
list = Html("li", self.source_link(source, cindex, up = True))
|
||||||
list = Html("li", self.source_link(shandle, title, cindex, source.gramps_id, True))
|
|
||||||
else:
|
else:
|
||||||
list = Html("li", "None")
|
list = Html("li", "None")
|
||||||
|
|
||||||
@ -1716,19 +1711,17 @@ class BasePage(object):
|
|||||||
tmp.extend("%s: %s" % (label, data)
|
tmp.extend("%s: %s" % (label, data)
|
||||||
for (label, data) in [
|
for (label, data) in [
|
||||||
[DHEAD, _dd.display(sref.date)],
|
[DHEAD, _dd.display(sref.date)],
|
||||||
[_PAGE, sref.page],
|
[_("Page"), sref.page],
|
||||||
[_CONFIDENCE, confidence] ]
|
[_("Confidence"), confidence] ]
|
||||||
if data)
|
if data)
|
||||||
|
|
||||||
for handle in sref.get_note_list():
|
for handle in sref.get_note_list():
|
||||||
this_note = db.get_note_from_handle(handle)
|
this_note = db.get_note_from_handle(handle)
|
||||||
if this_note is not None:
|
if this_note is not None:
|
||||||
tmp.extend("%s: %s" %
|
tmp.extend("%s: %s" % ( str( this_note.get_type() ),
|
||||||
(this_note.type,
|
self.get_note_format(this_note, True)
|
||||||
self.get_note_format(
|
)
|
||||||
this_note,
|
)
|
||||||
True
|
|
||||||
)))
|
|
||||||
|
|
||||||
if tmp:
|
if tmp:
|
||||||
list1 = Html("li", " ".join(tmp), inline = True)
|
list1 = Html("li", " ".join(tmp), inline = True)
|
||||||
@ -1780,10 +1773,9 @@ class BasePage(object):
|
|||||||
creates a hyperlink for a person
|
creates a hyperlink for a person
|
||||||
|
|
||||||
@param: person = person in database
|
@param: person = person in database
|
||||||
@param: namestyle = _NAME_STYLE_FIRST -- first and suffix only
|
@param: namestyle = False -- first and suffix only
|
||||||
= _NAME_STYLE_DEFAULT -- name displayed in name_format variable
|
= True -- name displayed in name_format variable
|
||||||
= _NAME_STYLE_SHORT -- name displayed in name_format variable (shortened in output)
|
= None -- person is name
|
||||||
= None -- special, person is name
|
|
||||||
@param: first = show person's name and gramps id if requested and available
|
@param: first = show person's name and gramps id if requested and available
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -1792,16 +1784,11 @@ class BasePage(object):
|
|||||||
if first:
|
if first:
|
||||||
|
|
||||||
# see above for explanation
|
# see above for explanation
|
||||||
short_name = None
|
if name_style:
|
||||||
if name_style == _NAME_STYLE_DEFAULT:
|
|
||||||
person_name = self.get_name(person)
|
person_name = self.get_name(person)
|
||||||
elif name_style == _NAME_STYLE_FIRST:
|
elif name_style == False:
|
||||||
person_name = _get_short_name(person.gender, person.primary_name)
|
person_name = _get_short_name(person.gender, person.primary_name)
|
||||||
elif name_style == _NAME_STYLE_SHORT:
|
elif name_style == None: # abnormal specialty situation
|
||||||
full_name = self.get_name(person)
|
|
||||||
short_name = Html("span", _nd.truncate(full_name), class_ = "shortname", inline = True)
|
|
||||||
person_name = Html("span", full_name, class_ = "fullname", inline = True)
|
|
||||||
elif name_style is None: # abnormal specialty situation
|
|
||||||
person_name = person
|
person_name = person
|
||||||
|
|
||||||
# 1. start building link to image or person
|
# 1. start building link to image or person
|
||||||
@ -1810,15 +1797,12 @@ class BasePage(object):
|
|||||||
# 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:
|
||||||
hyper += (Html("span", class_ = "thumbnail") +
|
hyper += (Html("span", class_ = "thumbnail") +
|
||||||
Html("img", src = thumbnailUrl, alt = "Image of " + full_name,
|
Html("img", src = thumbnailUrl, alt = "Image of " + person_name)
|
||||||
title = "Image of " + full_name)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
hyper.attr += ' class= "noThumb"'
|
hyper.attr += ' class= "noThumb"'
|
||||||
|
|
||||||
# 3. insert the person's name
|
# 3. insert the person's name
|
||||||
if short_name is not None:
|
|
||||||
hyper += short_name
|
|
||||||
hyper += person_name
|
hyper += person_name
|
||||||
|
|
||||||
# 3. insert gramps id if requested and available
|
# 3. insert gramps id if requested and available
|
||||||
@ -2497,6 +2481,7 @@ class PlacePage(BasePage):
|
|||||||
# if place exists, but has nothing, return
|
# if place exists, but has nothing, return
|
||||||
if not place:
|
if not place:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
BasePage.__init__(self, report, title, place.gramps_id)
|
BasePage.__init__(self, report, title, place.gramps_id)
|
||||||
|
|
||||||
of = self.report.create_file(place_handle, "plc")
|
of = self.report.create_file(place_handle, "plc")
|
||||||
@ -3468,9 +3453,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",
|
trow.extend(
|
||||||
self.source_link(handle, source.get_title(), None,
|
Html("td", self.source_link(source, None), class_ = "ColumnName")
|
||||||
source.gramps_id), class_ = "ColumnName")
|
)
|
||||||
|
|
||||||
# add clearline for proper styling
|
# add clearline for proper styling
|
||||||
# add footer section
|
# add footer section
|
||||||
@ -4254,9 +4239,7 @@ class IndividualPage(BasePage):
|
|||||||
style="top: %dpx; left: %dpx;" % (top, xoff+1)
|
style="top: %dpx; left: %dpx;" % (top, xoff+1)
|
||||||
)
|
)
|
||||||
|
|
||||||
full_name = self.get_name(person)
|
person_name = self.get_name(person)
|
||||||
short_name = Html("span", _nd.truncate(full_name), class_ = "shortname", inline = True)
|
|
||||||
|
|
||||||
if person.handle in self.ind_list:
|
if person.handle in self.ind_list:
|
||||||
thumbnailUrl = None
|
thumbnailUrl = None
|
||||||
if self.create_media and col < 5:
|
if self.create_media and col < 5:
|
||||||
@ -4282,12 +4265,10 @@ class IndividualPage(BasePage):
|
|||||||
thumbnailUrl = "/".join(['..']*3 + [thumbnailUrl])
|
thumbnailUrl = "/".join(['..']*3 + [thumbnailUrl])
|
||||||
if constfunc.win():
|
if constfunc.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_SHORT, thumbnailUrl=thumbnailUrl)
|
boxbg += self.person_link(url, person, name_style = True, thumbnailUrl = thumbnailUrl)
|
||||||
else:
|
else:
|
||||||
boxbg += Html("span", short_name, class_ = "shortname unlinked", inline = True)
|
boxbg += Html("span", person_name, class_ = "unlinked", inline = True)
|
||||||
boxbg += Html("span", full_name, class_ = "fullname unlinked", inline = True)
|
|
||||||
shadow = Html("div", class_ = "shadow", inline = True, style="top: %dpx; left: %dpx;"
|
shadow = Html("div", class_ = "shadow", inline = True, style="top: %dpx; left: %dpx;"
|
||||||
% (top+_SHADOW, xoff+_SHADOW) )
|
% (top+_SHADOW, xoff+_SHADOW) )
|
||||||
|
|
||||||
|
@ -58,14 +58,15 @@ Females Web_Gender_Female.png
|
|||||||
position:relative;
|
position:relative;
|
||||||
z-index:10;
|
z-index:10;
|
||||||
display:block;
|
display:block;
|
||||||
font:normal .7em sans-serif;
|
font:normal .7em/1.4em sans-serif;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
color: #000;
|
color: #00029D;
|
||||||
width:118px;
|
width:118px;
|
||||||
padding:5px 20px 7px 20px;
|
padding:5px 20px 7px 20px;
|
||||||
margin-left:16px;
|
margin-left:16px;
|
||||||
border: solid 1px #00029D;
|
background-color: #FFF;
|
||||||
|
border: solid 1px #000;
|
||||||
}
|
}
|
||||||
#treeContainer div.boxbg a.noThumb,
|
#treeContainer div.boxbg a.noThumb,
|
||||||
#treeContainer div.AncCol3 a,
|
#treeContainer div.AncCol3 a,
|
||||||
@ -79,7 +80,7 @@ Females Web_Gender_Female.png
|
|||||||
z-index:999;
|
z-index:999;
|
||||||
font-size:1em;
|
font-size:1em;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
color: #000;
|
color: #00029D;
|
||||||
width:190px;
|
width:190px;
|
||||||
margin-left:-20px;
|
margin-left:-20px;
|
||||||
padding:10px 25px 12px 25px;
|
padding:10px 25px 12px 25px;
|
||||||
|
Reference in New Issue
Block a user