Working on source references and events. Changes in stylesheet to match work.

svn: r13619
This commit is contained in:
Rob G. Healey 2009-11-18 08:05:58 +00:00
parent 03af2705e7
commit 1888d3b423
2 changed files with 82 additions and 73 deletions

View File

@ -88,22 +88,22 @@ img {
overflow: auto; overflow: auto;
width:965px; width:965px;
margin:0 auto; margin:0 auto;
padding-bottom:.5em; padding-bottom: .2em;
} }
.content div.snapshot { .content div.snapshot {
margin:0; margin: 0;
padding:0; padding: 0;
background:none; background: none;
} }
.content div.snapshot div.thumbnail { .content div.snapshot div.thumbnail {
margin:0; margin: 0;
padding:2em 0 0 0; padding: 2em 0 0 0;
background:none; background: none;
} }
.content div.snapshot div.thumbnail a { .content div.snapshot div.thumbnail a {
display:block; display: block;
width:96px; width: 96px;
margin:0 auto; margin: 0 auto;
} }
.fullclear { .fullclear {
width:100%; width:100%;
@ -149,8 +149,10 @@ p#description {
padding:1em 20px; padding:1em 20px;
} }
p#description:first-letter { p#description:first-letter {
color: #228A22; color: #903;
font-size:xx-large; font-size: 36px;
font-weight: bold;
font-style: italic;
} }
p a { p a {
color: #FFF; color: #FFF;
@ -311,8 +313,9 @@ div#navigation ul li.CurrentSection a:hover {
} }
div#subnavigation ul li.CurrentSection a { div#subnavigation ul li.CurrentSection a {
border-width: 0px 0px 2px 0px; border-width: 0px 0px 2px 0px;
border-color: #6AF364; border-color: #5D835F;
} }
i0
/* Alphabet Navigation /* Alphabet Navigation
----------------------------------------------------- */ ----------------------------------------------------- */
@ -329,7 +332,7 @@ div#alphabet ul {
padding: 0px 0px 0px 16px; padding: 0px 0px 0px 16px;
border-width: 2px 0px 4px 0px; border-width: 2px 0px 4px 0px;
border-style: solid; border-style: solid;
border-color: #000; border-color: #5D835F;
} }
div#alphabet ul li:after { div#alphabet ul li:after {
content:" |"; content:" |";
@ -385,7 +388,7 @@ table.infolist tr td a {
color: #000; color: #000;
} }
table.infolist tr.BeginLetter td, table.infolist tr.BeginSurname td { table.infolist tr.BeginLetter td, table.infolist tr.BeginSurname td {
border-top:solid 1px #5D835F; border-top: solid 1px #5D835F;
} }
table.infolist tr td.ColumnLetter { table.infolist tr td.ColumnLetter {
width:3%; width:3%;
@ -481,14 +484,14 @@ table.surnamelist tbody tr td.ColumnSurname:hover,
background-color: #C1B398; background-color: #C1B398;
} }
table.surname { table.surname {
border-bottom:solid 1px #5D835F; border-bottom: solid 1px #5D835F;
} }
table.surname thead tr th.ColumnName { table.surname thead tr th.ColumnName {
width:20%; width:20%;
padding-left:20px; padding-left:20px;
} }
table.surname tbody tr td { table.surname tbody tr td {
border-bottom:dashed 1px #000; border-bottom: dashed 1px #5D835F;
background-color: #D8F3D6; background-color: #D8F3D6;
} }
table.surname tbody tr td.ColumnName { table.surname tbody tr td.ColumnName {
@ -701,7 +704,7 @@ div#EventDetail table.eventlist tbody tr td.ColumnEvent {
#GalleryNav a { #GalleryNav a {
font-weight:bold; font-weight:bold;
text-decoration:none; text-decoration:none;
border:solid 1px #5D835F; border: solid 1px #5D835F;
} }
#GalleryNav a#Previous { #GalleryNav a#Previous {
padding:.5em .7em .3em .7em; padding:.5em .7em .3em .7em;
@ -743,12 +746,12 @@ div#EventDetail table.eventlist tbody tr td.ColumnEvent {
#GalleryDetail div#summaryarea table.gallery { #GalleryDetail div#summaryarea table.gallery {
padding-bottom:0; padding-bottom:0;
margin: 1.5em 0 0 0; margin: 1.5em 0 0 0;
border-style:solid; border-style: solid;
border-width:2px 0 1px 0; border-width: 2px 0 1px 0;
border-color: #5D835F; border-color: #5D835F;
} }
table.exifdata tr td.ColumnAttribute { table.exifdata tr td.ColumnAttribute {
border-top:solid 1px #5D835F; border-top: solid 1px #5D835F;
width:60%; width:60%;
} }
table.exiflist tr td.ColumnValue { table.exiflist tr td.ColumnValue {
@ -763,7 +766,7 @@ table.exiflist tr td.ColumnValue {
width:500px; width:500px;
margin:0 auto; margin:0 auto;
padding:3em; padding:3em;
border:double 4px #5D835F; border: double 4px #5D835F;
} }
#Contact #summaryarea img { #Contact #summaryarea img {
float:right; float:right;
@ -817,11 +820,11 @@ div#Download table.download img {
float:center; float:center;
} }
div#Download table.download tbody tr#Row02 { div#Download table.download tbody tr#Row02 {
border-bottom:solid 2px #000; border-bottom: solid 2px #5D835F;
} }
div#Download table.download tbody tr td { div#Download table.download tbody tr td {
background-color: #D8F3D6; background-color: #D8F3D6;
border: solid 1px #000; border: solid 1px #5D835F;
text-align:left; text-align:left;
} }
div#Download table.download td.Filename { div#Download table.download td.Filename {
@ -1097,7 +1100,7 @@ table.ldsordlist {
margin-bottom:.5em; margin-bottom:.5em;
} }
table.ldsordlist tbody tr td { table.ldsordlist tbody tr td {
border-bottom:solid 1px #000; border-bottom: solid 1px #5D835F;
} }
table.ldsordlist tbody tr td.ColumnLDSType { table.ldsordlist tbody tr td.ColumnLDSType {
width:12%; width:12%;
@ -1181,7 +1184,7 @@ div#Addresses table.infolist tbody tr td.ColumnPhone {
#indivgallery div.thumbnail a img { #indivgallery div.thumbnail a img {
margin-bottom:.5cm; margin-bottom:.5cm;
padding:0; padding:0;
border:solid 1px #000; border: solid 1px #5D835F;
} }
#indivgallery div.thumbnail p { #indivgallery div.thumbnail p {
font:normal .7em/1.4em sans-serif; font:normal .7em/1.4em sans-serif;
@ -1228,7 +1231,7 @@ div#summaryarea table.infolist {
margin:0; margin:0;
padding:0; padding:0;
background:#FFF; background:#FFF;
border-bottom:solid .7em #FFF; border-bottom: solid .7em #5D835F;
} }
div#summaryarea table.infolist tr td, div#summaryarea table.infolist tr td p { div#summaryarea table.infolist tr td, div#summaryarea table.infolist tr td p {
font:normal .9em/1.2em sans-serif; font:normal .9em/1.2em sans-serif;

