Removed the extra media_ref_rect_regions that should not have been tried in the first place. Remove ColumnPath from display_url_list().
svn: r15108
This commit is contained in:
parent
98e8a6aaf8
commit
9281d1388c
@ -1110,40 +1110,6 @@ class BasePage(object):
|
|||||||
newpath, thumb_path = self.report.prepare_copy_media(obj)
|
newpath, thumb_path = self.report.prepare_copy_media(obj)
|
||||||
self.report.copy_file(Utils.media_path_full(db, obj.get_path()), newpath)
|
self.report.copy_file(Utils.media_path_full(db, obj.get_path()), newpath)
|
||||||
|
|
||||||
# get media rectangles
|
|
||||||
_region_items = self.media_ref_ewgions(obj_handle, obj)
|
|
||||||
if len(_region_items):
|
|
||||||
with Html("div") as mediadisplay:
|
|
||||||
|
|
||||||
# Feature #2634; display the mouse-selectable regions.
|
|
||||||
# See the large block at the top of this function where
|
|
||||||
# the various regions are stored in _region_items
|
|
||||||
ordered = Html("ol", class_ = "RegionBox")
|
|
||||||
mediadisplay += ordered
|
|
||||||
while len(_region_items):
|
|
||||||
(name, x, y, w, h, linkurl) = _region_items.pop()
|
|
||||||
ordered += Html("li", style = "left:%d%%; top:%d%%; width:%d%%; height:%d%%;"
|
|
||||||
% (x, y, w, h)) +(
|
|
||||||
Html("a", name, href = linkurl)
|
|
||||||
)
|
|
||||||
|
|
||||||
# begin image
|
|
||||||
image = Html("img")
|
|
||||||
mediadisplay += image
|
|
||||||
img_attr = ''
|
|
||||||
if height:
|
|
||||||
img_attr += 'height = "%d"' % height
|
|
||||||
img_attr += ' src = "%s" alt = "%s"' % (newpath, obj.get_description())
|
|
||||||
|
|
||||||
# add image attributes to image
|
|
||||||
image.attr = img_attr
|
|
||||||
|
|
||||||
# return image with media behaviours styling
|
|
||||||
return mediadisplay
|
|
||||||
|
|
||||||
# media has no media references
|
|
||||||
else:
|
|
||||||
|
|
||||||
# begin image
|
# begin image
|
||||||
image = Html("img")
|
image = Html("img")
|
||||||
img_attr = ''
|
img_attr = ''
|
||||||
@ -1163,7 +1129,7 @@ class BasePage(object):
|
|||||||
# no image to return
|
# no image to return
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def media_ref_ewgions(self, handle, media):
|
def media_ref_rect_regions(self, handle, media):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
*************************************
|
*************************************
|
||||||
@ -1275,24 +1241,6 @@ class BasePage(object):
|
|||||||
if mime_type:
|
if mime_type:
|
||||||
try:
|
try:
|
||||||
|
|
||||||
# get media rectangles
|
|
||||||
_region_items = self.media_ref_ewgions(photo_handle, photo)
|
|
||||||
if len(_region_items):
|
|
||||||
with Html("div") as mediadisplay:
|
|
||||||
snapshot += mediadisplay
|
|
||||||
|
|
||||||
# Feature #2634; display the mouse-selectable regions.
|
|
||||||
# See the large block at the top of this function where
|
|
||||||
# the various regions are stored in _region_items
|
|
||||||
ordered = Html("ol", class_ = "RegionBox")
|
|
||||||
mediadisplay += ordered
|
|
||||||
while len(_region_items):
|
|
||||||
(name, x, y, w, h, linkurl) = _region_items.pop()
|
|
||||||
ordered += Html("li", style = "left:%d%%; top:%d%%; width:%d%%; height:%d%%;"
|
|
||||||
% (x, y, w, h)) +(
|
|
||||||
Html("a", name, href = linkurl)
|
|
||||||
)
|
|
||||||
|
|
||||||
lnkref = (self.report.cur_fname, self.page_title, self.gid)
|
lnkref = (self.report.cur_fname, self.page_title, self.gid)
|
||||||
self.report.add_lnkref_to_photo(photo, lnkref)
|
self.report.add_lnkref_to_photo(photo, lnkref)
|
||||||
real_path, newpath = self.report.prepare_copy_media(photo)
|
real_path, newpath = self.report.prepare_copy_media(photo)
|
||||||
@ -1354,24 +1302,6 @@ class BasePage(object):
|
|||||||
if mime_type:
|
if mime_type:
|
||||||
try:
|
try:
|
||||||
|
|
||||||
# get media rectangles
|
|
||||||
_region_items = self.media_ref_ewgions(photo_handle, photo)
|
|
||||||
if len(_region_items):
|
|
||||||
with Html("div") as mediadisplay:
|
|
||||||
section += mediadisplay
|
|
||||||
|
|
||||||
# Feature #2634; display the mouse-selectable regions.
|
|
||||||
# See the large block at the top of this function where
|
|
||||||
# the various regions are stored in _region_items
|
|
||||||
ordered = Html("ol", class_ = "RegionBox")
|
|
||||||
mediadisplay += ordered
|
|
||||||
while len(_region_items):
|
|
||||||
(name, x, y, w, h, linkurl) = _region_items.pop()
|
|
||||||
ordered += Html("li", style = "left:%d%%; top:%d%%; width:%d%%; height:%d%%;"
|
|
||||||
% (x, y, w, h)) +(
|
|
||||||
Html("a", name, href = linkurl)
|
|
||||||
)
|
|
||||||
|
|
||||||
lnkref = (self.report.cur_fname, self.page_title, self.gid)
|
lnkref = (self.report.cur_fname, self.page_title, self.gid)
|
||||||
self.report.add_lnkref_to_photo(photo, lnkref)
|
self.report.add_lnkref_to_photo(photo, lnkref)
|
||||||
real_path, newpath = self.report.prepare_copy_media(photo)
|
real_path, newpath = self.report.prepare_copy_media(photo)
|
||||||
@ -1459,8 +1389,7 @@ class BasePage(object):
|
|||||||
for (label, colclass) in [
|
for (label, colclass) in [
|
||||||
(" ", "RowLabel"),
|
(" ", "RowLabel"),
|
||||||
(THEAD, "Type"),
|
(THEAD, "Type"),
|
||||||
(_("Path"), "Path"),
|
(_("Link/ Description"), "Description") ]
|
||||||
(DESCRHEAD, "Description") ]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
tbody = Html("tbody")
|
tbody = Html("tbody")
|
||||||
@ -1498,12 +1427,11 @@ class BasePage(object):
|
|||||||
if not uri.startswith("ftp://"):
|
if not uri.startswith("ftp://"):
|
||||||
uri = "ftp://%(ftpsite)s" % { "ftpsite" : uri }
|
uri = "ftp://%(ftpsite)s" % { "ftpsite" : uri }
|
||||||
|
|
||||||
uri = Html("a", descr, href = uri)
|
descr = Html("a", descr, href = uri, title = html_escape(descr))
|
||||||
trow.extend(
|
trow.extend(
|
||||||
Html("td", data, class_ = "Column" + colclass)
|
Html("td", data, class_ = "Column" + colclass)
|
||||||
for (data, colclass) in [
|
for (data, colclass) in [
|
||||||
(str(_type), "Type"),
|
(str(_type), "Type"),
|
||||||
(uri, "Path"),
|
|
||||||
(descr, "Description") ]
|
(descr, "Description") ]
|
||||||
)
|
)
|
||||||
index += 1
|
index += 1
|
||||||
@ -2617,7 +2545,7 @@ class MediaPage(BasePage):
|
|||||||
BasePage.__init__(self, report, title, media.gramps_id)
|
BasePage.__init__(self, report, title, media.gramps_id)
|
||||||
|
|
||||||
# get media rectangles
|
# get media rectangles
|
||||||
_region_items = self.media_ref_ewgions(handle, media)
|
_region_items = self.media_ref_rect_regions(handle, media)
|
||||||
|
|
||||||
of = self.report.create_file(handle, "img")
|
of = self.report.create_file(handle, "img")
|
||||||
self.up = True
|
self.up = True
|
||||||
|
Loading…
Reference in New Issue
Block a user