Added the missing thumbnails on the preview page. Added option to create the family pages or not?
svn: r18094
This commit is contained in:
parent
ed18bf59bf
commit
85e803f5f6
@ -351,6 +351,7 @@ class BasePage(object):
|
|||||||
self.linkhome = report.options['linkhome']
|
self.linkhome = report.options['linkhome']
|
||||||
self.create_media = report.options['gallery']
|
self.create_media = report.options['gallery']
|
||||||
self.thumbpreview = report.options['thumbpreview']
|
self.thumbpreview = report.options['thumbpreview']
|
||||||
|
self.inc_families = report.options['inc_families']
|
||||||
self.inc_events = report.options['inc_events']
|
self.inc_events = report.options['inc_events']
|
||||||
|
|
||||||
def complete_people(self, tcell, first_person, handle_list, ppl_hnd_list, up =True):
|
def complete_people(self, tcell, first_person, handle_list, ppl_hnd_list, up =True):
|
||||||
@ -1267,11 +1268,11 @@ class BasePage(object):
|
|||||||
(self.report.intro_fname, _("Introduction"), self.report.use_intro),
|
(self.report.intro_fname, _("Introduction"), self.report.use_intro),
|
||||||
('individuals', _("Individuals"), True),
|
('individuals', _("Individuals"), True),
|
||||||
(self.report.surname_fname, _("Surnames"), True),
|
(self.report.surname_fname, _("Surnames"), True),
|
||||||
('families', _("Families"), True),
|
('families', _("Families"), self.report.inc_families),
|
||||||
('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),
|
||||||
('preview', _("Media Preview"), self.report.thumbpreview),
|
('thumbnails', _("Thumbnails"), self.report.thumbpreview),
|
||||||
('download', _("Download"), self.report.inc_download),
|
('download', _("Download"), self.report.inc_download),
|
||||||
('sources', _("Sources"), True),
|
('sources', _("Sources"), True),
|
||||||
('repositories', _("Repositories"), inc_repos),
|
('repositories', _("Repositories"), inc_repos),
|
||||||
@ -1453,10 +1454,10 @@ class BasePage(object):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# get a list of all media refs for this object
|
# get a list of all media refs for this object
|
||||||
medialist = _obj.get_media_list()
|
media_list = _obj.get_media_list()
|
||||||
|
|
||||||
# go media refs looking for one that points to this image
|
# go media refs looking for one that points to this image
|
||||||
for mediaref in medialist:
|
for mediaref in media_list:
|
||||||
|
|
||||||
# is this mediaref for this image? do we have a rect?
|
# is this mediaref for this image? do we have a rect?
|
||||||
if mediaref.ref == handle and mediaref.rect is not None:
|
if mediaref.ref == handle and mediaref.rect is not None:
|
||||||
@ -4181,22 +4182,22 @@ class MediaListPage(BasePage):
|
|||||||
db = report.database
|
db = report.database
|
||||||
|
|
||||||
of = self.report.create_file("media")
|
of = self.report.create_file("media")
|
||||||
medialistpage, head, body = self.write_header(_('Media'))
|
media_listpage, head, body = self.write_header(_('Media'))
|
||||||
|
|
||||||
# begin gallery division
|
# begin gallery division
|
||||||
with Html("div", class_ = "content", id = "Gallery") as medialist:
|
with Html("div", class_ = "content", id = "Gallery") as media_list:
|
||||||
body += medialist
|
body += media_list
|
||||||
|
|
||||||
msg = _("This page contains an index of all the media objects "
|
msg = _("This page contains an index of all the media objects "
|
||||||
"in the database, sorted by their title. Clicking on "
|
"in the database, sorted by their title. Clicking on "
|
||||||
"the title will take you to that media object’s page. "
|
"the title will take you to that media object’s page. "
|
||||||
"If you see media size dimensions above an image, click on the "
|
"If you see media size dimensions above an image, click on the "
|
||||||
"image to see the full sized version. ")
|
"image to see the full sized version. ")
|
||||||
medialist += Html("p", msg, id = "description")
|
media_list += Html("p", msg, id = "description")
|
||||||
|
|
||||||
# begin gallery table and table head
|
# begin gallery table and table head
|
||||||
with Html("table", class_ = "infolist gallerylist") as table:
|
with Html("table", class_ = "infolist gallerylist") as table:
|
||||||
medialist += table
|
media_list += table
|
||||||
|
|
||||||
# begin table head
|
# begin table head
|
||||||
thead = Html("thead")
|
thead = Html("thead")
|
||||||
@ -4249,7 +4250,7 @@ class MediaListPage(BasePage):
|
|||||||
|
|
||||||
# send page out for processing
|
# send page out for processing
|
||||||
# and close the file
|
# and close the file
|
||||||
self.XHTMLWriter(medialistpage, of)
|
self.XHTMLWriter(media_listpage, of)
|
||||||
|
|
||||||
def media_ref_link(self, handle, name, up = False):
|
def media_ref_link(self, handle, name, up = False):
|
||||||
|
|
||||||
@ -4275,21 +4276,18 @@ class ThumbnailPreview(BasePage):
|
|||||||
if not self.photo_keys:
|
if not self.photo_keys:
|
||||||
return
|
return
|
||||||
|
|
||||||
medialist = []
|
media_list = []
|
||||||
for phandle in self.photo_keys:
|
for phandle in self.photo_keys:
|
||||||
photo = db.get_object_from_handle(phandle)
|
photo = db.get_object_from_handle(phandle)
|
||||||
if photo:
|
if (photo and photo.get_mime_type().startswith("image/")):
|
||||||
mime_type = photo.get_mime_type()
|
media_list.append( (photo.get_description(), phandle, photo) )
|
||||||
if mime_type.startswith("image"):
|
if not media_list:
|
||||||
photo_title = photo.get_description()
|
|
||||||
medialist.append( (photo_title, photo) )
|
|
||||||
if not medialist:
|
|
||||||
return
|
return
|
||||||
medialist.sort()
|
media_list.sort()
|
||||||
|
|
||||||
# reate thumbnail preview page...
|
# reate thumbnail preview page...
|
||||||
of = self.report.create_file("preview")
|
of = self.report.create_file("preview")
|
||||||
thumbnailpage, head, body = self.write_header(_("Thumbnail Preview"))
|
thumbnailpage, head, body = self.write_header(_("Thumbnails"))
|
||||||
|
|
||||||
with Html("div", class_ ="content", id ="Preview") as previewpage:
|
with Html("div", class_ ="content", id ="Preview") as previewpage:
|
||||||
body += previewpage
|
body += previewpage
|
||||||
@ -4324,15 +4322,17 @@ class ThumbnailPreview(BasePage):
|
|||||||
table += tbody
|
table += tbody
|
||||||
|
|
||||||
index, indexpos = 1, 0
|
index, indexpos = 1, 0
|
||||||
num_of_rows = (len(medialist) // 7)
|
num_of_images = len(media_list)
|
||||||
for rows in range(0, num_of_rows):
|
num_of_rows = ((num_of_images // 7) + 1)
|
||||||
|
while num_of_rows:
|
||||||
trow = Html("tr")
|
trow = Html("tr")
|
||||||
tbody += trow
|
tbody += trow
|
||||||
|
|
||||||
for cols in range(0, 7):
|
cols = 0
|
||||||
ptitle = medialist[indexpos][0]
|
while (cols <= 6 and indexpos < num_of_images):
|
||||||
photo = medialist[indexpos][1]
|
ptitle = media_list[indexpos][0]
|
||||||
phandle = photo.get_handle()
|
phandle = media_list[indexpos][1]
|
||||||
|
photo = media_list[indexpos][2]
|
||||||
|
|
||||||
# begin table cell and attach to table row(trow)...
|
# begin table cell and attach to table row(trow)...
|
||||||
tcell = Html("td", class_ ="highlight weekend")
|
tcell = Html("td", class_ ="highlight weekend")
|
||||||
@ -4361,6 +4361,8 @@ class ThumbnailPreview(BasePage):
|
|||||||
|
|
||||||
index += 1
|
index += 1
|
||||||
indexpos += 1
|
indexpos += 1
|
||||||
|
cols += 1
|
||||||
|
num_of_rows -= 1
|
||||||
|
|
||||||
# begin Thumbnail Reference section...
|
# begin Thumbnail Reference section...
|
||||||
with Html("div", class_ ="subsection", id ="references") as section:
|
with Html("div", class_ ="subsection", id ="references") as section:
|
||||||
@ -4374,7 +4376,7 @@ class ThumbnailPreview(BasePage):
|
|||||||
table += tbody
|
table += tbody
|
||||||
|
|
||||||
index = 1
|
index = 1
|
||||||
for ptitle, photo in medialist:
|
for ptitle, phandle, photo in media_list:
|
||||||
trow = Html("tr")
|
trow = Html("tr")
|
||||||
tbody += trow
|
tbody += trow
|
||||||
|
|
||||||
@ -6217,6 +6219,9 @@ class NavWebReport(Report):
|
|||||||
# name format options
|
# name format options
|
||||||
self.name_format = self.options['name_format']
|
self.name_format = self.options['name_format']
|
||||||
|
|
||||||
|
# include families or not?
|
||||||
|
self.inc_families = self.options['inc_families']
|
||||||
|
|
||||||
# create a media thumbnail preview page or not?
|
# create a media thumbnail preview page or not?
|
||||||
self.thumbpreview = self.options['thumbpreview']
|
self.thumbpreview = self.options['thumbpreview']
|
||||||
|
|
||||||
@ -6371,6 +6376,7 @@ class NavWebReport(Report):
|
|||||||
self.event_pages(ind_list)
|
self.event_pages(ind_list)
|
||||||
|
|
||||||
# build classes FamilyListPage and FamilyPage
|
# build classes FamilyListPage and FamilyPage
|
||||||
|
if self.inc_families:
|
||||||
self.family_pages(ind_list, place_list)
|
self.family_pages(ind_list, place_list)
|
||||||
|
|
||||||
# build classes SourceListPage and SourcePage
|
# build classes SourceListPage and SourcePage
|
||||||
@ -6604,7 +6610,7 @@ class NavWebReport(Report):
|
|||||||
db = self.database
|
db = self.database
|
||||||
|
|
||||||
# set ProgressMeter for Families/ Relationship pages...
|
# set ProgressMeter for Families/ Relationship pages...
|
||||||
self.progress.set_pass(_("Creating Familiy Relationship pages..."), len(db.get_family_handles() ))
|
self.progress.set_pass(_("Creating family pages..."), len(db.get_family_handles() ))
|
||||||
|
|
||||||
FamilyListPage(self, self.title, ppl_hnd_list)
|
FamilyListPage(self, self.title, ppl_hnd_list)
|
||||||
|
|
||||||
@ -7319,6 +7325,10 @@ class NavWebOptions(MenuReportOptions):
|
|||||||
birthorder.set_help(_('Whether to display children in birth order or in entry order?'))
|
birthorder.set_help(_('Whether to display children in birth order or in entry order?'))
|
||||||
addopt( "birthorder", birthorder )
|
addopt( "birthorder", birthorder )
|
||||||
|
|
||||||
|
inc_families = BooleanOption(_("Include family pages"), False)
|
||||||
|
inc_families.set_help(_("Whether to include family pages or not?"))
|
||||||
|
addopt("inc_families", inc_families)
|
||||||
|
|
||||||
inc_events = BooleanOption(_('Include event pages'), False)
|
inc_events = BooleanOption(_('Include event pages'), False)
|
||||||
inc_events.set_help(_('Add a complete events list and relevant pages or not'))
|
inc_events.set_help(_('Add a complete events list and relevant pages or not'))
|
||||||
addopt( "inc_events", inc_events )
|
addopt( "inc_events", inc_events )
|
||||||
|
Loading…
Reference in New Issue
Block a user