4486: NarrativeWeb does not validate

svn: r18065
This commit is contained in:
Michiel Nauta 2011-08-25 20:48:41 +00:00
parent 987146d0b8
commit 623f59d5ad
10 changed files with 196 additions and 83 deletions

View File

@ -505,9 +505,9 @@ class BasePage(object):
s_tags = styledtext.get_tags()
markuptext = self._backend.add_markup_from_styled(text, s_tags,
split='\n')
htmllist = Html("div", id = "grampsstylednote")
htmllist = Html("div", class_="grampsstylednote")
if contains_html:
htmllist.extend((Html('p') + text))
htmllist += text
else:
linelist = []
linenb = 1
@ -544,10 +544,10 @@ class BasePage(object):
"""
if not notelist:
return Html("p")
return Html("div")
# begin unordered list
ul = Html("p")
ul = Html("div")
for notehandle in notelist:
this_note = self.report.database.get_note_from_handle(notehandle)
if this_note is not None:
@ -606,10 +606,7 @@ class BasePage(object):
# get event notes
notelist = event.get_note_list()
notelist.extend( event_ref.get_note_list() )
if notelist:
htmllist = self.dump_notes( notelist )
else:
htmllist = Html("p")
htmllist = self.dump_notes(notelist)
# if the event or event reference has an attributes attached to it,
# get the text and format it correctly
@ -866,8 +863,11 @@ class BasePage(object):
False -- repository with no sources
None -- Address Book address with sources
"""
if not addrlist:
return None
# begin summaryarea division
with Html("div", id = "summaryarea") as summaryarea:
with Html("div", id = "AddressTable") as summaryarea:
# begin address table
with Html("table") as table:
@ -1029,7 +1029,7 @@ class BasePage(object):
return None
# begin attributes division and section title
with Html("div", class_ = "ubsection", id = "attributes") as section:
with Html("div", class_ = "subsection", id = "attributes") as section:
section += Html("h4", AHEAD, inline = True)
# begin attributes table
@ -1600,7 +1600,7 @@ class BasePage(object):
return None
# begin narrative division
with Html("div", class_ = "subsection", id = "narrative") as section:
with Html("div", class_ = "subsection narrative") as section:
for notehandle in notelist:
note = self.report.database.get_note_from_handle(notehandle)
@ -1661,7 +1661,7 @@ class BasePage(object):
# Email address
if _type == UrlType.EMAIL:
if not uri.startswith("mailto:"):
uri = "mailto: %(email)s" % { 'email' : uri }
uri = "mailto:%(email)s" % { 'email' : uri }
# Web Site address
elif _type == UrlType.WEB_HOME:
@ -1979,8 +1979,8 @@ class BasePage(object):
(LOCALITY, ml.locality),
(CITY, ml.city),
(PARISH, ml.parish),
(STATE, ml.state),
(COUNTY, ml.county),
(STATE, ml.state),
(POSTAL, ml.postal),
(COUNTRY, ml.country),
(_("Telephone"), ml.phone) ]:
@ -1993,14 +1993,15 @@ class BasePage(object):
altloc = place.get_alternate_locations()
if altloc:
table += Html("tr") + Html("td", " ", colspan = 2)
tbody += Html("tr") + Html("td", " ", colspan = 2)
trow = Html("tr") + (
Html("th", ALT_LOCATIONS, colspan = 2, class_ = "ColumnAttribute", inline = True),
)
table += trow
tbody += trow
for loc in (nonempt for nonempt in altloc if not nonempt.is_empty()):
for (label, data) in [
(STREET, loc.street),
(LOCALITY, loc.locality),
(CITY, loc.city),
(PARISH, loc.parish),
(COUNTY, loc.county),
@ -2012,8 +2013,8 @@ class BasePage(object):
Html("td", label, class_ = "ColumnAttribute", inline = True),
Html("td", data, class_ = "ColumnValue", inline = True)
)
table += trow
table += Html("tr") + Html("td", " ", colspan = 2)
tbody += trow
tbody += Html("tr") + Html("td", " ", colspan = 2)
# return place table to its callers
return table
@ -2025,7 +2026,7 @@ class BasePage(object):
return None
# begin residence division
with Html("div", id = "Residence", class_ = "content") as residence:
with Html("div", class_ = "content Residence") as residence:
residence += Html("h4", _("Residence"), inline = True)
with Html("table", class_ = "infolist place") as table:
@ -2037,16 +2038,19 @@ class BasePage(object):
if place:
self.dump_place(place, table)
descr = has_res.get_description()
if descr:
trow = Html("tr")
table += trow
trow.extend(
( Html("td", DESCRHEAD, class_ = "ColumnAttribute", inline = True) +
Html("td", descr, class_ = "ColumnValue") )
)
descr = has_res.get_description()
if descr:
trow = Html("tr")
if len(table) == 3:
# append description row to tbody element of dump_place
table[-2] += trow
else:
# append description row to table element
table += trow
trow.extend(Html("td", DESCRHEAD, class_ = "ColumnAttribute", inline = True))
trow.extend(Html("td", descr, class_ = "ColumnValue", inline=True))
# return information to its callers
return residence
@ -2128,8 +2132,10 @@ class IndividualListPage(BasePage):
table += tbody
person_handle_list = sort_people(db, person_handle_list)
letter = "!"
for (surname, handle_list) in person_handle_list:
first = True
prev_letter = letter
letter = first_letter(surname)
for person_handle in handle_list:
person = db.get_person_from_handle(person_handle)
@ -2142,8 +2148,13 @@ class IndividualListPage(BasePage):
if first:
trow.attr = 'class = "BeginSurname"'
if surname:
tcell += Html("a", surname, name = letter,
title = "Surname with letter " + letter)
if letter != prev_letter:
tcell += Html("a", surname, name = letter,
id_ = letter,
title = "Surname with letter " + letter)
else:
tcell += Html("a", surname,
title = "Surname with letter " + letter)
else:
tcell += " "
else:
@ -2224,6 +2235,7 @@ class IndividualListPage(BasePage):
father_name = self.get_name(father)
if mother:
mother_name = self.get_name(mother)
samerow = False
if mother and father:
tcell = ( Html("span", father_name, class_ = "father fatherNmother") +
Html("span", mother_name, class_ = "mother")
@ -2232,7 +2244,9 @@ class IndividualListPage(BasePage):
tcell = Html("span", mother_name, class_ = "mother")
elif father:
tcell = Html("span", father_name, class_ = "father")
samerow = False
else:
tcell = " "
samerow = True
else:
tcell = " "
samerow = True
@ -2699,6 +2713,7 @@ class EventListPage(BasePage):
tbody = Html("tbody")
table += tbody
prev_letter = ""
# separate events by their type and then thier event handles
for (evt_type, datalist) in sort_event_types(db, event_types, event_handle_list):
first_letter = True
@ -2740,12 +2755,11 @@ class EventListPage(BasePage):
else:
ltr = " "
if first_letter:
trow.attr = 'class = "BeginLetter"'
tcell += Html("a", ltr, name = ltr,
if ltr != prev_letter:
trow.attr = 'class = "BeginLetter BeginType"'
tcell += Html("a", ltr, name = ltr, id_ = ltr,
title = _("Event types beginning with letter " + ltr), inline = True)
first_letter = False
prev_letter = ltr
else:
tcell += " "
@ -2754,6 +2768,8 @@ class EventListPage(BasePage):
trow += tcell
if first_event:
tcell += evt_type
if trow.attr == "":
trow.attr = 'class = "BeginType"'
else:
tcell += " "
@ -3551,21 +3567,17 @@ class SourcePage(BasePage):
with Html("div", id = "subsection", class_ = "Repositories") as reposection:
srcdetail += reposection
reposection += Html("h4", _("Repositories"), inline = True)
ordered = Html("ol")
reposection += ordered
with Html("table", class_ = "infolist repolist") as table:
reposection += table
unordered = Html("ul")
table += unordered
for repo_ref in repo_ref_list:
repository = db.get_repository_from_handle( repo_ref.ref )
list = Html("li", self.repository_link( repository.handle,
repository.name,
inc_repos,
repository.gramps_id,
up = True ) )
unordered += list
for repo_ref in repo_ref_list:
repository = db.get_repository_from_handle( repo_ref.ref )
list = Html("li", self.repository_link( repository.handle,
repository.name,
inc_repos,
repository.gramps_id,
up = True ) )
ordered += list
# references
references = self.display_references(src_list[source.handle])
@ -4144,6 +4156,7 @@ class IndividualPage(BasePage):
data = place_lat_long[0]
midX_, midY_ = conv_lat_lon( data[0], data[1], "D.D8" )
jsc += """
//<![CDATA[
var centre = new google.maps.LatLng(%s, %s);
var gpsCoords = [""" % (midX_, midY_)
for index in xrange(0, (number_markers - 1)):
@ -4184,7 +4197,8 @@ class IndividualPage(BasePage):
animation: google.maps.Animation.DROP
}));
iterator++;
}""" % (data[0], data[1], zoomlevel)
}
//]]>""" % (data[0], data[1], zoomlevel)
# there is no need to add an ending "</script>",
# as it will be added automatically by libhtml()!
@ -4217,6 +4231,7 @@ class IndividualPage(BasePage):
jsc += openstreet_jsc % (Utils.xml_lang()[3:5].lower(), data[0], data[1] )
else:
jsc += """
//<![CDATA[
OpenLayers.Lang.setCode("%s");
map = new OpenLayers.Map("map_canvas");
@ -4265,7 +4280,8 @@ class IndividualPage(BasePage):
feature.popup = null;
}
map.addControl(controls['selector']);
controls['selector'].activate();"""
controls['selector'].activate();
//]]>"""
with Html("div", class_ ="subsection", id ="references") as section:
mapbackground += section
@ -4559,11 +4575,11 @@ class IndividualPage(BasePage):
return ol
def child_ped(ol):
ol += Html("li", class_ = "thisperson", inline = True) + self.name
family = self.pedigree_family()
if family:
ol += Html("ol", class_ = "spouselist") + family
return ol
with Html("li", self.name, class_="thisperson") as pedfam:
family = self.pedigree_family()
if family:
pedfam += Html("ol", class_ = "spouselist") + family
return ol + pedfam
# End of helper functions
@ -4602,7 +4618,7 @@ class IndividualPage(BasePage):
children_ped(Html("ol"))
)
else:
pedol += children_ped(Html("ol"))
pedol += (Html("li") + children_ped(Html("ol")))
return ped
def display_ind_general(self):

