More work on classes EventList and EventPage. Changing elements to match current work.

svn: r13155
This commit is contained in:
Rob G. Healey 2009-09-03 09:35:10 +00:00
parent 2234f82e1a
commit 8e65bbe9c0
2 changed files with 246 additions and 264 deletions

View File

@ -138,10 +138,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 +155,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,21 +172,19 @@ ol {
padding-top:.5em;
padding-bottom:0;
}
ol li a {
text-decoration:none;
}
ol li a:hover {
text-decoration:underline;
}
a {
color:#542;
color: #000;
text-decoration: none;
}
a:visited {
color:#542;
color: #000;
text-decoration: none;
}
a:hover {
color:#000;
background-color:#C1B398;
padding: 2px 10px 2px 0;
display: block;
color: #000;
background-color: #C1B398;
text-decoration:underline;
}
span.preposition {
@ -195,7 +193,7 @@ span.preposition {
}
.grampsid {
font:normal .8em/1.2em monospace;
color:#000;
color: #000;
}
/* Header
@ -214,13 +212,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;
}
@ -246,10 +244,10 @@ p#user_header {
}
#footer a, #footer a:visited {
text-decoration:none;
color:#FFF;
color: #FFF;
}
#footer a:hover {
color:#000;
color: #000;
text-decoration:underline;
}
#footer img {
@ -266,7 +264,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 {
@ -277,7 +275,7 @@ p#user_header {
width:70%;
float:left;
margin:1em;
color:#6AF364;
color: #6AF364;
}
#user_footer p {
font:normal 1em/1.2em serif;
@ -299,7 +297,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:" |";
@ -315,14 +313,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
@ -337,7 +335,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 {
@ -348,15 +346,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;
}
@ -366,13 +364,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;
@ -382,36 +380,24 @@ div#alphabet ul li.letters a:hover {
----------------------------------------------------- */
table.infolist {
width:100%;
margin:0;
margin: .5cm 0 .5cm 0;
padding:0;
}
table.infolist thead tr th {
font:normal 1.1em/1.2em serif;
color:#000;
color: #000;
margin:0;
padding:.2em 10px;
background-color:#6AF364;
background-color: #6AF364;
border: solid 2px #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 #453619;
border-top:solid 1px #5D835F;
}
table.infolist tr td.ColumnLetter {
width:3%;
@ -435,15 +421,8 @@ 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;
}
@ -482,11 +461,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 {
@ -503,7 +482,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;
@ -516,7 +495,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;
}
@ -527,7 +506,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;
@ -558,7 +537,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;
@ -569,7 +548,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;
@ -613,7 +592,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;
@ -622,52 +601,35 @@ table.individuallist tbody tr td.ColumnPartner a:hover {
/* Events
----------------------------------------------------- */
div#EventList (
div#EventList {
font-size:10px;
color:#000;
font-family:Arial, sans, sans-serif, Helvetica;
)
div#EventList table.eventlist {
margin: .5cm 0 .5cm 0;
width: 965px;
}
div#EventList table.eventlist thead tr th {
font-weight:bold;
border:solid 1px #5D835F;
color: #000;
}
div#EventList table.eventlist tbody tr {
border-bottom:solid 1px #000;
border-bottom: dashed 1px #5D835F;
}
div#EventList table.eventlist tbody tr td {
background-color:#D8F3D6;
padding: 10px 0px 10px 0px;
background-color: #D8F3D6;
padding: 4px 0 4px 0;
}
div#EventList table.eventlist tbody tr td.ColumnType {
background-color:#FFF;
background-color: #FFF;
width: 25%;
}
div#EventList table.eventlist tbody tr td.ColumnType a:hover {
padding: 10px 10px 10px 0px;
display:block;
}
div#EventList table.eventlist tbody tr td.ColumnDate {
width: 18%;
}
div#EventList table.eventlist tbody tr td.ColumnDescription {
width: 20%;
}
div#EventList table.eventlist tbody tr td.ColumnName {
background-color:#FFF;
width: 75%;
background-color: #FFF;
width: 40%;
}
div#EventList table.eventlist tbody tr td.ColumnName a:hover {
padding: 10px 10px 10px 0px;
display:block;
div#EventList table.eventlist tbody tr td.ColumnPartner {
background-color: #FFF;
width: 30%;
}
div#EventDetail {
font-size:10px;
color:#000;
font-family:Arial, sans, sans-serif, Helvetica;
color: #000;
}
div#EventDetail h3 {
font-size: 40px;
@ -676,7 +638,7 @@ div#EventDetail table.eventlist tbody tr td {
border-bottom:dashed 1px #5D835F;
}
div#EventDetail table.eventlist tbody tr td.ColumnValue a:hover {
padding: 5px 50px 5px 0px;
padding: 2px 5px 2px 0px;
display:block;
}
@ -690,7 +652,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;
@ -753,7 +715,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;
@ -821,19 +783,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;
}
@ -844,7 +806,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;
}
@ -857,7 +819,7 @@ table.download td.ColumnLicense {
}
table.download td.ColumnFilename {
width:30%;
background-color:#FFF;
background-color: #FFF;
}
table.download td.ColumnFilename a {
display:block;
@ -883,7 +845,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;
@ -898,7 +860,7 @@ table.download td.ColumnModified {
/* Repositories
------------------------------------------------------ */
#RepositoryList table.repolist tbody tr td.ColumnName {
background-color:#FFF;
background-color: #FFF;
}
/* Subsections
@ -944,7 +906,7 @@ div#events h4 {
border:none;
}
#IndividualDetail {
background-color:#FFF;
background-color: #FFF;
}
#IndividualDetail div#events table.infolist thead tr th {
font-weight:bold;
@ -952,10 +914,10 @@ div#events h4 {
line-height:12px;
font-family:sans-serif;
text-transform:uppercase;
color:#542;
color: #542;
padding-top:6px;
padding-bottom:4px;
background-color:#6AF364;
background-color: #6AF364;
}
#IndividualDetail div#events table.eventtable {
width:100%;
@ -976,11 +938,11 @@ 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;
color: #000;
}
table.eventtable tbody tr td {
border-bottom:solid 1px #000;
@ -991,7 +953,7 @@ div#events table.attrlist {
width:880px;
}
table.attrlist thead tr th {
color:#000;
color: #000;
}
div#events table.attrlist tbody tr td {
border-bottom:dashed 1px #000;
@ -1051,7 +1013,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;
@ -1107,7 +1069,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;
@ -1201,12 +1163,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 {
@ -1218,7 +1180,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;
}
@ -1232,7 +1194,7 @@ div#pedigree {
}
#pedigree a {
text-decoration:none;
color:#000;
color: #000;
}
#pedigree a:hover {
text-decoration:underline;
@ -1263,7 +1225,7 @@ div#pedigree {
.spouse a {
font-weight:normal;
font-style:normal;
color:#000;
color: #000;
}
.spouse:before {
content: "+ ";
@ -1298,12 +1260,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 {
@ -1311,7 +1273,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;
@ -1367,8 +1329,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;
@ -1379,7 +1341,7 @@ div#pedigree {
height:1px;
margin:0 0 0 16px;
padding:0;
background-color:#453619;
background-color: #453619;
}
#tree div div.bhline {
position:absolute;
@ -1387,7 +1349,7 @@ div#pedigree {
width:1px;
margin:0 0 0 16px;
padding:0;
background-color:#453619;
background-color: #453619;
}
.ghline, .gvline {
display:none;
@ -1398,7 +1360,7 @@ div#pedigree {
/* Calendar : General */
body#WebCal {
padding:0 14px;
background-color:#542;
background-color: #542;
}
.calendar {
empty-cells:show;
@ -1424,34 +1386,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 */
@ -1462,10 +1424,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 */
@ -1475,13 +1437,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;
@ -1518,16 +1480,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 */
@ -1535,8 +1497,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

@ -371,14 +371,8 @@ class BasePage(object):
def get_event_data(self, event, evt_ref):
db = self.report.database
# Event/ Type
evt_name = str(event.get_type())
if evt_ref.get_role() == EventRoleType.PRIMARY:
eventtype = u"%(evt_name)s" % locals()
else:
evt_role = evt_ref.get_role()
eventtype = u"%(evt_name)s (%(evt_role)s)" % locals()
# get event type
eventtype = get_event_type(event, evt_ref)
# get place name
place_handle = event.get_place_handle()
@ -396,16 +390,29 @@ 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()],
['Sources', self.get_citation_links(event.get_source_references() )],
['Notes', notelist],
['Attributes', event.get_attribute_list()]
]
['Type', eventtype],
['Date', _dd.display(event.get_date_object() )],
['Place', place_hyper],
['Description', event.get_description()],
['Notes', notelist],
['Attributes', event.get_attribute_list()]
]
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
@ -1329,18 +1336,6 @@ class BasePage(object):
# return hyperlink to its callers
return hyper
def event_link(self, eventtype, handle, gid, up=False):
""" createsa hyperlink for an event based on its type """
url = self.report.build_url_fname_html(handle, 'evt', up)
hyper = Html('a', html_escape(eventtype), href=url, title=eventtype)
if not self.noid and gid:
hyper += Html('span', ' [%s] ' % gid, class_='grampsid', inline=True)
# return hyperlink back to its caller
return hyper
# ---------------------------------------------------------------------------------------
#
# # Web Page Fortmatter and writer
@ -1930,15 +1925,15 @@ class EventListPage(BasePage):
body += eventlist
msg = _("This page contains an index of all the events in the "
"database, sorted by their type and person’s surname. "
"Clicking on an event’s type will take you to that "
"event’s page. Clicking on a place will take you to that "
"place’s page. Clicking on a person’s name will take "
"you to that person’s page.")
"database, sorted by their type and person’s surname. "
"Clicking on an event’s type will take you to that "
"event’s page. Clicking on a place will take you to that "
"place’s page. Clicking on a person’s name will take "
"you to that person’s page.")
eventlist += Html('p', msg, id='description')
# begin event list table
with Html('table', class_='infolist eventlist') as table:
with Html('table', class_='eventlist') as table:
eventlist += table
# begin table head
@ -1950,15 +1945,28 @@ class EventListPage(BasePage):
thead += trow
for (label, colclass) in [
(THEAD, 'Type'),
(DHEAD, 'Date'),
(DESCRHEAD, 'Description'),
(_('Person'), 'Person') ]:
(THEAD, 'Type'),
(DHEAD, 'Date'),
(_('Person'), 'Name'),
(_('Partner'), 'Partner') ]:
trow += Html('th', label, class_ = 'Column%s' % colclass,
inline = True)
trow += Html('th', label, class_ = 'Column%s' % colclass, inline = True)
# begin table body
tbody = Html('tbody')
table += tbody
# send entire events dictionary
table += self.write_event_rows(event_dict)
for (person, event_list) in event_dict:
first = True
for (evt_type, sort_name, sort_date, event, evt_ref,
partner) in event_list:
# write eent row data
trow = self.write_event_row(person, evt_type, event,
evt_ref, partner, first)
tbody += trow
first = False
# and clearline for proper styling
# and footer section
@ -1969,56 +1977,57 @@ class EventListPage(BasePage):
# and close the file
self.mywriter(eventslistpage, of)
def write_event_rows(self, event_dict):
def write_event_row(self, person, evt_type, evt, evt_ref, partner, first):
"""
display the event row for class EventListPage()
"""
db = self.report.database
# begin table body
tbody = Html('tbody')
# get person's hyperlink
url = self.report.build_url_fname_html(person.handle, 'ppl', True)
person_hyper = self.person_link(url, person, True, person.gramps_id)
for (sort_name, person, event_list) in event_dict:
# event hyperlink
event_hyper = self.event_link(evt_type, evt_ref.ref, evt.gramps_id)
# get person's hyperlink
url = self.report.build_url_fname_html(person.handle, 'ppl', self.up)
person_hyper = self.person_link(url, person, True, person.gramps_id)
# begin table row
trow = Html('tr')
first = True
for (evt_type, sort_date, event, evt_ref) in event_list:
for (colclass, data) in [
['Type', event_hyper],
['Date', _dd.display(evt.get_date_object() )] ]:
data = data or ' '
# event hyperlink
event_hyper = self.event_link(evt_type, evt_ref.ref, event.gramps_id)
trow += Html('td', data, class_='Column%s' % colclass, inline=True)
# begin table row
trow = Html('tr')
tbody += trow
# display person hyperlink or ' '
tcell = Html('td', class_='ColumnName')
trow += tcell
for (colclass, data) in [
['Type', event_hyper],
['Date', _dd.display(event.get_date_object() )],
['Description', event.get_description()] ]:
data = data or ' '
if first:
tcell += person_hyper
else:
tcell += ' '
# conditional statement for inline=True or False
samerow = True if (data == ' ' or (colclass == 'Date' or 'Type'))\
else False
trow += Html('td', data, class_='Column%s' % colclass, inline=samerow)
# display partner if event is either a Marriage or Divorce?
# partner will not be None
# display person hyperlink or non-breaking space
tcell = Html('td', class_='ColumnName')
trow += tcell
if first:
tcell += person_hyper
else:
tcell += ' '
first = False
tcell = Html('td', class_='ColumnPartner')
trow += tcell
# return events table body to its caller
return tbody
# 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)
tcell += partner_hyper
else:
tcell += ' '
# return EventList row to its caller
return trow
class EventPage(BasePage):
def __init__(self, report, title, evt_type, event, evt_ref, person):
def __init__(self, report, title, evt_type, event, evt_ref, person, partner):
BasePage.__init__(self, report, '%s - %s' % (title, evt_type))
db = report.database
@ -2048,7 +2057,7 @@ class EventPage(BasePage):
event_row = self.get_event_data(event, evt_ref)
# the first four in the list is to be used here, the rest are below
for index in xrange(5):
for index in xrange(4):
label = event_row[index][0]
data = event_row[index][1] or None
@ -2059,21 +2068,32 @@ class EventPage(BasePage):
)
tbody += trow
# get person hyperlink
url = self.report.build_url_fname_html(person.handle, 'ppl', self.up)
person_hyper = self.person_link(url, person, True, person.gramps_id)
trow = Html('tr') + (
Html('td', _('Person'), class_='ColumnAttribute', inline=True),
Html('td', person_hyper, class_='ColumnValue', inline=True)
Html('td', person_hyper, class_='ColumnValue')
)
tbody += trow
tbody += trow
# get notes section
notelist = event_row[5][1]
# display partner if type is either Marriage or Divorce
if partner is not None:
url = self.report.build_url_fname_html(partner.handle, 'ppl', self.up)
partner_hyper = self.person_link(url, partner, True, partner.gramps_id)
trow = Html('tr') + (
Html('td', _('Partner'), class_='ColumnAttribute', inline=True),
Html('td', partner_hyper, class_='ColumnValue')
)
tbody += trow
# Narrative subsection
notelist = event_row[4][1]
if notelist:
eventdetail += self.display_note_list(notelist)
# get attribute list
attrib = event_row[6][1]
attrib = event_row[5][1]
if attrib:
eventdetail += self.display_attr_list(event)
@ -4358,18 +4378,14 @@ class IndividualPage(BasePage):
self.place_list[place_handle] = [lnk]
place = self.place_link(place_handle,
ReportUtils.place_name(db, place_handle), up=True)
ReportUtils.place_name(db,
place_handle), up=True)
else:
place = ''
# Event/ Type
evt_name = str(event.get_type())
if event_ref.get_role() == EventRoleType.PRIMARY:
eventtype = u"%(evt_name)s" % locals()
else:
evt_role = event_ref.get_role()
eventtype = u"%(evt_name)s (%(evt_role)s)" % locals()
# Get event type and hyperlink
eventtype = get_event_type(event, event_ref)
evt_hyper = self.event_link(eventtype, event_ref.ref, event.gramps_id, True)
# Place
place_handle = event.get_place_handle()
@ -4395,7 +4411,7 @@ class IndividualPage(BasePage):
trow = Html('tr')
for (colclass, data) in [
['Type', eventtype],
['Type', evt_hyper],
['Date', _dd.display(event.get_date_object() )],
['Place', place],
['Description', event.get_description()],
@ -4434,10 +4450,9 @@ class IndividualPage(BasePage):
for event_ref in eventlist:
event = db.get_event_from_handle(event_ref.ref)
evtType = str(event.get_type() )
# add event body row
ordered += self.display_event_row(event, event_ref )
ordered += self.display_event_row(event, event_ref)
# attributes list
attrlist = event.get_attribute_list()
@ -4893,22 +4908,6 @@ class NavWebReport(Report):
SourcePage(self, self.title, key, source_list)
self.progress.step()
def get_event_type(self, event, event_ref):
""" return the type of an event """
# Event/ Type
evt_name = str(event.get_type())
if event_ref.get_role() == EventRoleType.PRIMARY:
evt_type = u"%(evt_name)s" % locals()
else:
evt_role = event_ref.get_role()
evt_type = u"%(evt_name)s (%(evt_role)s)" % locals()
evt_type = evt_type or ' '
# return event type to its callers
return evt_type
def place_pages(self, place_list, source_list):
self.progress.set_pass(_("Creating place pages"), len(place_list))
@ -4921,7 +4920,7 @@ class NavWebReport(Report):
def event_pages(self, ind_list):
"""
a dump of all the events sorted by person's surname, and event type,
a dump of all the events sorted by event type, surname, and
then by date if needed...
"""
db = self.database
@ -4940,14 +4939,19 @@ class NavWebReport(Report):
first_name = person.get_primary_name().get_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)
partner_handle = ReportUtils.find_spouse(person, family)
if partner_handle:
partner = db.get_person_from_handle(partner_handle)
for evt_ref in family.get_event_ref_list():
event = db.get_event_from_handle(evt_ref.ref)
# get event type
evt_type = self.get_event_type(event, evt_ref)
evt_type = get_event_type(event, evt_ref)
# get sot date as year/month/day or 0000/00/00
event_date = event.get_date_object()
@ -4957,13 +4961,14 @@ class NavWebReport(Report):
sort_date = '%04d/%02d/%02d' % (year, month, day)
# add event data
event_list.append([evt_type, sort_date, event, evt_ref])
event_list.append([evt_type, sort_name, sort_date, event, evt_ref,
partner])
for evt_ref in person.get_primary_event_ref_list():
event = db.get_event_from_handle(evt_ref.ref)
# get event type
evt_type = self.get_event_type(event, evt_ref)
evt_type = get_event_type(event, evt_ref)
# get sot date as year/month/day or 0000/00/00
event_date = event.get_date_object()
@ -4973,13 +4978,14 @@ class NavWebReport(Report):
sort_date = '%04d/%02d/%02d' % (year, month, day)
# add event data
event_list.append([evt_type, sort_date, event, evt_ref])
event_list.append([evt_type, sort_name, sort_date, event, evt_ref,
partner])
# sort the list of an individual's events
event_list.sort()
# combine person and their events together
event_dict.append([sort_name, person, event_list])
event_dict.append([person, event_list])
# sort the events dictionary
event_dict.sort()
@ -4990,13 +4996,13 @@ class NavWebReport(Report):
# send all data to the events list page
EventListPage(self, self.title, event_dict)
for (sort_name, person, event_list) in event_dict:
for (person, event_list) in event_dict:
self.progress.step()
for evt_type, sort_date, event, evt_ref in event_list:
for (evt_type, sort_name, sort_date, event, evt_ref, partner) in event_list:
# create individual event page
EventPage(self, self.title, evt_type, event, evt_ref, person)
EventPage(self, self.title, evt_type, event, evt_ref, person, partner)
def gallery_pages(self, source_list):
import gc
@ -5824,6 +5830,20 @@ def add_birthdate(db, childlist):
# return the list of child handles and their birthdates
return sorted_children
def get_event_type(event, event_ref):
""" return the type of an event """
evt_name = str(event.get_type())
if event_ref.get_role() == EventRoleType.PRIMARY:
evt_type = u"%(evt_name)s" % locals()
else:
evt_role = event_ref.get_role()
evt_type = u"%(evt_name)s (%(evt_role)s)" % locals()
# return event type to its callers
return evt_type
# -------------------------------------------
#
# Register Plugin