From 85db1564bb3406df784c6a66cc09c3d8d2155052 Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Wed, 14 Sep 2011 11:41:26 +0000 Subject: [PATCH] 5029: again, add attribute table in family infolist table cell svn: r18162 --- src/plugins/webreport/NarrativeWeb.py | 87 +++++++------------------- src/plugins/webstuff/css/Web_Mainz.css | 3 + 2 files changed, 24 insertions(+), 66 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index f03691e38..072db0ebd 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -425,13 +425,13 @@ class BasePage(object): # display attribute list trow.extend( - Html("td", data or " ", class_ = colclass, - inline = True if (colclass == "Type" or "ColumnSources") else False) + Html("td", data or " ", class_ = "Column" + colclass, + inline = True if (colclass == "Type" or "Sources") else False) 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()) ] ] + ["Notes", self.dump_notes(attr.get_note_list()) ], + ["Sources", self.get_citation_links(attr.get_source_references()) ] ] ) # return table row to its caller @@ -1020,7 +1020,7 @@ class BasePage(object): """ # begin attributes division and section title with Html("div", class_ = "subsection", id ="attributes") as section: - section += Html("h4", _("Attributes"), inline =True) + section += Html("h4", AHEAD, inline =True) # begin attributes table with Html("table", class_ = "infolist attrlist") as table: @@ -1052,66 +1052,10 @@ class BasePage(object): tbody = Html("tbody") tbody.extend( - self.dump_attribute(attr) - for attr in attrlist + self.dump_attribute(attr) for attr in attrlist ) return tbody - 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... @@ -3212,7 +3156,7 @@ class MediaPage(BasePage): attrlist = media.get_attribute_list() if attrlist: section, table = self.display_attribute_header() - mediadetail ++ section + mediadetail += section table += self.display_attr_list(attrlist) @@ -5252,9 +5196,20 @@ class IndividualPage(BasePage): ) table += trow - attrlist = family.get_attribute_list() - if attrlist: - section += self.display_family_attr_list(attrlist) + attrlist = family.get_attribute_list() + if attrlist: + trow = Html("tr") + ( + Html("td", " ", class_ = "ColumnType", + inline = True), + Html("td", AHEAD, class_ = "ColumnAttribute", + inline = True) + ) + table += trow + tcell = Html("td", class_ = "ColumnValue") + trow += tcell + dummy, attrtable = self.display_attribute_header() + tcell += attrtable + attrtable += self.display_attr_list(attrlist) # return section to its caller return section diff --git a/src/plugins/webstuff/css/Web_Mainz.css b/src/plugins/webstuff/css/Web_Mainz.css index 5cffff99a..09ea432d5 100644 --- a/src/plugins/webstuff/css/Web_Mainz.css +++ b/src/plugins/webstuff/css/Web_Mainz.css @@ -409,6 +409,9 @@ div#families table.fixed_subtables table.eventlist th:first-child { div#families table.fixed_subtables table.eventlist th:last-child { width: 5em; } +div#families table.attrlist td.ColumnType { + color: #7D5925; +} /* SubSection : Gallery -----------------------------------------------------------------*/