View File

@ -494,6 +494,15 @@ table.individuallist tbody tr td.ColumnName a:hover {
padding:.1em 10px .3em 10px;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top:dashed 1px rgb(204, 204, 204);
}
#EventList table.infolist tr.BeginLetter td {
border-top:solid 1px rgb(204, 204, 204);
}
/* Gallery
----------------------------------------------------- */
#Gallery table.infolist tbody tr td.ColumnRowLabel, #Gallery table.infolist tbody tr td.ColumnDate {
@ -819,6 +828,9 @@ div#addresses table.infolist tbody tr td.ColumnAttribute {
div#addresses table.infolist tbody tr td.ColumnValue {
border-bottom:dashed 1px #CCC;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* Subsections : Attributes
----------------------------------------------------- */
@ -859,10 +871,10 @@ div#addresses table.infolist tbody tr td.ColumnValue {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
margin-top:.5em;
margin-bottom:0;
padding:0 20px 1em 20px;

View File

@ -452,8 +452,7 @@ table.surname tbody tr td.ColumnName a span.grampsid {
}
table.surname tbody tr td.ColumnName:hover {
background-color: #00029D;
color: #FFF;/home/Frog/trunk/src/gui/viewmanager.py:946: GtkWarning: Inserting action group 'Media' into UI manager which already has a group with this name
color: #FFF;
}
table.surname thead tr th.ColumnParents,
table.surname tbody tr td.ColumnParents {
@ -1132,7 +1131,7 @@ table.ldsordlist tbody tr td.ColumnLDSPlace {
width: 35%;
}
table.ldsordlist tbody tr td.ColumnLDSStatus {
width: 8;
width: 8%;
}
table.ldsordlist tbody tr td.ColumnLDSSealed {
width: 25%;
@ -1150,7 +1149,6 @@ div#Addresses {
}
div#Addresses table.infolist {
font-size: 10px;
background-color: #70B1ED;
}
div#Addresses table.infolist tbody tr td.ColumnDate {
width: 15%;
@ -1176,14 +1174,17 @@ div#Addresses table.infolist tbody tr td.ColumnPostalcode {
div#Addresses table.infolist tbody tr td.ColumnPhone {
width: 12%;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* SubSection: Residence
----------------------------------------------------- */
div#Residence {
div.Residence {
margin: 0;
padding: 0;
}
div#Residence table.infolist tr td {
div.Residence table.infolist tr td {
border-top: dashed 1px #000;
}
@ -1223,10 +1224,10 @@ div#Residence table.infolist tr td {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom: 0;
}
#narrative p {
.narrative p {
font: normal .9em/1.4em sans-serif;
margin-top: .5em;
margin-bottom: 0;

View File

@ -491,6 +491,15 @@ table.individuallist tbody tr td.ColumnName a:hover {
padding:.1em 10px .3em 10px;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top: dashed 1px #9DBF9D;
}
#EventList table.infolist tr.BeginLetter td {
border-top: solid 1px #9DBF9D;
}
/* Gallery
----------------------------------------------------- */
#Gallery table.infolist tbody tr td.ColumnRowLabel, #Gallery table.infolist tbody tr td.ColumnDate {
@ -816,6 +825,9 @@ div#addresses table.infolist tbody tr td.ColumnAttribute {
div#addresses table.infolist tbody tr td.ColumnValue {
border-bottom:dashed 1px #9DBF9D;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* Subsections : Attributes
----------------------------------------------------- */
@ -856,10 +868,10 @@ div#addresses table.infolist tbody tr td.ColumnValue {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
margin-top:.5em;
margin-bottom:0;
padding:0 20px 1em 20px;