View File

@ -545,7 +545,7 @@ class BasePage(object):
else: else:
return eventtype return eventtype
def get_event_data(self, evt, evt_ref, showplc, showdescr, showsrc, shownote, subdirs, hyp, gid = None): def get_event_data(self, evt, evt_ref, showplc, showdescr, showsrc, shownote, up, hyp, gid = None):
""" """
retrieve event data from event and evt_ref retrieve event data from event and evt_ref
@ -555,7 +555,7 @@ class BasePage(object):
@param: showdescr = to show the event description or not? @param: showdescr = to show the event description or not?
@param: showsrc = to show the event source references or not? @param: showsrc = to show the event source references or not?
@param: shownote = show notes or not? @param: shownote = show notes or not?
@param: subdirs = either True or False @param: up = either True or False; add subdirs or not?
@param: hyp = to hyperlink the event type or not? @param: hyp = to hyperlink the event type or not?
""" """
db = self.report.database db = self.report.database
@ -566,16 +566,18 @@ class BasePage(object):
# get hyperlink or not? # get hyperlink or not?
evt_hyper = evt_type evt_hyper = evt_type
if hyp: if hyp:
evt_hyper = self.event_link(evt_type, evt_ref.ref, gid, subdirs) evt_hyper = self.event_link(evt_type, evt_ref.ref, gid, up)
# get place name # get place name
place = None
place_handle = evt.get_place_handle() place_handle = evt.get_place_handle()
place = db.get_place_from_handle(place_handle) if place_handle:
place = db.get_place_from_handle(place_handle)
place_hyper = None place_hyper = None
if place: if place:
place_name = ReportUtils.place_name(db, place_handle) place_name = ReportUtils.place_name(db, place_handle)
place_hyper = self.place_link(place_handle, place_name, up = subdirs) place_hyper = self.place_link(place_handle, place_name, up = up)
# wrap it all up and return to its callers # wrap it all up and return to its callers
# position 0 = translatable label, position 1 = column class # position 0 = translatable label, position 1 = column class
@ -678,17 +680,16 @@ class BasePage(object):
# return table to its callers # return table to its callers
return table return table
def source_link(self, handle, hyper_name, name, gid = None, up = False): def source_link(self, handle, name, gid = None, up = False):
"""
creates a link to the source
"""
url = self.report.build_url_fname_html(handle, "src", up) url = self.report.build_url_fname_html(handle, "src", up)
# begin hyperlink # begin hyperlink
hyper = Html("a", html_escape(name), href = url, title = html_escape(name)) hyper = Html("a", html_escape(name), href = url, title = html_escape(name))
# adding to accomodate display_source_refs()
if hyper_name:
hyper.attr += 'name = "%s"' % hyper_name
# add GRAMPS ID # add GRAMPS ID
if not self.noid and gid: if not self.noid and gid:
hyper += Html("span", ' [%s]' % gid, class_ = "grampsid", inline = True) hyper += Html("span", ' [%s]' % gid, class_ = "grampsid", inline = True)
@ -878,11 +879,10 @@ class BasePage(object):
def display_attr_list(self, attrlist, showsrc): def display_attr_list(self, attrlist, showsrc):
""" """
will display an object's attributes will display a list of attributes
@param: attrlist = a list of attributes @param: attrlist -- a list of attributes
@param: objtype = which object are we using? Ex. Person, Event, Photo @param: showsrc -- to shown source references or not?
@param: showsrc = to shown source references or not?
""" """
if not attrlist: if not attrlist:
return None return None
@ -1345,18 +1345,23 @@ class BasePage(object):
def display_source_refs(self, bibli): def display_source_refs(self, bibli):
if bibli.get_citation_count() == 0: if bibli.get_citation_count() == 0:
return None return None
db = self.report.database
# begin Source References division and title # local gettext variables
_PAGE = _("Page")
_CONFIDENCE = _("Confidence")
_TEXT = _("Text")
db = self.report.database
with Html("div", id = "sourcerefs", class_ = "subsection") as section: with Html("div", id = "sourcerefs", class_ = "subsection") as section:
section += Html("h4", _("Source References"), inline = True) section += Html("h4", _("Source References"), inline = True)
ordered = Html("ol") ordered = Html("ol")
cindex = 0 cindex = 0
for citation in bibli.get_citation_list(): citationlist = bibli.get_citation_list()
for citation in citationlist:
cindex += 1 cindex += 1
# Add this source to the global list of sources to be displayed # Add this source to the global list of sources to be displayed
# on each source page. # on each source page.
lnk = (self.report.cur_fname, self.page_title, self.gid) lnk = (self.report.cur_fname, self.page_title, self.gid)
@ -1370,42 +1375,41 @@ class BasePage(object):
# Add this source and its references to the page # Add this source and its references to the page
source = db.get_source_from_handle(shandle) source = db.get_source_from_handle(shandle)
title = source.get_title() title = source.get_title()
list = Html("li", inline = True) + (
list = Html("li", inline = True) Html("a", self.source_link(source.handle, title, source.gramps_id, True),
name = "sref%d" % cindex)
hyper = (Html("a", name = "sref%d" % cindex) +
self.source_link(source.handle, title, source.gramps_id, True)
) )
list += hyper ordered += list
ordered1 = Html("ol") ordered1 = Html("ol")
list += ordered1 citation_ref_list = citation.get_ref_list()
for key, sref in citation_ref_list:
for key, sref in citation.get_ref_list():
tmp = [] tmp = []
confidence = Utils.confidence.get(sref.confidence, _('Unknown')) confidence = Utils.confidence.get(sref.confidence, _('Unknown'))
if confidence == _('Normal'): if confidence == _('Normal'):
confidence = None confidence = None
for (label, data) in [(_("Date"), format_date(sref.date)), for (label, data) in [(DHEAD, format_date(sref.date)),
(_("Page"), sref.page), (_PAGE, sref.page),
(_("Confidence"), confidence)]: (_CONFIDENCE, confidence)]:
if data: if data:
tmp.append("%s: %s" % (label, data)) tmp.append("%s: %s" % (label, data))
notelist = sref.get_note_list() notelist = sref.get_note_list()
for notehandle in notelist: for notehandle in notelist:
note = db.get_note_from_handle(notehandle) note = db.get_note_from_handle(notehandle)
note_text = self.get_note_format(note) note_text = self.get_note_format(note)
tmp.append("%s: %s" % (_('Text'), note_text)) tmp.append("%s: %s" % (_TEXT, note_text))
if len(tmp) > 0: if len(tmp):
list1 = Html("li", inline = True) + (
list1 = Html("li") Html("a", ';   '.join(tmp), name = "sref%d%s" % (cindex, key))
)
ordered1 += list1 ordered1 += list1
list += ordered1
ordered += list
section += ordered
hyper1 = Html("a", ';   '.join(tmp), name = "sref%d%s" % (cindex, key)) # return section to its caller
list1 += hyper1
# return section to its callers
return section return section
def display_references(self, handlelist, up = False): def display_references(self, handlelist, up = False):
@ -3360,7 +3364,6 @@ class IndividualPage(BasePage):
self.place_list = place_list self.place_list = place_list
self.sort_name = self.get_name(person) self.sort_name = self.get_name(person)
self.name = self.get_name(person) self.name = self.get_name(person)
self.attribute_list = attribute_list
db = report.database db = report.database
of = self.report.create_file(person.handle, "ppl") of = self.report.create_file(person.handle, "ppl")
@ -3890,7 +3893,7 @@ class IndividualPage(BasePage):
db = self.report.database db = self.report.database
# begin events division and section title # begin events division and section title
with Html("div", class_ = "subsection", id = "events") as section: with Html("div", id = "events", class_ = "subsection") as section:
section += Html("h4", _("Events"), inline = True) section += Html("h4", _("Events"), inline = True)
# begin events table # begin events table
@ -3906,7 +3909,7 @@ class IndividualPage(BasePage):
@param: show source references @param: show source references
@param: show note @param: show note
""" """
thead += self.display_event_header(True, False, True, False) thead += self.display_event_header(True, True, True, False)
tbody = Html("tbody") tbody = Html("tbody")
table += tbody table += tbody
@ -3925,7 +3928,7 @@ class IndividualPage(BasePage):
@param: subdirs = True or False @param: subdirs = True or False
@param: hyp = show hyperlinked evt type or not? @param: hyp = show hyperlinked evt type or not?
""" """
tbody += self.display_event_row(event, evt_ref, True, False, True, False, True, True) tbody += self.display_event_row(event, evt_ref, True, True, True, False, True, True)
# return section to its caller # return section to its caller
return section return section
@ -4442,6 +4445,9 @@ class IndividualPage(BasePage):
return trow return trow
def format_event(self, eventlist): def format_event(self, eventlist):
"""
displays the event row for events such as marriage and divorce
"""
db = self.report.database db = self.report.database
# begin eventlist table and table header # begin eventlist table and table header
@ -4456,7 +4462,7 @@ class IndividualPage(BasePage):
@param: show source references @param: show source references
@param: show note @param: show note
""" """
thead += self.display_event_header(True, False, True, False) thead += self.display_event_header(True, True, True, False)
# begin table body # begin table body
tbody = Html("tbody") tbody = Html("tbody")
@ -4473,10 +4479,10 @@ class IndividualPage(BasePage):
@param: show description or not? @param: show description or not?
@param: show source references or not? @param: show source references or not?
@param: shownote = show notes or not? @param: shownote = show notes or not?
@param: subdirs = True or False @param: up = True or False: attach subdirs or not?
@param: hyp = show hyperlinked evt type or not? @param: hyp = show hyperlinked evt type or not?
""" """
tbody += self.display_event_row(event, event_ref, True, False, True, False, True, True) tbody += self.display_event_row(event, event_ref, True, True, True, False, True, True)
# return table to its callers # return table to its callers
return table return table