Fixed attributes on IndividualPage and EventPage. Stylesheet to match.

svn: r13211
This commit is contained in:
Rob G. Healey 2009-09-16 06:39:18 +00:00
parent 573c9fdc20
commit 60abf87026
2 changed files with 81 additions and 81 deletions

View File

@ -205,6 +205,10 @@ span.preposition {
background-color: #542; background-color: #542;
border-bottom: solid 8px #5D835F; border-bottom: solid 8px #5D835F;
} }
body#WebCal #header, body#fullyearlinked #header {
width: 100%;
height; 90px;
}
#SiteTitle { #SiteTitle {
margin:0; margin:0;
padding:.5em 0 0.5em 10px; padding:.5em 0 0.5em 10px;
@ -324,7 +328,7 @@ div#alphabet ul li.letters a:hover {
} }
body#WebCal #navigation, body#fullyearlinked #navigation { body#WebCal #navigation, body#fullyearlinked #navigation {
width: 100%; width: 100%;
height: 42px; height: 52px;
} }
#subnavigation { #subnavigation {
width: 100%; width: 100%;
@ -629,10 +633,6 @@ div#EventList, div#EventDetail { }
div#events table.eventlist { div#events table.eventlist {
margin-top: .3cm; margin-top: .3cm;
} }
table.eventlist thead tr th {
font-weight: bold;
text-transform: uppercase;
}
table.eventlist tbody tr { table.eventlist tbody tr {
border-bottom: solid 1px #5D835F; border-bottom: solid 1px #5D835F;
} }
@ -657,7 +657,6 @@ table.eventlist tbody tr td.ColumnSources {
width: 12%; width: 12%;
} }
table.eventlist tbody tr td.ColumnNotes { table.eventlist tbody tr td.ColumnNotes {
background-color: #FFF;
width: 25%; width: 25%;
} }
table.eventlist tbody tr td.ColumnPerson { table.eventlist tbody tr td.ColumnPerson {
@ -1016,6 +1015,10 @@ table.attrlist tbody tr td.ColumnSources {
table.attrlist tbody tr td.ColumnNotes { table.attrlist tbody tr td.ColumnNotes {
width: 400px; width: 400px;
} }
div#attributes table.attrlist tbody tr td.ColumnNotes {
width: 400px;
background-color: #D8F3D6;
}
/* Subsections : Parents /* Subsections : Parents
----------------------------------------------------- */ ----------------------------------------------------- */

View File

@ -256,64 +256,41 @@ class BasePage(object):
self.linkhome = report.options['linkhome'] self.linkhome = report.options['linkhome']
self.create_media = report.options['gallery'] self.create_media = report.options['gallery']
def dump_attributes(self, attrlist, showsrc): def dump_attribute(self, attr, showsrc):
""" """
dump attribute for object presented in display_attr_list() dump attribute for object presented in display_attr_list()
@param: attrlist = attribute object list @param: attr = attribute object
@param: showsrc = show source references or not? @param: showsrc = show source references or not?
""" """
# begin attributes table trow = Html("tr")
with Html("table", class_ = "infolist attrlist") as table:
thead = Html("thead") attr_data_row = [
table += thead ("Type", attr.get_type().xml_str() ),
("Value", attr.get_value() ) ]
trow = Html("tr") if showsrc:
thead += trow srcrefs = self.get_citation_links(attr.get_source_references() )
source_row = ("Sources", srcrefs)
attr_header_row = [ attr_data_row.append(source_row)
[THEAD, 'Type'],
[VHEAD, 'Value'],
[SHEAD, 'Sources'],
[NHEAD, 'Notes'] ]
for (label, colclass) in attr_header_row:
trow += Html("th", label, class_ = "Column%s" % colclass, inline = True)
# begin table body
tbody = Html("tbody")
table += tbody
for attr in attrlist:
trow = Html("tr")
tbody += trow
attr_data_row = [
[str(attr.get_type() ) ],
[attr.get_value() ] ]
if showsrc:
source_row = self.get_citation_links(attr.get_source_references())
attr_data_row.append(source_row)
attr_data_row.append(self.dump_notes(attr.get_note_list() ) ) # get attribute note list
notelist = attr.get_note_list()
notelist = self.display_note_list(notelist) or " "
note_row = ("Notes", notelist)
attr_data_row.append(note_row)
index = 0 # display attribute list
for value in attr_data_row: for (colclass, value) in attr_data_row:
colclass = attr_header_row[index][1]
# determine if same row or not? # determine if same row or not?
samerow = True if (value[0] == " " or colclass == "Type") else False samerow = True if (colclass == "Type" or "Sources") else False
trow += Html("td", value[0], class_ = "Column%s" % colclass, trow += Html("td", value, class_ = "Column%s" % colclass, inline = samerow)
inline = samerow)
index += 1
# return table to its callers # return table row to its caller
return table return trow
def get_citation_links(self, source_ref_list): def get_citation_links(self, source_ref_list):
self.bibli = Bibliography() self.bibli = Bibliography()
@ -836,8 +813,32 @@ class BasePage(object):
with Html("div", class_ = "ubsection", id="attributes") as section: with Html("div", class_ = "ubsection", id="attributes") as section:
section += Html('h4', _('Attributes'), inline = True) section += Html('h4', _('Attributes'), inline = True)
# add returned table to section # begin attributes table
section += self.dump_attributes(attrlist, showsrc) with Html("table", class_ = "infolist attrlist") as table:
section += table
thead = Html("thead")
table += thead
trow = Html("tr")
thead += trow
for (label, colclass) in [
(THEAD, "Type"),
(VHEAD, "Value"),
(SHEAD, "Sources"),
(NHEAD, "Notes") ]:
trow += Html("th", label, class_ = "Column%s" % colclass, inline = True)
# begin table body
tbody = Html("tbody")
table += tbody
for attr in attrlist:
tbody += self.dump_attribute(attr, showsrc)
# return section to its caller # return section to its caller
return section return section
@ -2206,9 +2207,8 @@ class EventPage(BasePage):
# Narrative subsection # Narrative subsection
if shownote: if shownote:
notelist = event_data[(len(event_data) - 1)][2] or None notelist = event_data[(len(event_data) - 1)][2]
if notelist is not None: eventdetail += self.display_note_list(notelist)
eventdetail += self.display_note_list(notelist)
# get attribute list # get attribute list
attrlist = event.get_attribute_list() attrlist = event.get_attribute_list()
@ -2522,17 +2522,13 @@ class MediaPage(BasePage):
################################################# #################################################
# get media notes # get media notes
notes = self.display_note_list(photo.get_note_list()) notelist = photo.get_note_list()
if notes is not None: if notelist:
mediadetail += notes mediadetail += self.display_note_list(notelist)
# get attribute list # get attribute list
attributes = photo.get_attribute_list() attrlist = photo.get_attribute_list()
if attributes: mediadetail += self.display_attr_list(attrlist, False)
attrlist = []
for attr in attributes:
attrlist.append(attr)
mediadetail += self.display_attr_list(attrlist, False)
# get media sources # get media sources
sources = self.display_media_sources(photo) sources = self.display_media_sources(photo)
@ -3310,31 +3306,26 @@ class IndividualPage(BasePage):
if sect2 is not None: if sect2 is not None:
individualdetail += sect2 individualdetail += sect2
# display attributes # display parents
sect3 = self.display_attr_list(attribute_list, True) sect3 = self.display_ind_parents()
if sect3 is not None: if sect3 is not None:
individualdetail += sect3 individualdetail += sect3
# display parents # display relationships
sect4 = self.display_ind_parents() sect4 = self.display_ind_families()
if sect4 is not None: if sect4 is not None:
individualdetail += sect4 individualdetail += sect4
# display relationships # display LDS ordinance
sect5 = self.display_ind_families() sect5 = self.display_lds_ordinance(person)
if sect5 is not None: if sect5 is not None:
individualdetail += sect5 individualdetail += sect5
# display LDS ordinance # display address(es)
sect6 = self.display_lds_ordinance(person) sect6 = self.display_addresses()
if sect6 is not None: if sect6 is not None:
individualdetail += sect6 individualdetail += sect6
# display address(es)
sect7 = self.display_addresses()
if sect7 is not None:
individualdetail += sect7
media_list = [] media_list = []
photo_list = self.person.get_media_list() photo_list = self.person.get_media_list()
if len(photo_list) > 1: if len(photo_list) > 1:
@ -3351,12 +3342,18 @@ class IndividualPage(BasePage):
media_list += event.get_media_list() media_list += event.get_media_list()
# display additional images as gallery # display additional images as gallery
sect8 = self.display_additional_images_as_gallery(media_list) sect7 = self.display_additional_images_as_gallery(media_list)
if sect7 is not None:
individualdetail += sect7
# display Narrative
notelist = person.get_note_list()
sect8 = self.display_note_list(notelist)
if sect8 is not None: if sect8 is not None:
individualdetail += sect8 individualdetail += sect8
# display notes # display attributes
sect9 = self.display_note_list(self.person.get_note_list()) sect9 = self.display_attr_list(attribute_list, True)
if sect9 is not None: if sect9 is not None:
individualdetail += sect9 individualdetail += sect9