From 01eebf5e77fc9a6041e56e4d3668d6e4bb78679e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 17 Jul 2005 04:36:24 +0000 Subject: [PATCH] * src/data/main*.css: fix spacing in CSS files * src/plugins/NavWebPage.py: split parents and families * src/ReportUtils.py: save note information svn: r4949 --- gramps2/ChangeLog | 7 ++ gramps2/src/ReportUtils.py | 3 +- gramps2/src/data/main1.css | 4 + gramps2/src/data/main2.css | 3 + gramps2/src/data/main3.css | 3 + gramps2/src/data/main4.css | 3 + gramps2/src/data/main5.css | 3 + gramps2/src/plugins/NavWebPage.py | 153 ++++++++++++++++++------------ 8 files changed, 119 insertions(+), 60 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 751f2e42b..2e2bfcdde 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,10 @@ +2005-07-16 Steve Hall + * src/data/main*.css: fix spacing in CSS files + +2005-07-16 Don Allingham + * src/plugins/NavWebPage.py: split parents and families + * src/ReportUtils.py: save note information + 2005-07-16 Martin Hawlisch * src/plugins/Makefile.am: Install NavWebPage.py plugin * src/data/Makefile.am: Install stylesheets for NavWebPage diff --git a/gramps2/src/ReportUtils.py b/gramps2/src/ReportUtils.py index a8d25287a..21f525e46 100644 --- a/gramps2/src/ReportUtils.py +++ b/gramps2/src/ReportUtils.py @@ -308,7 +308,6 @@ def sanitize_person(db,person): for item in person.get_parent_family_handle_list(): new_person.add_parent_family_handle(item[0],item[1],item[2]) - if person.get_privacy(): return new_person @@ -373,6 +372,8 @@ def sanitize_person(db,person): ordinance = person.get_lds_sealing() if ordinance: new_person.set_lds_sealing(ordinance) + + new_person.set_note(person.get_note()) return new_person diff --git a/gramps2/src/data/main1.css b/gramps2/src/data/main1.css index e702348e8..7aa3aa594 100755 --- a/gramps2/src/data/main1.css +++ b/gramps2/src/data/main1.css @@ -89,6 +89,10 @@ A:active { color: #000; text-decoration: none; } +SUP { + line-height: 0; +} + /* Custom {{{1 */ diff --git a/gramps2/src/data/main2.css b/gramps2/src/data/main2.css index 65ecab69b..02a20ab8b 100755 --- a/gramps2/src/data/main2.css +++ b/gramps2/src/data/main2.css @@ -89,6 +89,9 @@ A:active { color: #000; text-decoration: none; } +SUP { + line-height: 0; +} /* Custom {{{1 */ diff --git a/gramps2/src/data/main3.css b/gramps2/src/data/main3.css index 4534bbf76..534eed576 100755 --- a/gramps2/src/data/main3.css +++ b/gramps2/src/data/main3.css @@ -88,6 +88,9 @@ A:active { text-decoration: none; } +SUP { + line-height: 0; +} /* Custom {{{1 */ diff --git a/gramps2/src/data/main4.css b/gramps2/src/data/main4.css index 743173048..4289a5ad5 100755 --- a/gramps2/src/data/main4.css +++ b/gramps2/src/data/main4.css @@ -97,6 +97,9 @@ A:active { text-decoration: none; } +SUP { + line-height: 0; +} /* Custom {{{1 */ diff --git a/gramps2/src/data/main5.css b/gramps2/src/data/main5.css index cc1c9bc90..34a52dbf5 100755 --- a/gramps2/src/data/main5.css +++ b/gramps2/src/data/main5.css @@ -96,6 +96,9 @@ A:active { text-decoration: none; } +SUP { + line-height: 0; +} /* Custom {{{1 */ diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 9d2e272dd..7f487a217 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -72,11 +72,11 @@ _NARRATIVE = "narrative.css" _NAME_COL = 3 _css_files = [ - [_("Style 1"), 'main1.css'], - [_("Style 2"), 'main2.css'], - [_("Style 3"), 'main3.css'], - [_("Style 4"), 'main4.css'], - [_("Style 5"), 'main5.css'], + [_("Modern"), 'main1.css'], + [_("Business"), 'main2.css'], + [_("Certificate"),'main3.css'], + [_("Antique"), 'main4.css'], + [_("Tranquil"), 'main5.css'], ] _character_sets = [ @@ -246,7 +246,6 @@ class BasePage: return format = noteobj.get_format() text = noteobj.get() - if text: of.write('

%s

\n' % _('Narrative')) of.write('
\n') @@ -268,7 +267,8 @@ class BasePage: for url in urllist: uri = url.get_path() descr = url.get_description() - of.write('%d. %s' % (index,uri,descr)) + of.write('%d.' % index) + of.write('%s' % (uri,descr)) of.write('\n') index = index + 1 of.write('\n') @@ -431,9 +431,10 @@ class PlacePage(BasePage): of.write('\n') - of.write('\n' % _('GRAMPS ID')) - of.write('\n' % place.gramps_id) - of.write('\n') + if not self.noid: + of.write('\n' % _('GRAMPS ID')) + of.write('\n' % place.gramps_id) + of.write('\n') if place.main_loc: ml = place.main_loc @@ -509,9 +510,10 @@ class MediaPage(BasePage): of.write('
%s%s
%s%s
\n') - of.write('\n' % _('GRAMPS ID')) - of.write('\n' % photo.gramps_id) - of.write('\n') + if not self.noid: + of.write('\n' % _('GRAMPS ID')) + of.write('\n' % photo.gramps_id) + of.write('\n') of.write('\n' % _('MIME type')) of.write('\n' % photo.mime) of.write('\n') @@ -913,6 +915,7 @@ class IndividualPage(BasePage): get_researcher().get_name()) self.display_ind_general(of) self.display_ind_events(of) + self.display_ind_parents(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()) @@ -933,14 +936,14 @@ class IndividualPage(BasePage): index = 1 for sref in sreflist: - - if self.src_list.has_key(sref.get_base_handle()): - if self.person.handle not in self.src_list[sref.get_base_handle()]: - self.src_list[sref.get_base_handle()].append(self.person.handle) + shandle = sref.get_base_handle() + if self.src_list.has_key(shandle): + if self.person.handle not in self.src_list[shandle]: + self.src_list[shandle].append(self.person.handle) else: - self.src_list[sref.get_base_handle()] = [self.person.handle] + self.src_list[shandle] = [self.person.handle] - source = self.db.get_source_from_handle(sref.get_base_handle()) + source = self.db.get_source_from_handle(shandle) title = source.get_title() of.write('' % (index,index)) of.write('\n' % _('GRAMPS ID')) - of.write('\n' % self.person.gramps_id) - of.write('\n') + if not self.noid: + 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(): @@ -1083,7 +1087,20 @@ class IndividualPage(BasePage): of.write('\n') of.write('
%s%s
%s%s
%s%s
%d.' % (source.handle,self.ext)) @@ -1011,9 +1014,10 @@ class IndividualPage(BasePage): of.write('border="0">\n') # GRAMPS ID - of.write('
%s%s
%s%s
\n') - def display_parent(self,of,handle,title): + def display_child_link(self, of, child_handle): + use_link = child_handle in self.ind_list + child = self.db.get_person_from_handle(child_handle) + gid = child.get_gramps_id() + if use_link: + of.write('' % (child.handle,self.ext)) + of.write(_nd.display(child)) + if not self.noid: + of.write(' [%s]' % gid) + if use_link: + of.write('\n') + of.write(u"
\n") + + def display_parent(self, of, handle, title, rel): use_link = handle in self.ind_list person = self.db.get_person_from_handle(handle) of.write('%s\n' % title) @@ -1096,62 +1113,78 @@ class IndividualPage(BasePage): of.write(' [%s]' % (val)) if use_link: of.write('') + if rel != RelLib.Person.CHILD_REL_BIRTH: + of.write('   (%s)' % const.child_rel_list[rel]) of.write('\n') - def display_ind_relationships(self,of): + def display_ind_parents(self,of): parent_list = self.person.get_parent_family_handle_list() - family_list = self.person.get_family_handle_list() - if not parent_list and not family_list: + if not parent_list: return - of.write('

%s

\n' % _("Relationships")) + of.write('

%s

\n' % _("Parents")) of.write('
\n') of.write('\n') + first = True if parent_list: for (family_handle,mrel,frel) in parent_list: family = self.db.get_family_from_handle(family_handle) - - of.write('\n') - of.write('\n' % _("Parents")) + + if not first: + of.write('\n') + else: + first = False father_handle = family.get_father_handle() if father_handle: - self.display_parent(of,father_handle,_('Father')) - of.write('\n') + self.display_parent(of,father_handle,_('Father'),frel) + of.write('\n') mother_handle = family.get_mother_handle() if mother_handle: - self.display_parent(of,mother_handle,_('Mother')) + self.display_parent(of,mother_handle,_('Mother'),mrel) of.write('\n') - of.write('\n') - - if family_list: - of.write('\n' % _("Spouses")) - first = True - for family_handle in family_list: - family = self.db.get_family_from_handle(family_handle) - self.display_spouse(of,family,first) first = False childlist = family.get_child_handle_list() - if childlist: - of.write('\n') - of.write('\n' % _("Children")) + if len(childlist) > 1: + of.write('\n') + of.write('\n' % _("Siblings")) of.write('\n\n') + of.write('\n') + of.write('
 
%s
 
 
 
%s
 %s
%s\n') for child_handle in childlist: - use_link = child_handle in self.ind_list - child = self.db.get_person_from_handle(child_handle) - gid = child.get_gramps_id() - if use_link: - of.write('' % (child.handle,self.ext)) - of.write(_nd.display(child)) - if not self.noid: - of.write(' [%s]' % gid) - if use_link: - of.write('\n') - of.write(u"
\n") + if child_handle != self.person.handle: + self.display_child_link(of,child_handle) of.write('
 
\n') + + def display_ind_relationships(self,of): + family_list = self.person.get_family_handle_list() + + if not family_list: + return + + of.write('

%s

\n' % _("Families")) + of.write('
\n') + of.write('\n') + + first = True + for family_handle in family_list: + family = self.db.get_family_from_handle(family_handle) + rtype = const.family_relations[family.get_relationship()][0] + of.write('\n' % rtype) + self.display_spouse(of,family,first) + first = False + childlist = family.get_child_handle_list() + if childlist: + of.write('\n') + of.write('\n' % _("Children")) + of.write('\n\n') of.write('
%s
 %s\n') + for child_handle in childlist: + self.display_child_link(of,child_handle) + of.write('
\n') def display_spouse(self,of,family,first=True): @@ -1248,19 +1281,21 @@ class IndividualPage(BasePage): else: self.place_list[place_handle] = [self.person.handle] - place = '%s' % (place_handle,self.ext,ReportUtils.place_name(self.db,place_handle)) + place = '%s' % (place_handle,self.ext,ReportUtils.place_name(self.db,place_handle)) + else: + place = u"" date = _dd.display(event.get_date_object()) tmap = {'description' : descr, 'date' : date, 'place' : place} if descr and date and place: - text = _('%(description)s,    %(date)s    at    %(place)s') % tmap + text = _('%(description)s,  %(date)s  at  %(place)s') % tmap elif descr and date: - text = _('%(description)s,    %(date)s   ') % tmap + text = _('%(description)s,  %(date)s  ') % tmap elif descr: text = descr elif date and place: - text = _('%(date)s    at    %(place)s') % tmap + text = _('%(date)s  at  %(place)s') % tmap elif date: text = date elif place: