diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 7e2ba7933..47cc09bf3 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -1109,6 +1109,9 @@ class BasePage(object): """ format for family attribute list is different than all the others """ + if not attrlist: + return None + with Html("div", class_ ="subsection", id ="attributes") as section: with Html("table", class_ ="infolist attributes") as table: section += table @@ -1979,23 +1982,90 @@ class BasePage(object): for birth_date, chandle in children ) - # family LDS ordinance list - famldslist = family.lds_ord_list - if famldslist: - trow = Html("tr") + ( - Html("td", " ", class_ = "ColumnType", inline = True), - Html("td", " ", class_ = "ColumnAttribute", inline = True), - Html("td", self.dump_ordinance(db, family, "Family"), class_ = "ColumnValue") - ) - table += trow + attrlist = self.display_family_attr_list(family.get_attribute_list()) + if attrlist is not None: + section += attrlist - attrlist = family.get_attribute_list() - if attrlist: - section += self.display_family_attr_list(attrlist) + ldsordlist = self.display_family_lds_ordinance(family.get_lds_ord_list()) + if ldsordlist is not None: + section += ldsordlist # return section to its caller return section + def display_family_lds_ordinance(self, family_lds_ord_list): + """ + creates family lds ordinance as it is formatted differently than dump_ordinance() in BasePage + """ + if not family_lds_ord_list: + return None + + with Html("div", class_ ="subsection", id ="LDSOrdinance") as section: + with Html("table", class_ ="infolist ldsordlist") as table: + section += table + + thead = Html("thead") + table += thead + + # add two blank cells for proper layout... + trow = Html("tr") + ( + Html("th", ' ', class_ ="ColumnType", inline =True), + Html("th", ' ', class_ ="ColumnAttribute", inline =True) + ) + thead += trow + + trow.extend( + Html("th", label, class_ =colclass, inline =True) + for label, colclass in [ + (_("Type"), "ColumnLDSType"), + (_("Date"), "ColumnLDSDate"), + (_("Temple"), "ColumnLDSTemple"), + (_("Place"), "ColumnLDSPlace"), + (_("Status"), "ColumnLDSStatus"), + (_("Sources"), "ColumnLDSSources") + ] + ) + tbody = Html("tbody") + table += tbody + + first_row = True + for ord in family_lds_ord_list: + place_hyper = " " + phandle = ord.get_place_handle() + if phandle: + place = self._dbase.get_place_from_handle(phandle) + if place: + place_hyper = self.place_link(phandle, place.get_title(), place.get_gramps_id(), True) + + trow = Html("tr") + tbody += trow + + tcell1 = Html("td", class_ ="ColumnType", inline =True) + tcell2 = Html("td", class_ ="ColumnAttribute", inline =True) + if first_row: + trow.attr = 'class ="BeginOrdinance"' + tcell1 += _("LDS") + tcell2 += _("Ordinance") + else: + tcell1 += ' ' + tcell2 += ' ' + trow += (tcell1, tcell2) + + trow.extend( + Html("td", value or " ", class_ =colclass, + inline = (not value or colclass == "LDSDate")) + for colclass, value in [ + ("ColumnLDSType", ord.type2xml() ), + ("ColumnLDSDate", _dd.display(ord.get_date_object()) ), + ("ColumnLDSTemple", ord.get_temple() ), + ("ColumnLDSPlace", place_hyper), + ("ColumnLDSStatus", ord.get_status() ), + ("ColumnLDSSources", self.get_citation_links(ord.get_source_references()) ) + ] + ) + first_row = False + return section + def display_partner(self, family, table, ppl_hnd_list): """ display an individual's partner diff --git a/src/plugins/webstuff/css/Web_Basic-Blue.css b/src/plugins/webstuff/css/Web_Basic-Blue.css index 0bfcbe6e7..af28958e4 100644 --- a/src/plugins/webstuff/css/Web_Basic-Blue.css +++ b/src/plugins/webstuff/css/Web_Basic-Blue.css @@ -1079,35 +1079,6 @@ 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 { @@ -1161,19 +1132,41 @@ div#families table.fixed_subtables table.eventlist th:last-child { width:5em; } +/* Subsection: Families: Attributes +------------------------------------------------- */ +div#IndividualDetail div#attributes table.attributes { + font: normal .8em sans-serif; +} +div#IndividualDetail div#attributes table.attributes thead tr th.ColumnType, +div#IndidivualDetail div#attributes table.attributes thead tr th.ColumnAttribute { + background: none; + border: none; +} +div#families div#attributes table.attributes thead tr th.ColumnAttribute { + background: none; + border: none; +} +div#families div#attributes table.attributes thead tr th.Type { + border-left: solid 1px #000; + width: 15%; +} + /* Subsection: LDS Ordinance ------------------------------------------------------ */ div#LDSOrdinance { - margin: 0; + margin: 0 auto; padding: 0; } div#LDSOrdinance table.ldsordlist { - font-size: .35cm; + font: normal .8em sans; } -table.ldsordlist { - margin-bottom: .5em; +div#IndividualDetail div#LDSOrdinance table.ldsordlist tbody tr td.ColumnType, +div#IndividualDetail div#LDSOrdinance table.ldsordlist tbody tr td.ColumnAttribute { + background: none; + border: none; } table.ldsordlist tbody tr td.ColumnLDSType { + border-left: solid 1px #000; width: 12%; } table.ldsordlist tbody tr td.ColumnLDSDate {