[Gramps-devel] New Linux Genealogy mailing list

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Gramps-devel] New Linux Genealogy mailing list

Don Allingham
At the request of an independent genealogy group, the GRAMPS project is
hosting a new mailing list for the discussion of Linux and genealogy.
This is not a GRAMPS list, but a list for the general discussion of
Linux, genealogy issues, and various linux based genealogy programs
(including, but not limited to LifeLines, GeneWeb, GRAMPS, PhpGedView,
and any others).

If you are interested in joining this discussion group, you can join the
list at the address below:

http://gramps-project.org/mailman/listinfo/linux_genealogy_gramps-project.org

Please note that while the GRAMPS project is hosting the list, this list
is completely independent of the GRAMPS project and not associated with
the GRAMPS project in any way.

--
Don Allingham
http://gramps-project.org

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Gramps-Images in Narrative Web Pages

Bruce DeGrasse
Gramps, I noticed that the Narrative Web Page generator displayed all the
image objects for an individual in a single column.  After some tinkering
with "display_additional_images_as_gallery" in NavWebPage.py I was able to
display multiple images in a row.  This appeared to improve that section of
the web page considerably.  I have included the resulting code below, note
that changed lines of code have a #bjd.  This code is very rough at this
stage but it does provide a starting point if there is any interest in
developing it further.

Bruce D

********************************
  def display_additional_images_as_gallery( self, of, db, photolist=None):

        if not photolist or not self.use_gallery:
            return
           
        of.write('<div id="gallery">\n')
        of.write('<h4>%s</h4>\n' % _('Gallery'))
        of.write('<table><tr>')   #bjd
        col_count= 0        #bjd
        for mediaref in photolist:
            of.write('<td>')    #bjd
            photo_handle = mediaref.get_reference_handle()
            photo = db.get_object_from_handle(photo_handle)

            mime_type = photo.get_mime_type()
            if mime_type:
                try:
                    (real_path,newpath) = self.copy_media(photo)
                    self.media_link(of,photo_handle,newpath,
                                    photo.get_description(),up=True)
                except (IOError,OSError),msg:
                    WarningDialog(_("Could not add photo to page"),str(msg))
            else:
                try:
                    self.doc_link(of,photo_handle,
                                  photo.get_description(),up=True)
                    lnk = (self.cur_name,self.page_title,self.gid)
                    if self.photo_list.has_key(photo_handle):
                        if lnk not in self.photo_list[photo_handle]:
                            self.photo_list[photo_handle].append(lnk)
                    else:
                        self.photo_list[photo_handle] = [lnk]
                except (IOError,OSError),msg:
                    WarningDialog(_("Could not add photo to page"),str(msg))
                 
            of.write('</td>')       #bjd
            col_count += 1          #bjd
            if (col_count % 3) == 0:       #bjd
                of.write('</tr><tr>')  #bjd
             
        of.write('</tr></table>')   #bjd
        of.write('</div>\n')


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Gramps-Images in Narrative Web Pages

Don Allingham
Bruce,

This sounds like a very good idea. If you want to improve this, please
feel free to do so.

Don

On Sat, 2005-10-08 at 18:53 -0500, Bruce DeGrasse wrote:

> Gramps, I noticed that the Narrative Web Page generator displayed all the
> image objects for an individual in a single column.  After some tinkering
> with "display_additional_images_as_gallery" in NavWebPage.py I was able to
> display multiple images in a row.  This appeared to improve that section of
> the web page considerably.  I have included the resulting code below, note
> that changed lines of code have a #bjd.  This code is very rough at this
> stage but it does provide a starting point if there is any interest in
> developing it further.
>
> Bruce D
>
> ********************************
>   def display_additional_images_as_gallery( self, of, db, photolist=None):
>
>         if not photolist or not self.use_gallery:
>             return
>            
>         of.write('<div id="gallery">\n')
>         of.write('<h4>%s</h4>\n' % _('Gallery'))
>         of.write('<table><tr>')   #bjd
>         col_count= 0        #bjd
>         for mediaref in photolist:
>             of.write('<td>')    #bjd
>             photo_handle = mediaref.get_reference_handle()
>             photo = db.get_object_from_handle(photo_handle)
>
>             mime_type = photo.get_mime_type()
>             if mime_type:
>                 try:
>                     (real_path,newpath) = self.copy_media(photo)
>                     self.media_link(of,photo_handle,newpath,
>                                     photo.get_description(),up=True)
>                 except (IOError,OSError),msg:
>                     WarningDialog(_("Could not add photo to page"),str(msg))
>             else:
>                 try:
>                     self.doc_link(of,photo_handle,
>                                   photo.get_description(),up=True)
>                     lnk = (self.cur_name,self.page_title,self.gid)
>                     if self.photo_list.has_key(photo_handle):
>                         if lnk not in self.photo_list[photo_handle]:
>                             self.photo_list[photo_handle].append(lnk)
>                     else:
>                         self.photo_list[photo_handle] = [lnk]
>                 except (IOError,OSError),msg:
>                     WarningDialog(_("Could not add photo to page"),str(msg))
>                  
>             of.write('</td>')       #bjd
>             col_count += 1          #bjd
>             if (col_count % 3) == 0:       #bjd
>                 of.write('</tr><tr>')  #bjd
>              
>         of.write('</tr></table>')   #bjd
>         of.write('</div>\n')
>
--
Don Allingham <[hidden email]>

signature.asc (196 bytes) Download Attachment