View File

@ -492,6 +492,15 @@ table.individuallist tbody tr td.ColumnName a:hover {
padding:.1em 10px .3em 10px;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top: dashed 1px #B4B4CB;
}
#EventList table.infolist tr.BeginLetter td {
border-top: solid 1px #B4B4CB;
}
/* Gallery
----------------------------------------------------- */
#Gallery table.infolist tbody tr td.ColumnRowLabel, #Gallery table.infolist tbody tr td.ColumnDate {
@ -817,6 +826,9 @@ div#addresses table.infolist tbody tr td.ColumnAttribute {
div#addresses table.infolist tbody tr td.ColumnValue {
border-bottom:dashed 1px #B4B4CB;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a{
display: inline;
}
/* Subsections : Attributes
----------------------------------------------------- */
@ -857,10 +869,10 @@ div#addresses table.infolist tbody tr td.ColumnValue {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
margin-top:.5em;
margin-bottom:0;
padding:0 20px 1em 20px;

View File

@ -493,6 +493,15 @@ table.individuallist tbody tr td.ColumnName a:hover {
padding:.1em 10px .3em 10px;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top: dashed 1px #FFC35E;
}
#EventList table.infolist tr.BeginLetter td {
border-top: solid 1px #FFC35E;
}
/* Gallery
----------------------------------------------------- */
#Gallery table.infolist tbody tr td.ColumnRowLabel, #Gallery table.infolist tbody tr td.ColumnDate {
@ -818,6 +827,9 @@ div#addresses table.infolist tbody tr td.ColumnAttribute {
div#addresses table.infolist tbody tr td.ColumnValue {
border-bottom:dashed 1px #FFC35E;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* Subsections : Attributes
----------------------------------------------------- */
@ -858,10 +870,10 @@ div#addresses table.infolist tbody tr td.ColumnValue {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
margin-top:.5em;
margin-bottom:0;
padding:0 20px 1em 20px;

