Bug#5029-- Attributes in Websites; Moved Family ttributes into IndidivudalPage: Families: Attributes.

svn: r18158
This commit is contained in:
Rob G. Healey 2011-09-13 03:26:38 +00:00
parent 269df644df
commit 11de3759f7
11 changed files with 352 additions and 22 deletions

View File

@ -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))

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 { }

View File

@ -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 {

View File

@ -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 {