Fixed class EventList and EventPage. With it, display_attr_list(). Changed, added, and removed elements to match current work.

svn: r13160
This commit is contained in:
Rob G. Healey 2009-09-05 11:45:56 +00:00
parent 06458ae1d7
commit fa38bf99f8
2 changed files with 313 additions and 340 deletions

View File

@ -59,15 +59,10 @@ Females Web_Gender_Female.png
body {
color: #000;
margin: 0;
padding: 94px 0px 0px 0px;
background-color: #FFF;
font-family: Arial, sans, sans-serif, Helvetica;
}
body.location {
padding: 94px 0px 60px 0px;
}
body.nolocation {
padding: 94px 0px 0px 0px;
}
div {
margin:0;
padding:0;
@ -138,10 +133,10 @@ h3 {
}
h4 {
font:normal 1.2em/1.2em serif;
color: #FFF;
color:#FFF;
margin:0;
padding:.2em 0 .2em 20px;
background-color: #453619;
background-color:#453619;
border-bottom:solid 2px #6AF364;
}
h5, h6 {
@ -155,11 +150,11 @@ p#description {
padding:1em 20px;
}
p#description:first-letter {
color: #228A22;
color:#228A22;
font-size:xx-large;
}
p a {
color: #FFF;
color:#FFF;
text-decoration:underline;
}
sup {
@ -172,19 +167,21 @@ ol {
padding-top:.5em;
padding-bottom:0;
}
ol li a {
text-decoration:none;
}
ol li a:hover {
text-decoration:underline;
}
a {
color: #000;
text-decoration: none;
color:#542;
}
a:visited {
color: #000;
text-decoration: none;
color:#542;
}
a:hover {
padding: 2px 10px 2px 0;
display: block;
color: #000;
background-color: #C1B398;
color:#000;
background-color:#C1B398;
text-decoration:underline;
}
span.preposition {
@ -193,7 +190,7 @@ span.preposition {
}
.grampsid {
font:normal .8em/1.2em monospace;
color: #000;
color:#000;
}
/* Header
@ -212,13 +209,13 @@ span.preposition {
margin:0;
padding:.5em 0 0.5em 10px;
font-size: 40px;
color: #FFF;
color:#FFF;
font-style:italic;
}
p#user_header {
font-size:1.3em;
text-align:left;
color: #6AF364;
color:#6AF364;
margin:0;
padding:.2em 0 .6em 20px;
}
@ -228,6 +225,7 @@ p#user_header {
#footer {
width: 100%;
height: 60px;
overflow: auto;
clear: both;
font-size: 12px;
color: #FFF;
@ -235,19 +233,12 @@ p#user_header {
margin: 0;
border-top: solid 8px #5D835F;
}
.nolocation {
}
.location {
position: fixed;
bottom: 0;
overflow: auto;
}
#footer a, #footer a:visited {
text-decoration:none;
color: #FFF;
color:#FFF;
}
#footer a:hover {
color: #000;
color:#000;
text-decoration:underline;
}
#footer img {
@ -264,7 +255,7 @@ p#user_header {
#footer p#copyright {
float:right;
text-align:right;
color: #FFF;
color:#FFF;
margin: 10px 10px 0px 0px;
}
#footer p#copyright img {
@ -275,7 +266,7 @@ p#user_header {
width:70%;
float:left;
margin:1em;
color: #6AF364;
color:#6AF364;
}
#user_footer p {
font:normal 1em/1.2em serif;
@ -297,7 +288,7 @@ div#alphabet ul {
padding:0 0 0 9px;
border-top:solid 2px #000;
border-bottom:solid 4px #000;
background-color: #6AF364;
background-color:#6AF364;
}
div#alphabet ul li:after {
content:" |";
@ -313,14 +304,14 @@ div#alphabet ul li.letters a {
display:block;
float:left;
font:bold 16px/100% sans;
color: #000;
color:#000;
margin:0;
padding:5px 5px;
text-decoration:none;
}
div#alphabet ul li.letters a:hover {
background-color: #000;
color: #FFF;
background-color:#000;
color:#FFF;
}
/* Navigation
@ -335,7 +326,7 @@ div#alphabet ul li.letters a:hover {
height:32px;
margin:0;
padding:0 0 0 20px;
background-color: #FFF;
background-color:#FFF;
border-bottom:solid 2px #000;
}
#navigation ul li, #subnavigation ul li {
@ -346,15 +337,15 @@ div#alphabet ul li.letters a:hover {
display:block;
float:left;
font:normal 16px/100% serif;
color: #000;
color:#000;
text-decoration:none;
margin:0;
padding:5px 5px;
}
#navigation ul li a:hover, #subnavigation ul li a:hover {
background-color: #C1B398;
color: #000;
background-color:#C1B398;
color:#000;
border-top:solid 3px #C1B398;
border-bottom:solid 8px #C1B398;
}
@ -364,13 +355,13 @@ div#alphabet ul li.letters a:hover {
margin-top:-6px;
padding-top:11px;
padding-bottom:8px;
background-color: #CCC;
color: #000;
background-color:#CCC;
color:#000;
border-bottom:solid 4px #CCC;
}
#navigation ul li.CurrentSection a:hover {
background-color: #000;
color: #FFF;
background-color:#000;
color:#FFF;
}
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
@ -385,19 +376,31 @@ table.infolist {
}
table.infolist thead tr th {
font:normal 1.1em/1.2em serif;
color: #000;
color:#000;
margin:0;
padding:.2em 10px;
background-color: #6AF364;
border: solid 2px #5D835F;
background-color:#6AF364;
border: solid 1px #5D835F;
}
table.infolist thead tr th a {
background-color:#6AF364;
color:#000;
}
table.infolist thead tr th a:hover {
background-color:#C1B398;
}
table.infolist tr td {
font:normal 1.1em/1.4em serif;
vertical-align:middle;
padding:.1em 10px;
}
table.infolist tr td a {
display:block;
text-decoration:none;
color:#000;
}
table.infolist tr.BeginLetter td, table.infolist tr.BeginSurname td {
border-top:solid 1px #5D835F;
border-top:solid 1px #453619;
}
table.infolist tr td.ColumnLetter {
width:3%;
@ -421,8 +424,15 @@ table.infolist tbody tr td.ColumnType {
}
table.infolist tbody tr td.ColumnPartner {
font-size:.9em;
background-color: #FFF;
background-color:#FFF;
}
table.infolist tbody tr td.ColumnPartner a {
display:block;
padding:.6em 10px;
vertical-align:middle;
}
table.infolist tbody tr td.ColumnPartner a:hover { }
table.infolist tbody tr td.ColumnParents {
font-size:.9em;
}
@ -461,11 +471,11 @@ table.surnamelist thead tr th.ColumnLetter {
padding-right:10px;
}
table.surnamelist tbody tr td.ColumnSurname {
background-color: #FFF;
background-color:#FFF;
}
table#SortByName thead tr th.ColumnSurname,
table#SortByCount thead tr th.ColumnQuantity {
background-color: #C1B398;
background-color:#C1B398;
}
table#SortByName thead tr th.ColumnSurname a:after,
table#SortByCount thead tr th.ColumnQuantity a:after {
@ -482,7 +492,7 @@ table#SortByCount tbody tr td.ColumnQuantity { }
table.surnamelist tbody tr td.ColumnSurname:hover,
table#SortByName tbody tr td.ColumnSurname:hover {
background-color: #C1B398;
background-color:#C1B398;
}
table.surname {
border-bottom:solid 1px #000;
@ -495,7 +505,7 @@ table.surname thead tr th.ColumnName {
padding-left:20px;
}
table.surname tbody tr td.ColumnName {
background-color: #FFF;
background-color:#FFF;
width:20%;
padding:0;
}
@ -506,7 +516,7 @@ table.surname tbody tr td.ColumnName a {
table.surname tbody tr td.ColumnName a span.grampsid { }
table.surname tbody tr td.ColumnName:hover {
background-color: #C1B398;
background-color:#C1B398;
}
table.surname tbody tr td.ColumnPartner {
background-color: #FFF;
@ -537,7 +547,7 @@ table.individuallist tbody tr td.ColumnSurname a:active {
}
table.individuallist tbody tr td.ColumnName {
padding:0;
background-color: #FFF;
background-color:#FFF;
}
table.individuallist tbody tr td.ColumnName a {
display:block;
@ -548,7 +558,7 @@ table.individuallist tbody tr td.ColumnName a:hover { }
table.individuallist tbody tr td.ColumnPartner {
padding:0;
background-color: #FFF;
background-color:#FFF;
}
table.individuallist tbody tr td.ColumnPartner a {
display:block;
@ -592,7 +602,7 @@ table.individuallist tbody tr td.ColumnPartner a:hover {
#Places table.infolist tbody tr td.ColumnName {
padding:0;
background-color: #FFF;
background-color:#FFF;
}
#Places table.infolist tbody tr td.ColumnName a {
padding:.1em 10px .3em 10px;
@ -601,45 +611,52 @@ table.individuallist tbody tr td.ColumnPartner a:hover {
/* Events
----------------------------------------------------- */
div#EventList {
div#EventList, div#EventDetail (
font-size:10px;
color: #000;
)
div#EventList a:hover, div#EventDetail a:hover {
padding: 2px 0 2px 0;
display: block;
}
div#EventList table.eventlist {
width: 965px;
}
div#EventList table.eventlist thead tr th {
font-weight:bold;
border:solid 1px #5D835F;
}
div#EventList table.eventlist tbody tr {
border-bottom: dashed 1px #5D835F;
border-bottom:solid 1px #5D835F;
}
div#EventList table.eventlist tbody tr td {
background-color: #D8F3D6;
padding: 4px 0 4px 0;
background-color:#D8F3D6;
padding: 4px 0px 4px 0px;
}
div#EventList table.eventlist tbody tr td.ColumnType {
background-color: #FFF;
background-color:#FFF;
width: 25%;
}
div#EventList table.eventlist tbody tr td.ColumnDate {
width: 18%;
}
div#EventList table.eventlist tbody tr td.ColumnName {
background-color: #FFF;
width: 40%;
background-color:#FFF;
width: 35%;
}
div#EventList table.eventlist tbody tr td.ColumnPartner {
background-color: #FFF;
width: 30%;
}
div#EventDetail {
font-size:10px;
color: #000;
width: 35%;
}
div#EventDetail h3 {
font-size: 40px;
}
div#EventDetail table.eventlist {
margin: .5cm 0.5cm 0;
width:965px;
}
div#EventDetail table.eventlist tbody tr td {
border-bottom:dashed 1px #5D835F;
}
div#EventDetail table.eventlist tbody tr td.ColumnValue a:hover {
padding: 2px 5px 2px 0px;
display:block;
padding: 4px 0 4px 0;
}
/* Gallery
@ -652,7 +669,7 @@ div#EventDetail table.eventlist tbody tr td.ColumnValue a:hover {
}
#Gallery table.infolist tbody tr td.ColumnName {
padding:0;
background-color: #FFF;
background-color:#FFF;
}
#Gallery table.infolist tbody tr td.ColumnName a {
padding:.1em 10px .3em 10px;
@ -715,7 +732,7 @@ div#EventDetail table.eventlist tbody tr td.ColumnValue a:hover {
margin-bottom:0;
border-style:solid;
border-width:2px 0 1px 0;
border-color: #000;
border-color:#000;
}
table.exifdata tr td.ColumnAttribute {
border-top:solid 1px #000;
@ -783,19 +800,19 @@ table.download {
margin: 2cm 0 2cm 0;
border:solid 2px #000;
width:100%;
nackground-color: #D8F3D6;
nackground-color:#D8F3D6;
}
table.download img {
float:center;
}
table.download thead tr th {
background-color: #6AF364;
background-color:#6AF364;
color: #000;
text-transform:uppercase;
padding-left:20px;
padding-top:15px;
border-style:solid;
border-color: #000;
border-color:#000;
border-width:0 2px 2px 2px;
text-align:left;
}
@ -806,7 +823,7 @@ table.download tbody tr td {
padding-left:20px;
padding-top:15px;
border-style:solid;
border-color: #000;
border-color:#000;
border-width:0 2px 2px 2px;
text-align:left;
}
@ -819,7 +836,7 @@ table.download td.ColumnLicense {
}
table.download td.ColumnFilename {
width:30%;
background-color: #FFF;
background-color:#FFF;
}
table.download td.ColumnFilename a {
display:block;
@ -845,7 +862,7 @@ table.download td.ColumnModified {
}
#Sources table.infolist tbody tr td.ColumnName {
padding:0;
background-color: #FFF;
background-color:#FFF;
}
#Sources table.infolist tbody tr td.ColumnName a {
font-size:.9em;
@ -860,7 +877,7 @@ table.download td.ColumnModified {
/* Repositories
------------------------------------------------------ */
#RepositoryList table.repolist tbody tr td.ColumnName {
background-color: #FFF;
background-color:#FFF;
}
/* Subsections
@ -906,22 +923,20 @@ div#events h4 {
border:none;
}
#IndividualDetail {
background-color: #FFF;
}
#IndividualDetail div#events table.infolist thead tr th {
font-weight:bold;
font-size:12px;
line-height:12px;
font-family:sans-serif;
text-transform:uppercase;
color: #542;
padding-top:6px;
padding-bottom:4px;
background-color: #6AF364;
background-color:#FFF;
}
#IndividualDetail div#events table.eventtable {
width:100%;
padding-bottom:15px;
padding-top:15px;
}
#IndividualDetail div#events table.infolist thead tr th {
font-weight:bold;
font-size:10px;
line-height:12px;
text-transform:uppercase;
color:#542;
padding-top:6px 0 4px 0;
background-color:#6AF364;
}
#IndividualDetail div#events table.infolist thead tr th:first-child {
padding-left:20px;
@ -938,22 +953,15 @@ div#events h4 {
}
table.infolist tbody tr td.ColumnValue p {
font-family:sans-serif;
color: #696969;
color:#696969;
margin:.2em 0 0 2em;
}
table.eventtable thead tr th {
color: #000;
}
table.eventtable tbody tr td {
border-bottom:solid 1px #000;
}
div#events table.attrlist {
margin-top:.3cm;
margin-left:.78cm;
margin: .3cm 0 0 .78cm;
width:880px;
}
table.attrlist thead tr th {
color: #000;
color:#000;
}
div#events table.attrlist tbody tr td {
border-bottom:dashed 1px #000;
@ -967,9 +975,6 @@ div#events table.attrlist tbody tr td.ColumnType {
div#events table.attrlist tbody tr td.ColumnValue {
width:200px;
}
div#events table.attrlist tbody tr td.ColumnSources {
width:50px;
}
div#events table.attrlist tbody tr td.ColumnNotes {
width:350px;
}
@ -1013,7 +1018,7 @@ div#families table.infolist {
margin-top:.5em;
}
div#Families table.infolist tbody tr td {
background-color: #FFF;
background-color:#FFF;
}
div#families table.infolist tbody tr td.ColumnValue p {
margin-top:0;
@ -1069,7 +1074,7 @@ div#Addresses {
}
div#Addresses table.infolist {
font-size:.35cm;
background-color: #FFF;
background-color:#FFF;
}
div#Addresses table.infolist tbody tr td {
border-bottom:solid 1px #000;
@ -1163,12 +1168,12 @@ div#sourcerefs ol li ol {
/* Subsections : Summary Area
----------------------------------------------------- */
div#summaryarea {
background-color: #FFF;
background-color:#FFF;
}
div#summaryarea table.infolist {
margin:0;
padding:0;
background: #FFF;
background:#FFF;
border-bottom:solid .7em #FFF;
}
div#summaryarea table.infolist tr td, div#summaryarea table.infolist tr td p {
@ -1180,7 +1185,7 @@ div#summaryarea table.infolist tr td a, div#summaryarea table.infolist tr td p a
}
div#summaryarea table.infolist tbody tr td.ColumnAttribute {
width:14%;
color: #696969;
color:#696969;
padding-left:20px;
}
@ -1194,7 +1199,7 @@ div#pedigree {
}
#pedigree a {
text-decoration:none;
color: #000;
color:#000;
}
#pedigree a:hover {
text-decoration:underline;
@ -1225,7 +1230,7 @@ div#pedigree {
.spouse a {
font-weight:normal;
font-style:normal;
color: #000;
color:#000;
}
.spouse:before {
content: "+ ";
@ -1260,12 +1265,12 @@ div#pedigree {
font:normal .7em/1.4em sans-serif;
text-align:center;
text-decoration:none;
color: #542;
color:#542;
width:118px;
padding:5px 20px 7px 20px;
margin-top:-25px;
margin-left:16px;
background-color: #FFF;
background-color:#FFF;
border:solid 1px #453619;
}
#treeContainer div.boxbg a:hover {
@ -1273,7 +1278,7 @@ div#pedigree {
z-index:999;
font-size:1em;
text-decoration:none;
color: #542;
color:#542;
width:190px;
margin-left:-20px;
padding:10px 25px 12px 25px;
@ -1329,8 +1334,8 @@ div#pedigree {
}
#treeContainer div.unknown a,
#treeContainer div.unknown span.unlinked {
background-color: #000;
color: #FAFAFA;
background-color:#000;
color:#FAFAFA;
}
.shadow {
display:none;
@ -1341,7 +1346,7 @@ div#pedigree {
height:1px;
margin:0 0 0 16px;
padding:0;
background-color: #453619;
background-color:#453619;
}
#tree div div.bhline {
position:absolute;
@ -1349,7 +1354,7 @@ div#pedigree {
width:1px;
margin:0 0 0 16px;
padding:0;
background-color: #453619;
background-color:#453619;
}
.ghline, .gvline {
display:none;
@ -1360,7 +1365,7 @@ div#pedigree {
/* Calendar : General */
body#WebCal {
padding:0 14px;
background-color: #542;
background-color:#542;
}
.calendar {
empty-cells:show;
@ -1386,34 +1391,34 @@ body#WebCal {
font-size:2em;
line-height:100%;
text-transform:none;
color: #542;
color:#542;
padding:.3em 0 .2em 0;
background-color: #FFF;
background-color:#FFF;
}
#CreatorInfo {
float:right;
color: #FFF;
color:#FFF;
margin:-24px 10px 0 0;
}
#CreatorInfo a {
color: #FFF;
color:#FFF;
}
#CreatorInfo a:hover {
color: #FFF;
color:#FFF;
}
.calendar thead tr th.weekend,
.calendar thead tr th.weekday {
font-style:italic;
color: #000;
background-color: #6AF364;
color:#000;
background-color:#6AF364;
border:solid 2px #453619;
}
.calendar tfoot tr td {
padding:.7em 5% 1em 5%;
border-top:solid 2px #000;
vertical-align:middle;
color: #453619;
background-color: #D8F3D6;
color:#453619;
background-color:#D8F3D6;
}
/* Calendar : Date Numeral */
@ -1424,10 +1429,10 @@ body#WebCal {
font-size:1.2em;
line-height:100%;
text-align:center;
color: #542;
color:#542;
margin:0 0 0 .5em;
padding:.2em 0;
background-color: #D8F3D6;
background-color:#D8F3D6;
}
/* Calendar : Date Container */
@ -1437,13 +1442,13 @@ body#WebCal {
padding:0;
border-width:1px 0 0 1px;
border-style:solid;
border-color: #453619;
border-color:#453619;
}
.calendar tbody tr td.weekday {
background-color: #FFF;
background-color:#FFF;
}
.calendar tbody tr td.weekend {
background-color: #D8F3D6;
background-color:#D8F3D6;
}
.calendar tbody tr td.saturday {
border-right:solid 1px #453619;
@ -1480,16 +1485,16 @@ body#WebCal {
/* Calendar : Birthday, Anniversary, Highlight */
.calendar tbody tr td ul li em {
font-style:normal;
color: #0A65B5;
color:#0A65B5;
}
.calendar tbody tr td ul li span.yearsmarried em {
color: #453619;
color:#453619;
}
.calendar tbody tr td.highlight { }
.calendar tbody tr td.highlight div.date {
color: #0A65B5;
background-color: #C2E1FE;
color:#0A65B5;
background-color:#C2E1FE;
}
/* Calendar : Previous-Next Month */
@ -1497,8 +1502,8 @@ body#WebCal {
.calendar tbody tr td.next,
.calendar tbody tr td.previous div.date,
.calendar tbody tr td.next div.date {
color: #333;
background-color: #D8F3D6;
color:#333;
background-color:#D8F3D6;
}
/* Calendar : Full Year */

View File

@ -368,11 +368,34 @@ class BasePage(object):
# return unordered note list to its callers
return unordered
def get_event_data(self, event, evt_ref):
def event_link(self, eventtype, handle, gid=None, up=False):
""" createsa hyperlink for an event based on its type """
url = self.report.build_url_fname_html(handle, 'evt', up)
evt_hyper = Html('a', eventtype, href=url, title=eventtype)
if not self.noid and gid:
evt_hyper += Html('span', ' [%s] ' % gid, class_='grampsid',
inline=True)
# return event hyper link to its callers
return evt_hyper
def get_event_data(self, event, evt_ref, showdescr=False, showsources=True):
"""
retrieve event data from event and evt_ref
@param: event = event from database
@param: evt_ref = eent reference
@param: showdescr = to show the event description or not
@param: showsources = to show the event source references or not
"""
db = self.report.database
# get event type
eventtype = get_event_type(event, evt_ref)
eventtype = get_event_type(event, evt_ref)
evt_hyper = self.event_link(eventtype, evt_ref.ref, event.gramps_id, True)
# get place name
place_handle = event.get_place_handle()
@ -382,7 +405,7 @@ class BasePage(object):
if place:
place_name = ReportUtils.place_name(db, place_handle)
place_hyper = self.place_link(place_handle, place_name,
place.gramps_id, True)
place.gramps_id, True)
# get event and event_ref notes
notelist = event.get_note_list()
@ -390,29 +413,25 @@ class BasePage(object):
# wrap it all up and return to its callers
info = [
['Type', eventtype],
['Date', _dd.display(event.get_date_object() )],
['Place', place_hyper],
['Description', event.get_description()],
['Notes', notelist],
['Attributes', event.get_attribute_list()]
]
[THEAD, evt_hyper],
[DHEAD, _dd.display(event.get_date_object() )],
[PHEAD, place_hyper],
[NHEAD, notelist],
[AHEAD, event.get_attribute_list()] ]
if showdescr:
descr_row = [DESCRHEAD, event.get_description()]
info.insert(3, descr_row)
if showsources:
position = 3
if showdescr:
position = 4
source_row = [SHEAD, self.get_citation_links(event.get_source_references() ) ]
info.insert(position, source_row)
return info
def event_link(self, eventtype, handle, gid=None, up=False):
""" createsa hyperlink for an event based on its type """
url = self.report.build_url_fname_html(handle, 'evt', up)
event_hyper = Html('a', eventtype, href=url, title=eventtype)
if not self.noid and gid:
event_hyper += Html('span', ' [%s] ' % gid, class_='grampsid',
inline=True)
# return event hyper link to its callers
return event_hyper
def dump_ordinance(self, db, ldsobj, LDSType='Person'):
"""
will dump the LDS Ordinance information for either
@ -671,11 +690,13 @@ class BasePage(object):
name.set_display_as(name_format)
return _nd.display_name(name)
def display_attr_list(self, attrobj):
def display_attr_list(self, attrobj, showsources=True):
"""
will display an object's attributes
@param: attrobj -- object to display it's attributes
@param: showsources = True for class IndividualPage
= False for class EventPage
"""
attrlist = attrobj.get_attribute_list()
if not attrlist:
@ -696,13 +717,15 @@ class BasePage(object):
trow = Html('tr')
thead += trow
attr_header_row = [
(THEAD, 'Type'),
(VHEAD, 'Value'),
(SHEAD, 'Source'),
(NHEAD, 'Notes') ]
[THEAD, 'Type'],
[VHEAD, 'Value'],
[NHEAD, 'Notes'] ]
if showsources:
sourcerow = [SHEAD, 'Sources']
attr_header_row.insert(2, sourcerow)
for (label, colclass) in attr_header_row:
trow += Html('th', label, class_='Column%s' % colclass, inline=True)
# begin table body
@ -713,18 +736,30 @@ class BasePage(object):
trow = Html('tr')
tbody += trow
for (colclass, value) in [
['Type', attr.get_type().xml_str()],
['Value', attr.get_value()],
['Sources', self.get_citation_links(attr.get_source_references() )],
['Notes', self.dump_notes(attr.get_note_list() )] ]:
attr_data_row = [
[attr.get_type().xml_str()],
[attr.get_value()],
[self.dump_notes(attr.get_note_list() )] ]
trow += Html('td', value, class_='Column%s' % colclass, inline=True)
if showsources:
sourcerefs = [attr.get_source_references()]
attr_data_row.insert(2, sourcerefs)
index = 0
for value in attr_data_row:
value = value or ' '
# get column class from attr_header_row
colclass = attr_header_row[index][1]
trow += Html('td', value, class_='Column%s' % colclass,
inline=True if colclass == 'Type' else False)
index += 1
# return section to its caller
return section
def write_footer(self, location):
def write_footer(self):
"""
Will create and display the footer section of each page...
@ -735,9 +770,6 @@ class BasePage(object):
# begin footer division
with Html('div', id='footer') as footer:
# specify footer location or not?
footer.attr += ' class="location"' if location else ' class="nolocation"'
footer_note = self.report.options['footernote']
if footer_note:
note = db.get_note_from_gramps_id(footer_note)
@ -791,7 +823,7 @@ class BasePage(object):
# return footer to its callers
return footer
def write_header(self, title, location):
def write_header(self, title):
"""
Note. 'title' is used as currentsection in the navigation links and
as part of the header title.
@ -811,10 +843,6 @@ class BasePage(object):
self.report.encoding, xmllang
)
# if we have set a location for footer, then we must also set
# the class here too to not have the footer padding
body.attr = ' class="location"' if location else ' class="nolocation"'
# create additional meta tags
meta = (Html('meta', attr = _META1) +
Html('meta', attr = _META2, indent=False)
@ -1170,10 +1198,11 @@ class BasePage(object):
confidence = None
source_data = [
[DHEAD, _dd.display(sref.date)],
[_('Page'), sref.page],
[_('Confidence'), confidence]
]
[DHEAD, _dd.display(sref.date)],
[_('Page'), sref.page],
[_('Confidence'), confidence]
]
for (label, data) in source_data:
if data:
tmp.append("%s: %s" % (label, data))
@ -1371,13 +1400,8 @@ class IndividualListPage(BasePage):
showpartner = report.options['showpartner']
showparents = report.options['showparents']
# determine if we specify the location of footer or not?
location = True
if len(person_handle_list) > 6:
location = False
of = self.report.create_file("individuals")
indlistpage, body = self.write_header(_('Individuals'), location)
indlistpage, body = self.write_header(_('Individuals'))
# begin Individuals division
with Html('div', class_='content', id='Individuals') as section:
@ -1550,7 +1574,7 @@ class IndividualListPage(BasePage):
# create clear line for proper styling
# create footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -1569,14 +1593,9 @@ class SurnamePage(BasePage):
showpartner = report.options['showpartner']
showparents = report.options['showparents']
# determine location of footer or not?
location = True
if len(person_handle_list) > 6:
location = False
of = self.report.create_file(name_to_md5(surname), 'srn')
self.up = True
surnamepage, body = self.write_header("%s - %s" % (_('Surname'), surname), location)
surnamepage, body = self.write_header("%s - %s" % (_('Surname'), surname))
# begin SurnameDetail division
with Html('div', id='SurnameDetail', class_='contente') as surnamedetail:
@ -1711,7 +1730,7 @@ class SurnamePage(BasePage):
# add clearline for proper styling
# add footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -1725,13 +1744,8 @@ class PlaceListPage(BasePage):
self.src_list = src_list # TODO verify that this is correct
db = report.database
# determine the location of footer or not?
location = True
if len(place_handles) > 6:
location = False
of = self.report.create_file("places")
placelistpage, body = self.write_header(_('Places'), location)
placelistpage, body = self.write_header(_('Places'))
# begin places division
with Html('div', class_='content', id='Places') as section:
@ -1801,7 +1815,7 @@ class PlaceListPage(BasePage):
# add clearline for proper styling
# add footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -1817,11 +1831,10 @@ class PlacePage(BasePage):
BasePage.__init__(self, report, title, place.gramps_id)
self.src_list = src_list # TODO verify that this is correct
# we are specifying the location of footer
of = self.report.create_file(place.get_handle(), 'plc')
self.up = True
self.page_title = ReportUtils.place_name(db, place_handle)
placepage, body = self.write_header(_('Places'), True)
placepage, body = self.write_header(_('Places'))
# begin PlaceDetail Division
with Html('div', class_='content', id='PlaceDetail') as placedetail:
@ -1898,8 +1911,7 @@ class PlacePage(BasePage):
# add clearline for proper styling
# add footer section
# we are not specifying the location of footer as there is too much info
footer = self.write_footer(True)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -1912,13 +1924,8 @@ class EventListPage(BasePage):
BasePage.__init__(self, report, title)
db = report.database
# determine if we specify location of footer or not?
location = True
if len(event_dict) > 6:
location = False
of = self.report.create_file("events")
eventslistpage, body = self.write_header(_('Events'), location)
eventslistpage, body = self.write_header(_('Events'))
# begin events list division
with Html('div', class_='content', id='EventList') as eventlist:
@ -1933,7 +1940,7 @@ class EventListPage(BasePage):
eventlist += Html('p', msg, id='description')
# begin event list table
with Html('table', class_='eventlist') as table:
with Html('table', class_='infolist eventlist') as table:
eventlist += table
# begin table head
@ -1959,18 +1966,18 @@ class EventListPage(BasePage):
for (person, event_list) in event_dict:
first = True
for (evt_type, sort_name, sort_date, event, evt_ref,
for (evt_type, sort_date, sort_name, evt, evt_ref,
partner) in event_list:
# write eent row data
trow = self.write_event_row(person, evt_type, event,
trow = self.write_event_row(person, evt_type, evt,
evt_ref, partner, first)
tbody += trow
first = False
# and clearline for proper styling
# and footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page ut for processing
@ -1980,10 +1987,17 @@ class EventListPage(BasePage):
def write_event_row(self, person, evt_type, evt, evt_ref, partner, first):
"""
display the event row for class EventListPage()
@param: person = person that the event is referenced to
@param: evt_type = the type of event
@param: evt = event
@param: evt_ref = event reference
@param: partner = only used when the event is either a Marriage or Divorce
@param: first = used for only showing the person once for list of events
"""
# get person's hyperlink
url = self.report.build_url_fname_html(person.handle, 'ppl', True)
url = self.report.build_url_fname_html(person.handle, 'ppl', False)
person_hyper = self.person_link(url, person, True, person.gramps_id)
# event hyperlink
@ -2010,15 +2024,15 @@ class EventListPage(BasePage):
# display partner if event is either a Marriage or Divorce?
# partner will not be None
tcell = Html('td', class_='ColumnPartner')
trow += tcell
# get partner hyperlink
if partner is not None:
url = self.report.build_url_fname_html(partner.handle, 'ppl', True)
partner_hyper = self.person_link(url, partner, False,
partner.gramps_id)
# get partner hyperlink
url = self.report.build_url_fname_html(partner.handle, 'ppl', False)
partner_hyper = self.person_link(url, partner, False, partner.gramps_id)
tcell += partner_hyper
else:
tcell += ' '
@ -2027,13 +2041,14 @@ class EventListPage(BasePage):
return trow
class EventPage(BasePage):
def __init__(self, report, title, evt_type, event, evt_ref, person, partner):
BasePage.__init__(self, report, '%s - %s' % (title, evt_type))
def __init__(self, report, title, person, partner, evt_type, event, evt_ref):
BasePage.__init__(self, report, title, event.gramps_id)
self.up = True
db = report.database
of = self.report.create_file(evt_ref.ref, 'evt')
self.up = True
eventpage, body = self.write_header(_('Events'), True)
eventpage, body = self.write_header(_('Events'))
# start event page division
with Html('div', class_='content', id='EventDetail') as eventdetail:
@ -2046,7 +2061,7 @@ class EventPage(BasePage):
title = title[0].upper() + title[1:]
eventdetail += Html('h3', title, inline=True)
# begin event detail table
# begin eventdetail table
with Html('table', class_='infolist eventlist') as table:
eventdetail += table
@ -2054,9 +2069,9 @@ class EventPage(BasePage):
table += tbody
# get event data
event_row = self.get_event_data(event, evt_ref)
event_row = self.get_event_data(event, evt_ref, True, False)
# the first four in the list is to be used here, the rest are below
# the first four are listed here, the other two are way below
for index in xrange(4):
label = event_row[index][0]
data = event_row[index][1] or None
@ -2064,7 +2079,7 @@ class EventPage(BasePage):
if data is not None:
trow = Html('tr') + (
Html('td', label, class_= 'ColumnAttribute', inline=True),
Html('td', data, class_='ColumnValue', inline=True)
Html('td', data, class_='ColumnValue')
)
tbody += trow
@ -2095,12 +2110,11 @@ class EventPage(BasePage):
# get attribute list
attrib = event_row[5][1]
if attrib:
eventdetail += self.display_attr_list(event)
eventdetail += self.display_attr_list(event, False)
# add clearline for proper styling
# add footer section
# specified location of footer
footer = self.write_footer(True)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2198,8 +2212,7 @@ class MediaPage(BasePage):
self.copy_thumbnail(handle, photo)
self.page_title = photo.get_description()
# there is usually too much information on these pages?
mediapage, body = self.write_header("%s - %s" % (_('Media'), self.page_title), False)
mediapage, body = self.write_header("%s - %s" % (_('Media'), self.page_title))
# begin GalleryDetail division
mediadetail = Html('div', class_='content', id='GalleryDetail')
@ -2410,7 +2423,7 @@ class MediaPage(BasePage):
mediadetail += notes
# get media attributes
attrib = self.display_attr_list(photo)
attrib = self.display_attr_list(photo, False)
if attrib is not None:
mediadetail += attrib
@ -2426,9 +2439,7 @@ class MediaPage(BasePage):
# add clearline for proper styling
# add footer section
# not specifying the location of footer because there is usually
# a lot of information on the media pages
footer = self.write_footer(False)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2503,17 +2514,12 @@ class SurnameListPage(BasePage):
BasePage.__init__(self, report, title)
db = report.database
# determine if we specify location of footer or not?
location = True
if len(person_handle_list) > 6:
location = False
if order_by == self.ORDER_BY_NAME:
of = self.report.create_file(filename)
surnamelistpage, body = self.write_header(_('Surnames'), location)
surnamelistpage, body = self.write_header(_('Surnames'))
else:
of = self.report.create_file("surnames_count")
surnamelistpage, body = self.write_header(_('Surnames by person count'), location)
surnamelistpage, body = self.write_header(_('Surnames by person count'))
# begin surnames division
with Html('div', class_='content', id='surnames') as surnamelist:
@ -2621,7 +2627,7 @@ class SurnameListPage(BasePage):
# create footer section
# add clearline for proper styling
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2646,21 +2652,14 @@ class IntroductionPage(BasePage):
BasePage.__init__(self, report, title)
db = report.database
# determine if we specify the location of the footer or not on image?
location = True
introimg = report.add_image('introimg')
if introimg:
location = False
of = self.report.create_file(report.intro_fname)
# Note. In old NarrativeWeb.py the content_divid depended on filename.
intropage, body = self.write_header(_('Introduction'), location)
intropage, body = self.write_header(_('Introduction'))
# begin Introduction division
with Html('div', class_='content', id='Introduction') as section:
body += section
# introduction image is identified earlier
introimg = report.add_image('introimg')
if introimg is not None:
section += introimg
@ -2674,7 +2673,7 @@ class IntroductionPage(BasePage):
# add clearline for proper styling
# create footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2690,20 +2689,14 @@ class HomePage(BasePage):
BasePage.__init__(self, report, title)
db = report.database
# determine the location of footer or not by image?
homeimg = report.add_image('homeimg')
location = True
if homeimg:
location = False
of = self.report.create_file("index")
homepage, body = self.write_header(_('Home'), location)
homepage, body = self.write_header(_('Home'))
# begin home division
with Html('div', class_='content', id='Home') as section:
body += section
# home page image is specified earlier...
homeimg = report.add_image('homeimg')
if homeimg is not None:
section += homeimg
@ -2717,7 +2710,7 @@ class HomePage(BasePage):
# create clear line for proper styling
# create footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2733,13 +2726,8 @@ class SourceListPage(BasePage):
handle_list = list(handle_set)
source_dict = {}
# determine if we specify location of footer or not?
location = True
if len(handle_list) > 6:
location = False
of = self.report.create_file("sources")
sourcelistpage, body = self.write_header(_('Sources'), location)
sourcelistpage, body = self.write_header(_('Sources'))
# begin source list division
with Html('div', class_='content', id='sources') as section:
@ -2790,7 +2778,7 @@ class SourceListPage(BasePage):
# add clearline for proper styling
# add footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2805,10 +2793,9 @@ class SourcePage(BasePage):
source = db.get_source_from_handle(handle)
BasePage.__init__(self, report, title, source.gramps_id)
# possibility of too much information, so no specified footer
of = self.report.create_file(source.get_handle(), 'src')
self.up = True
sourcepage, body = self.write_header(_('Sources'),False)
sourcepage, body = self.write_header(_('Sources'))
# begin source detail division
with Html('div', class_='content', id='SourceDetail') as section:
@ -2858,8 +2845,7 @@ class SourcePage(BasePage):
# add clearline for proper styling
# add footer section
# possibility of too much information, so no specified footer
footer = self.write_footer(False)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2872,9 +2858,8 @@ class MediaListPage(BasePage):
BasePage.__init__(self, report, title)
db = report.database
# no specified footer location
of = self.report.create_file("media")
medialistpage, body = self.write_header(_('Media'), False)
medialistpage, body = self.write_header(_('Media'))
# begin gallery division
with Html('div', class_='content', id='Gallery') as section:
@ -2929,8 +2914,7 @@ class MediaListPage(BasePage):
# add footer section
# add clearline for proper styling
# no specified footer location
footer = self.write_footer(False)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -2984,9 +2968,8 @@ class DownloadPage(BasePage):
if not dlfname1 and not dlfname2:
return
# has to be False for some problem with stylesheet
of = self.report.create_file("download")
downloadpage, body = self.write_header(_('Download'), False)
downloadpage, body = self.write_header(_('Download'))
# begin download page and table
with Html('div', class_='content', id='Download') as download:
@ -3102,8 +3085,7 @@ class DownloadPage(BasePage):
# clear line for proper styling
# create footer section
# a specified footer location
footer = self.write_footer(False)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -3117,7 +3099,7 @@ class ContactPage(BasePage):
db = report.database
of = self.report.create_file("contact")
contactpage, body = self.write_header(_('Contact'), False)
contactpage, body = self.write_header(_('Contact'))
# begin contact division
with Html('div', class_='content', id='Contact') as section:
@ -3127,7 +3109,6 @@ class ContactPage(BasePage):
with Html('div', id='summaryarea') as summaryarea:
section += summaryarea
# contact image is specified earlier
contactimg = report.add_image('contactimg', 200)
if contactimg is not None:
summaryarea += contactimg
@ -3169,7 +3150,7 @@ class ContactPage(BasePage):
# add clearline for proper styling
# add footer section
footer = self.write_footer(False)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for porcessing
@ -3194,14 +3175,13 @@ class IndividualPage(BasePage):
self.src_list = src_list # Used by get_citation_links()
self.bibli = Bibliography()
self.place_list = place_list
self.sort_name = self.get_name(self.person)
self.name = self.get_name(self.person)
self.sort_name = self.get_name(person)
self.name = self.get_name(person)
db = report.database
of = self.report.create_file(person.handle, 'ppl')
self.up = True
# there is way too much information on this page, so False
indivdetpage, body = self.write_header(self.get_name(person), False)
indivdetpage, body = self.write_header(self.sort_name)
# begin individualdetail division
with Html('div', class_='content', id='IndividualDetail') as individualdetail:
@ -3212,9 +3192,8 @@ class IndividualPage(BasePage):
# if there is a thumbnail, add it also?
if thumbnail is not None:
individualdetail += (thumbnail, name, summary)
else:
individualdetail += (name, summary)
individualdetail += thumbnail
individualdetail += (name, summary)
# display a person's events
sect2 = self.display_ind_events()
@ -3222,7 +3201,7 @@ class IndividualPage(BasePage):
individualdetail += sect2
# display attributes
sect3 = self.display_attr_list(self.person)
sect3 = self.display_attr_list(person)
if sect3 is not None:
individualdetail += sect3
@ -3237,7 +3216,7 @@ class IndividualPage(BasePage):
individualdetail += sect5
# display LDS ordinance
sect6 = self.display_lds_ordinance(self.person)
sect6 = self.display_lds_ordinance(person)
if sect6 is not None:
individualdetail += sect6
@ -3299,8 +3278,7 @@ class IndividualPage(BasePage):
# add clearline for proper styling
# create footer section
# there is way too much information here to gie footer a location...
footer = self.write_footer(False)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -4350,12 +4328,11 @@ class IndividualPage(BasePage):
trow = Html('tr')
for (label, colclass) in [
(THEAD, 'Type'),
(DHEAD, 'Date'),
(PHEAD, 'Place'),
(DESCRHEAD, 'Description'),
(SHEAD, 'Sources'),
(NHEAD, 'Notes') ]:
(THEAD, 'Type'),
(DHEAD, 'Date'),
(PHEAD, 'Place'),
(SHEAD, 'Sources'),
(NHEAD, 'Notes') ]:
trow += Html('th', label, class_ = 'Column%s' % colclass, inline = True)
# return header row to its caller
@ -4368,7 +4345,6 @@ class IndividualPage(BasePage):
db = self.report.database
lnk = (self.report.cur_fname, self.page_title, self.gid)
descr = event.get_description()
place_handle = event.get_place_handle()
if place_handle:
if place_handle in self.place_list:
@ -4414,8 +4390,7 @@ class IndividualPage(BasePage):
['Type', evt_hyper],
['Date', _dd.display(event.get_date_object() )],
['Place', place],
['Description', event.get_description()],
['Source', self.get_citation_links(event.get_source_references() )],
['Sources', self.get_citation_links(event.get_source_references() )],
['Notes', self.dump_notes(notelist)] ]:
data = data or ' '
@ -4472,13 +4447,8 @@ class RepositoryListPage(BasePage):
BasePage.__init__(self, report, title)
db = report.database
# determine if we specify the location of footer or not?
location = True
if len(repos_dict) > 6:
location = False
of = self.report.create_file('repositories')
repolistpage, body = self.write_header(_('Repositories'), location)
repolistpage, body = self.write_header(_('Repositories'))
# begin RepositoryList division
with Html('div', class_='content', id='RepositoryList') as repositorylist:
@ -4537,7 +4507,7 @@ class RepositoryListPage(BasePage):
# add clearline for proper styling
# add footer section
footer = self.write_footer(location)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -4555,7 +4525,7 @@ class RepositoryPage(BasePage):
of = self.report.create_file(handle, 'repo')
self.up = True
repositorypage, body = self.write_header(_('Repositories'), True)
repositorypage, body = self.write_header(_('Repositories'))
# begin RepositoryDetail division and page title
with Html('div', class_='content', id='RepositoryDetail') as repositorydetail:
@ -4600,8 +4570,7 @@ class RepositoryPage(BasePage):
# add clearline for proper styling
# add footer section
# a specified location of footer
footer = self.write_footer(True)
footer = self.write_footer()
body += (fullclear, footer)
# send page out for processing
@ -4937,12 +4906,13 @@ class NavWebReport(Report):
# get sort name for sorting later
last_name = person.get_primary_name().get_surname()
first_name = person.get_primary_name().get_first_name()
sort_name = ', '.join([last_name, first_name])
sort_name = ', '.join([last_name, first_name])
partner = None
for family_handle in person.get_family_handle_list():
family = db.get_family_from_handle(family_handle)
# get partner handle
partner_handle = ReportUtils.find_spouse(person, family)
if partner_handle:
partner = db.get_person_from_handle(partner_handle)
@ -4961,9 +4931,10 @@ class NavWebReport(Report):
sort_date = '%04d/%02d/%02d' % (year, month, day)
# add event data
event_list.append([evt_type, sort_name, sort_date, event, evt_ref,
partner])
event_list.append([evt_type, sort_date, sort_name, event,
evt_ref, partner])
partner = None
for evt_ref in person.get_primary_event_ref_list():
event = db.get_event_from_handle(evt_ref.ref)
@ -4978,18 +4949,15 @@ class NavWebReport(Report):
sort_date = '%04d/%02d/%02d' % (year, month, day)
# add event data
event_list.append([evt_type, sort_name, sort_date, event, evt_ref,
partner])
event_list.append([evt_type, sort_date, sort_name, event,
evt_ref, partner])
# sort the list of an individual's events
# sort the event_list
event_list.sort()
# combine person and their events together
event_dict.append([person, event_list])
# sort the events dictionary
event_dict.sort()
# set progress meter pass
self.progress.set_pass(_('Creating event pages'), len(event_dict))
@ -4999,10 +4967,10 @@ class NavWebReport(Report):
for (person, event_list) in event_dict:
self.progress.step()
for (evt_type, sort_name, sort_date, event, evt_ref, partner) in event_list:
for (evt_type, sort_date, sort_name, event, evt_ref, partner) in event_list:
# create individual event page
EventPage(self, self.title, evt_type, event, evt_ref, person, partner)
EventPage(self, self.title, person, partner, evt_type, event, evt_ref)
def gallery_pages(self, source_list):
import gc