From 11de3759f76d734479fe723dd9f20e5e459072ec Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Tue, 13 Sep 2011 03:26:38 +0000 Subject: [PATCH] Bug#5029-- Attributes in Websites; Moved Family ttributes into IndidivudalPage: Families: Attributes. svn: r18158 --- src/plugins/webreport/NarrativeWeb.py | 84 ++++++++++++++----- src/plugins/webstuff/css/Web_Basic-Ash.css | 29 +++++++ src/plugins/webstuff/css/Web_Basic-Blue.css | 29 +++++++ .../webstuff/css/Web_Basic-Cypress.css | 29 +++++++ src/plugins/webstuff/css/Web_Basic-Lilac.css | 29 +++++++ src/plugins/webstuff/css/Web_Basic-Peach.css | 29 +++++++ src/plugins/webstuff/css/Web_Basic-Spruce.css | 29 +++++++ src/plugins/webstuff/css/Web_Mainz.css | 29 +++++++ src/plugins/webstuff/css/Web_Nebraska.css | 29 +++++++ .../webstuff/css/Web_Print-Default.css | 29 +++++++ src/plugins/webstuff/css/Web_Visually.css | 29 +++++++ 11 files changed, 352 insertions(+), 22 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 1016f5831..7e2ba7933 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -1105,6 +1105,61 @@ class BasePage(object): # return section to its caller return section + def display_family_attr_list(self, attrlist): + """ + format for family attribute list is different than all the others + """ + with Html("div", class_ ="subsection", id ="attributes") as section: + with Html("table", class_ ="infolist attributes") as table: + section += table + + thead = Html("thead") + table += thead + + # for proper spacing... + trow = Html("tr") + thead += trow + + trow.extend( + Html("th", label, class_ =colclass, inline =True) + for label, colclass in [ + (' ', "ColumnType"), + (' ', "ColumnAttribute"), + (_("Type"), "Type"), + (_("Value"), "Value"), + (_("Notes"), "Notes"), + (_("Sources"), "Sources") + ] + ) + tbody = Html("tbody") + table += tbody + + first_row = True + for attr in attrlist: + if first_row: + trow = Html("tr") + ( + Html("td", ' ', class_ ="ColumnType", inline =True), + Html("td", _("Attributes"), class_ ="ColumnAttribute", inline =True) + ) + else: + trow = Html("tr") + ( + Html("td", ' ', class_ ="ColumnType", inline =True), + Html("td", ' ', class_ ="ColumnAttribute", inline =True) + ) + tbody += trow + + trow.extend( + Html("td", data or " ", class_ =colclass, inline =True) + for colclass, data in [ + ("Type", str(attr.get_type()) ), + ("Value", attr.get_value() ), + ("ColumnNotes", self.dump_notes(attr.get_note_list()) ), + ("ColumnSources", self.get_citation_links(attr.get_source_references()) ) + ] + ) + first_row = False + return section + def write_footer(self): """ Will create and display the footer section of each page... @@ -1934,6 +1989,10 @@ class BasePage(object): ) table += trow + attrlist = family.get_attribute_list() + if attrlist: + section += self.display_family_attr_list(attrlist) + # return section to its caller return section @@ -4643,7 +4702,7 @@ class IndividualPage(BasePage): gen.lib.Person.UNKNOWN : _('unknown'), } - def __init__(self, report, title, person, ind_list, place_list, src_list, attribute_list): + def __init__(self, report, title, person, ind_list, place_list, src_list): BasePage.__init__(self, report, title, person.gramps_id) self.person = person self.ind_list = ind_list @@ -4732,7 +4791,7 @@ class IndividualPage(BasePage): individualdetail += sect8 # display attributes - sect9 = self.display_attr_list(attribute_list) + sect9 = self.display_attr_list(self.person.get_attribute_list()) if sect9 is not None: individualdetail += sect9 @@ -6526,22 +6585,6 @@ class NavWebReport(Report): fdir, fname = os.path.split(from_path) self.copy_file(from_path, fname, "images") - def build_attributes(self, person): - """ - build a list of attributes for each person - """ - # get personal attributes - attribute_list = person.get_attribute_list() - - for family_handle in person.get_family_handle_list(): - family = self.database.get_family_from_handle(family_handle) - - # get family attributes - attribute_list.extend(family.get_attribute_list() ) - - # return attributes to its caller - return attribute_list - def person_pages(self, ind_list, place_list, source_list): """ creates IndividualListPage, IndividualPage, and gendex page @@ -6557,10 +6600,7 @@ class NavWebReport(Report): self.progress.step() person = self.database.get_person_from_handle(person_handle) - # get attributes for each person - attribute_list = self.build_attributes(person) - - IndividualPage(self, self.title, person, ind_list, place_list, source_list, attribute_list) + IndividualPage(self, self.title, person, ind_list, place_list, source_list) if self.inc_gendex: self.progress.set_pass(_('Creating GENDEX file'), len(ind_list)) diff --git a/src/plugins/webstuff/css/Web_Basic-Ash.css b/src/plugins/webstuff/css/Web_Basic-Ash.css index c9895a1f3..27657942a 100644 --- a/src/plugins/webstuff/css/Web_Basic-Ash.css +++ b/src/plugins/webstuff/css/Web_Basic-Ash.css @@ -470,6 +470,35 @@ table.individuallist tbody tr td.ColumnName a:hover { margin-left:20px; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Sources ----------------------------------------------------- */ #Sources table.infolist tbody tr td.ColumnRowLabel { diff --git a/src/plugins/webstuff/css/Web_Basic-Blue.css b/src/plugins/webstuff/css/Web_Basic-Blue.css index 836202949..0bfcbe6e7 100644 --- a/src/plugins/webstuff/css/Web_Basic-Blue.css +++ b/src/plugins/webstuff/css/Web_Basic-Blue.css @@ -1079,6 +1079,35 @@ table.attrlist tbody tr td.ColumnSources { width: 10%; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Subsections : Parents ----------------------------------------------------- */ div#parents { diff --git a/src/plugins/webstuff/css/Web_Basic-Cypress.css b/src/plugins/webstuff/css/Web_Basic-Cypress.css index f8b7149a4..cb30d13a8 100644 --- a/src/plugins/webstuff/css/Web_Basic-Cypress.css +++ b/src/plugins/webstuff/css/Web_Basic-Cypress.css @@ -467,6 +467,35 @@ table.individuallist tbody tr td.ColumnName a:hover { margin-left:20px; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Sources ----------------------------------------------------- */ #Sources table.infolist tbody tr td.ColumnRowLabel { diff --git a/src/plugins/webstuff/css/Web_Basic-Lilac.css b/src/plugins/webstuff/css/Web_Basic-Lilac.css index 6763a1d04..16cded625 100644 --- a/src/plugins/webstuff/css/Web_Basic-Lilac.css +++ b/src/plugins/webstuff/css/Web_Basic-Lilac.css @@ -468,6 +468,35 @@ table.individuallist tbody tr td.ColumnName a:hover { margin-left:20px; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Sources ----------------------------------------------------- */ #Sources table.infolist tbody tr td.ColumnRowLabel { diff --git a/src/plugins/webstuff/css/Web_Basic-Peach.css b/src/plugins/webstuff/css/Web_Basic-Peach.css index 4f920e65f..4022afb26 100644 --- a/src/plugins/webstuff/css/Web_Basic-Peach.css +++ b/src/plugins/webstuff/css/Web_Basic-Peach.css @@ -469,6 +469,35 @@ table.individuallist tbody tr td.ColumnName a:hover { margin-left:20px; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Sources ----------------------------------------------------- */ #Sources table.infolist tbody tr td.ColumnRowLabel { diff --git a/src/plugins/webstuff/css/Web_Basic-Spruce.css b/src/plugins/webstuff/css/Web_Basic-Spruce.css index b46ebd40b..e24998a50 100644 --- a/src/plugins/webstuff/css/Web_Basic-Spruce.css +++ b/src/plugins/webstuff/css/Web_Basic-Spruce.css @@ -469,6 +469,35 @@ table.individuallist tbody tr td.ColumnName a:hover { margin-left:20px; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Sources ----------------------------------------------------- */ #Sources table.infolist tbody tr td.ColumnRowLabel { diff --git a/src/plugins/webstuff/css/Web_Mainz.css b/src/plugins/webstuff/css/Web_Mainz.css index c96105550..3f42e0d03 100644 --- a/src/plugins/webstuff/css/Web_Mainz.css +++ b/src/plugins/webstuff/css/Web_Mainz.css @@ -481,6 +481,35 @@ table.individuallist tbody tr td.ColumnName a { margin-left:20px; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Sources ----------------------------------------------------- */ #Sources table.infolist tbody tr td.ColumnRowLabel { diff --git a/src/plugins/webstuff/css/Web_Nebraska.css b/src/plugins/webstuff/css/Web_Nebraska.css index 0489223d4..d8dce51f8 100644 --- a/src/plugins/webstuff/css/Web_Nebraska.css +++ b/src/plugins/webstuff/css/Web_Nebraska.css @@ -459,6 +459,35 @@ table.individuallist tbody tr td.ColumnName a:hover { margin-left:20px; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Sources ----------------------------------------------------- */ #Sources { } diff --git a/src/plugins/webstuff/css/Web_Print-Default.css b/src/plugins/webstuff/css/Web_Print-Default.css index 393c8fc23..53fb03de3 100644 --- a/src/plugins/webstuff/css/Web_Print-Default.css +++ b/src/plugins/webstuff/css/Web_Print-Default.css @@ -486,6 +486,35 @@ body#ThumbnailPreview div#references table.infolist tbody tr td.ColumnName { padding:0; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ #pedigree a { diff --git a/src/plugins/webstuff/css/Web_Visually.css b/src/plugins/webstuff/css/Web_Visually.css index 1d2b5ee2b..49c720404 100644 --- a/src/plugins/webstuff/css/Web_Visually.css +++ b/src/plugins/webstuff/css/Web_Visually.css @@ -518,6 +518,35 @@ div#IndividualDetail div.subsection table tr td:first-child { text-decoration:underline; } +/* Subsections : Attributes +----------------------------------------------------- */ +div#attributes { + margin: 0; + padding: 0; +} +table.attrlist { + width: 100%; +} +table.attrlist thead tr th { + background-color: #70B1ED; + color: #000; +} +table.attrlist tbody tr td { + border-bottom: dashed 1px #000; +} +table.attrlist tbody tr td.ColumnType { + width: 15%; +} +table.attrlist tbody tr td.ColumnValue { + width: 15%; +} +table.attrlist tbody tr td.ColumnNotes { + width: 40%; +} +table.attrlist tbody tr td.ColumnSources { + width: 10%; +} + /* Relationships ================================================= */ #Relationships table.relationships tr td {