View File

@ -493,6 +493,15 @@ table.individuallist tbody tr td.ColumnName a:hover {
padding:.1em 10px .3em 10px;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top: dashed 1px #BFD0EA;
}
#EventList table.infolist tr.BeginLetter td {
border-top: solid 1px #BFD0EA;
}
/* Gallery
----------------------------------------------------- */
#Gallery table.infolist tbody tr td.ColumnRowLabel, #Gallery table.infolist tbody tr td.ColumnDate {
@ -818,6 +827,9 @@ div#addresses table.infolist tbody tr td.ColumnAttribute {
div#addresses table.infolist tbody tr td.ColumnValue {
border-bottom:dashed 1px #BFD0EA;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* Subsections : Attributes
----------------------------------------------------- */
@ -858,10 +870,10 @@ div#addresses table.infolist tbody tr td.ColumnValue {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
margin-top:.5em;
margin-bottom:0;
padding:0 20px 1em 20px;

View File

@ -508,6 +508,15 @@ table.individuallist tbody tr td.ColumnName a {
padding:.1em 10px .3em 10px;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top:dashed 1px #D8C19F;
}
#EventList table.infolist tr.BeginLetter td {
border-top:solid 1px #D8C19F;
}
/* Gallery
----------------------------------------------------- */
#Gallery table.infolist tbody tr td.ColumnRowLabel, #Gallery table.infolist tbody tr td.ColumnDate {
@ -820,6 +829,9 @@ div#addresses table.infolist tbody tr td.ColumnAttribute {
div#addresses table.infolist tbody tr td.ColumnValue {
border-bottom:dashed 1px #D8C19F;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* SubSection : Attributes
----------------------------------------------------- */
@ -860,10 +872,10 @@ div#addresses table.infolist tbody tr td.ColumnValue {
/* SubSection : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
margin-top:.5em;
margin-bottom:0;
padding:0 20px 1em 20px;

View File

@ -491,6 +491,15 @@ table.individuallist tbody tr td.ColumnName a:hover {
background-color:#C1B398;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top: dashed 1px #C1B398;
}
#EventList table.infolist tr.BeginLetter td {
border-top: solid 1px #C1B398;
}
/* Gallery
----------------------------------------------------- */
#Gallery { }
@ -808,6 +817,9 @@ div#addresses table.infolist tbody tr td.ColumnAttribute {
div#addresses table.infolist tbody tr td.ColumnValue {
border-bottom:solid 1px #C1B398;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* Subsections : Gallery
----------------------------------------------------- */
@ -845,10 +857,10 @@ div#addresses table.infolist tbody tr td.ColumnValue {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
font:normal .9em/1.4em sans-serif;
margin-top:.5em;
margin-bottom:0;

