diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 5e4b532f2..9df625cb2 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-02-03 Don Allingham + * src/plugins/NavWebPage.py: more progress + 2005-02-02 Don Allingham * src/plugins/GraphViz.py: fix MALE/FEMALE/UNKNOWN diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 92603ca65..348599107 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -60,6 +60,210 @@ import BaseDoc import NameDisplay import ReportUtils +_css = [ + 'BODY {', + 'font-family: "Arial", "Helvetica", sans-serif;', + 'letter-spacing: 0.05em;', + 'background-color: #fafaff;', + 'color: #003;', + '}', + '', + 'P,BLOCKQUOTE {', + 'font-size: 14px;', + '}', + '', + 'DIV {', + 'margin: 2px;', + 'padding: 2px;', + '}', + '', + 'TD {', + 'vertical-align: top;', + '}', + '', + 'H1 {', + 'font-family: "Verdana", "Bistream Vera Sans", "Arial", "Helvetica", sans-serif;', + 'font-weight: bolder;', + 'font-size: 160%;', + 'margin: 2px;', + '}', + 'H2 {', + 'font-family: "Verdana", "Bistream Vera Sans", "Arial", "Helvetica", sans-serif;', + 'font-weight: bolder;', + 'font-style: italic;', + 'font-size: 150%;', + '}', + 'H3 {', + 'font-weight: bold;', + 'margin: 0;', + 'padding-top: 10px;', + 'padding-bottom: 10px;', + 'color: #336;', + '}', + 'H4 {', + 'margin-top: 1em;', + 'margin-bottom: 0.3em;', + 'padding-left: 4px;', + 'background-color: #667;', + 'color: #fff;', + '}', + 'H5 {', + 'margin-bottom: 0.5em;', + '}', + 'H6 {', + 'font-weight: normal;', + 'font-style: italic;', + 'font-size: 100%;', + 'margin-left: 1em;', + 'margin-top: 1.3em;', + 'margin-bottom: 0.8em;', + '}', + '', + 'HR {', + 'height: 0;', + 'width: 0;', + 'margin: 0;', + 'margin-top: 1px;', + 'margin-bottom: 1px;', + 'padding: 0;', + 'border-top: 0; /* Hack: Mozilla work-around to eliminate "groove" */', + 'border-color: #e0e0e9;', + '}', + '', + 'A:link {', + 'color: #006;', + 'text-decoration: underline;', + '}', + 'A:visited {', + 'color: #669;', + 'text-decoration: underline;', + '}', + 'A:hover {', + 'background-color: #eef;', + 'color: #000;', + 'text-decoration: underline;', + '}', + 'A:active {', + 'background-color: #eef;', + 'color: #000;', + 'text-decoration: none;', + '}', + '', + '/* Custom {{{1', + '*/', + '', + '.navheader {', + 'padding: 4px;', + 'background-color: #e0e0e9;', + 'margin: 2px;', + '}', + '.navtitle {', + 'font-size: 160%;', + 'color: #669;', + 'margin: 2px;', + '', + '}', + '.navbyline {', + 'float: right;', + 'font-size: 14px;', + 'margin: 2px;', + 'padding: 4px;', + '}', + '.nav {', + 'margin: 0;', + 'margin-bottom: 4px;', + 'padding: 0;', + 'font-size: 14px;', + 'font-weight: bold;', + '', + '', + '', + '}', + '', + '', + '.summaryarea {', + 'min-height: 100px;', + '/* Hack: IE Dynamic Expression to set the width */', + 'height: expression(document.body.clientHeight < 1 ? "100px" : "100px" );', + '}', + '', + '.portrait {', + 'justify: center;', + 'margin: 5px;', + 'margin-right: 20px;', + 'padding: 3px;', + 'border-color: #336;', + 'border-width: 1px;', + '}', + '.snapshot {', + 'float: right;', + 'margin: 5px;', + 'margin-right: 20px;', + 'padding: 3px;', + '}', + '.thumbnail {', + 'height: 100px;', + 'border-color: #336;', + 'border-width: 1px;', + '}', + '', + '.leftwrap {', + 'float: left;', + 'margin: 2px;', + 'margin-right: 10px;', + '}', + '.rightwrap {', + 'float: right;', + 'margin: 2px;', + 'margin-left: 10px;', + '}', + '', + 'TABLE.infolist {', + 'border: 0;', + '/*width: 100%;*/', + 'font-size: 14px;', + '}', + 'TD.category {', + 'padding: 3px; /* Defines spacing between rows */', + 'padding-right: 3em;', + '/*width: 10%;*/', + 'font-weight: bold;', + '}', + 'TD.field {', + 'padding: 3px; /* Defines spacing between rows */', + 'padding-right: 3em;', + '/*width: 15%;*/', + '', + '}', + 'TD.data {', + 'padding: 3px; /* Defines spacing between rows */', + 'padding-right: 3em;', + 'font-weight: bold;', + '}', + '', + '', + '.pedigree {', + 'margin: 0;', + 'margin-left: 2em;', + 'padding: 0;', + 'background-color: #e0e0e9;', + 'border: 1px;', + '}', + '.pedigreeind {', + 'font-size: 14px;', + 'margin: 0;', + 'padding: 2em;', + 'padding-top: 0.25em;', + 'padding-bottom: 0.5em;', + '}', + '', + '', + '.footer {', + 'margin: 1em;', + 'font-size: 12px;', + 'float: right;', + '}', + ] #------------------------------------------------------------------------ # # @@ -77,22 +281,114 @@ class IndividualPage: self.person = person self.db = db self.ind_list = ind_list + self.dirpath = dirpath gramps_id = self.person.get_gramps_id() - author = db.get_researcher().get_name() - sort_name = NameDisplay.displayer.sorted(self.person) + self.sort_name = NameDisplay.displayer.sorted(self.person) + self.name = NameDisplay.displayer.sorted(self.person) self.f = open(os.path.join(dirpath,"%s.html" % gramps_id), "w") - self.f.write('\n') + self.f.write('\n') self.f.write('\n') self.f.write('\n') self.f.write('My Family Tree\n') self.f.write('\n') - self.f.write('\n') + self.f.write('\n') self.f.write('\n') self.f.write('\n') self.f.write('\n') + + self.display_header() + self.display_general() + self.display_events() + self.display_relationships() + self.display_narrative() + self.display_sources() + self.display_pedigree() + self.display_footer() + + self.f.write('\n') + self.f.write('\n') + self.f.close() + + def display_sources(self): + self.f.write('

