diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f5e24bc91..562755245 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,5 +1,6 @@ 2005-07-15 Martin Hawlisch - * src/plugins/NavWebPage.py: Avoid some segfaults; HTML validation fixes + * src/plugins/NavWebPage.py: Avoid some segfaults; HTML validation fixes; + Show all names of a person; Show all images of person/source and place * src/Utils.py (find_mime_type_pixbuf): Dont segfault with note only object * src/SelectObject.py (on_select_row): Dont segfault with note only object diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 5d529e8b7..a76f6469e 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -216,6 +216,30 @@ class BasePage: except (IOError,OSError),msg: ErrorDialog(str(msg)) + def display_additional_images_as_gallery( self, of, db, photolist=None): + if not photolist or len(photolist) < 2: + return + + of.write('

%s

\n' % _('Gallery')) + of.write('
\n') + of.write('
') + for mediaref in photolist[1:]: + photo_handle = mediaref.get_reference_handle() + photo = db.get_object_from_handle(photo_handle) + + if photo.get_mime_type(): + try: + newpath = self.copy_media(photo) + of.write('
\n') + of.write('' % (photo_handle,self.ext)) + of.write('%s' % photo.get_description()) + of.write('
%s
' % photo.get_description()) + of.write('
\n') + except (IOError,OSError),msg: + ErrorDialog(str(msg)) + of.write('
') + def display_note_object(self,of,noteobj=None): if not noteobj: return @@ -226,7 +250,7 @@ class BasePage: of.write('

%s

\n' % _('Narrative')) of.write('
\n') if format: - text = u"
" + u"
".join(text.split("\n")) + text = u"
" + u"
".join(text.split("\n"))+u"
" else: text = u"

".join(text.split("\n")) of.write('

%s

\n' % text) @@ -435,6 +459,7 @@ class PlacePage(BasePage): # TODO: Add more information + self.display_additional_images_as_gallery(of, db, place.get_media_list()) self.display_note_object(of, place.get_note_object()) self.display_url_list(of, place.get_url_list()) self.display_references(of,db,place_list[place.handle]) @@ -718,6 +743,7 @@ class SourcePage(BasePage): # TODO: Add more information + self.display_additional_images_as_gallery(of, db, source.get_media_list()) self.display_note_object(of, source.get_note_object()) self.display_references(of,db,src_list[source.handle]) self.display_footer(of) @@ -843,7 +869,7 @@ class ContactPage(BasePage): text = nobj.get() if format: - text = u"
" + u"
".join(text.split("\n")) + text = u"
" + u"
".join(text.split("\n"))+u"
" else: text = u"

".join(text.split("\n")) of.write('

%s

\n' % text) @@ -886,6 +912,7 @@ class IndividualPage(BasePage): self.display_ind_general(of) self.display_ind_events(of) self.display_ind_relationships(of) + self.display_additional_images_as_gallery(of, db, self.person.get_media_list()) self.display_note_object(of, self.person.get_note_object()) self.display_url_list(of, self.person.get_url_list()) self.display_ind_sources(of) @@ -980,13 +1007,38 @@ class IndividualPage(BasePage): of.write('
\n') of.write('

%s

\n' % self.sort_name) + of.write('\n') + # GRAMPS ID of.write('\n' % _('GRAMPS ID')) of.write('\n' % self.person.gramps_id) of.write('\n') + # Names [and their sources] + for name in [self.person.get_primary_name(),]+self.person.get_alternate_names(): + pname = _nd.display_name(name) + of.write('\n' % _(name.get_type())) + of.write('\n\n') + # Gender of.write('\n' % _('Gender')) gender = self.gender_map[self.person.gender]
%s%s
%s%s' % pname) + nshl = [] + for nsref in name.get_source_references(): + nsh = nsref.get_base_handle() + if self.src_list.has_key(nsh): + if self.person.handle not in self.src_list[nsh]: + self.src_list[nsh].append(self.person.handle) + else: + self.src_list[nsh] = [self.person.handle] + nshl.append(nsh) + if nshl: + of.write( " ") + for nsh in nshl: + src = self.db.get_source_from_handle(nsh) + of.write(' [%s]' % (nsh,self.ext,src.gramps_id)) + of.write( " ") + + of.write('
%s