View File

@ -646,6 +646,15 @@ div#EventDetail table.eventlist tbody tr td.ColumnPerson {
background-color: #D8F3D6;
}
/* Events
----------------------------------------------------- */
#EventList table.infolist tr.BeginType td {
border-top: dashed 1px #5D835F;
}
#EventList table.infolist tr.BeginLetter td {
border-top: solid 1px #5D835F;
}
/* Gallery
----------------------------------------------------- */
#Gallery {
@ -1117,7 +1126,7 @@ table.ldsordlist tbody tr td.ColumnLDSPlace {
width:35%;
}
table.ldsordlist tbody tr td.ColumnLDSStatus {
width:8;
width:8%;
}
table.ldsordlist tbody tr td.ColumnLDSSealed {
width:25%;
@ -1164,6 +1173,9 @@ div#Addresses table.infolist tbody tr td.ColumnPostalcode {
div#Addresses table.infolist tbody tr td.ColumnPhone {
width: 15%;
}
div#Addresses table.infolist tr td a, div#Addresses table.infolist tr td p a {
display: inline;
}
/* Subsections : Gallery
----------------------------------------------------- */
@ -1201,10 +1213,10 @@ div#Addresses table.infolist tbody tr td.ColumnPhone {
/* Subsections : Narrative
----------------------------------------------------- */
div#narrative {
div.narrative {
padding-bottom:0;
}
#narrative p {
.narrative p {
font:normal .9em/1.4em sans-serif;
margin-top:.5em;
margin-bottom:0;