Sources

\n') + self.f.write('
\n') + + self.f.write('\n') + self.f.write('\n') + self.f.write('\n') + self.f.write('\n') + self.f.write('\n') + self.f.write('\n') + self.f.write('
1. Author, Title, Publisher, Date.
2. Author, Title, Publisher, Date.
3. Author, Title, Publisher, Date.
4. Author, Title, Publisher, Date.
5. Author, Title, Publisher, Date.
\n') + + def display_pedigree(self): + + parent_handle_list = self.person.get_parent_family_handle_list() + if parent_handle_list: + (parent_handle, mrel,frel) = parent_handle_list[0] + family = self.db.get_family_from_handle(parent_handle) + father_id = family.get_father_handle() + mother_id = family.get_mother_handle() + mother = self.db.get_person_from_handle(mother_id) + father = self.db.get_person_from_handle(father_id) + else: + family = None + father = None + mother = None + + self.f.write('

Pedigree

\n') + self.f.write('
\n') + self.f.write('\n') + self.f.write('
\n') + self.f.write('\n') + self.f.write('\n') + self.f.write('\n') + self.f.write('\n') + self.f.write('
\n') + if father or mother: + self.f.write('
\n') + if father: + self.pedigree_person(father) + if mother: + self.pedigree_person(mother) + self.f.write('
\n') + if family: + for child_handle in family.get_child_handle_list(): + if child_handle == self.person.handle: + self.f.write('| %s
\n' % self.name) + self.pedigree_family() + else: + child = self.db.get_person_from_handle(child_handle) + self.pedigree_person(child) + else: + self.f.write('| %s
\n' % self.name) + self.pedigree_family() + +# self.f.write('• Spouse 1
\n') +# self.f.write('
\n') +# self.f.write('| Child
\n') +# self.f.write('| Child
\n') +# self.f.write('
\n') +# self.f.write('• Spouse 2
\n') +# self.f.write('
\n') +# self.f.write('| Child
\n') +# self.f.write('| Child
\n') +# self.f.write('
\n') +# self.f.write('| Sybling, Younger
\n') +# self.f.write('| Sybling, Younger
\n') + + self.f.write('
\n') + if father or mother: + self.f.write('
\n') + self.f.write('
\n') + + def display_header(self): + author = self.db.get_researcher().get_name() self.f.write('