Fixed link statements in write_header(). Changed id="CurrentSection" to "class="currentSection". Patch from Jason Simanek.

svn: r12345
This commit is contained in:
Rob G. Healey 2009-03-14 21:30:04 +00:00
parent e3cc1f6d71
commit f699c5cee7
10 changed files with 79 additions and 92 deletions

View File

@ -212,7 +212,7 @@ a:visited {
background-color:#CCC;
border-bottom:solid 1px #000;
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
padding-bottom:4px;
border-top:solid 1px #999;
border-right:solid 1px #999;
@ -220,10 +220,10 @@ a:visited {
border-bottom:solid 1px #FFF;
background-color:#FFF;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
background-color:#FFF;
}
#subnavigation ul li#CurrentSection a {
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
}

View File

@ -209,7 +209,7 @@ a:visited {
border-top:solid 1px #454;
border-bottom:solid 1px #000;
}
#navigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a {
color:#454;
padding-bottom:4px;
border-top:solid 1px #7C8F7C;
@ -218,7 +218,7 @@ a:visited {
border-bottom:solid 1px #FFF;
background-color:#FFF;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
padding-top:5px;
background-color:#FFF;
}

View File

@ -210,7 +210,7 @@ a:visited {
background-color:#B4B4CB;
border-bottom:solid 1px #000;
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
padding-bottom:4px;
border-top:solid 1px #669;
border-right:solid 1px #669;
@ -218,10 +218,10 @@ a:visited {
border-bottom:solid 1px #FAFAFF;
background-color:#FAFAFF;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
background-color:#FAFAFF;
}
#subnavigation ul li#CurrentSection a {
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
}

View File

@ -211,7 +211,7 @@ a:visited {
background-color:#FFC35E;
border-bottom:solid 1px #36220B;
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
padding-bottom:4px;
border-top:solid 1px #8C581C;
border-right:solid 1px #8C581C;
@ -219,10 +219,10 @@ a:visited {
border-bottom:solid 1px #FFFBE7;
background-color:#FFFBE7;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
background-color:#FFFBE7;
}
#subnavigation ul li#CurrentSection a {
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
}

View File

@ -211,7 +211,7 @@ a:visited {
background-color:#BFD0EA;
border-bottom:solid 1px #000;
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
padding-bottom:4px;
border-top:solid 1px #7CA3DD;
border-right:solid 1px #7CA3DD;
@ -219,10 +219,10 @@ a:visited {
border-bottom:solid 1px #FFF;
background-color:#FFF;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
background-color:#FFF;
}
#subnavigation ul li#CurrentSection a {
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
}

View File

@ -232,7 +232,7 @@ a:visited {
#navigation ul li a:hover, #subnavigation ul li a:hover {
background-color:#FFFFE7;
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
font-family:Georgia, serif;
font-weight:bold;
font-style:italic;
@ -242,12 +242,12 @@ a:visited {
border-width:1px 1px 0 1px;
border-color:#7D5925;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
}
#subnavigation {
background-image:url(../images/Web_Mainz_Mid.png);
}
#subnavigation ul li#CurrentSection a {
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
}

View File

@ -236,7 +236,7 @@ p#user_header {
background-color:#C1B398;
border-bottom:solid 1px #542;
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
font-size:19px;
margin-top:-6px;
padding-top:11px;
@ -246,10 +246,10 @@ p#user_header {
border-bottom:solid 1px #FFF;
background-color:#FFF;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
background-color:#FFF;
}
#subnavigation ul li#CurrentSection a {
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
}

View File

@ -1,5 +1,5 @@
/*
**************************************************************************************************
**************************************************************************************************
Copyright Holder and License
**************************************************************************************************
GRAMPS Cascading Style Sheet
@ -105,13 +105,6 @@ img {
.content div.snapshot div.thumbnail p {
display:none;
}
.fullclear {
width:100%;
height:1px;
margin:0;
padding:0;
clear:both;
}
/* General Text
----------------------------------------------------- */
@ -246,7 +239,7 @@ p#user_header {
background-color:#C1B398;
border-bottom:solid 1px #453619;
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
font-weight:bold;
font-size:16px;
margin-top:-6px;
@ -258,10 +251,10 @@ p#user_header {
background-color:#FFF;
color:#000;
}
#navigation ul li#CurrentSection a:hover {
#navigation ul li.CurrentSection a:hover {
background-color:#FFF;
}
#subnavigation ul li#CurrentSection a {
#subnavigation ul li.CurrentSection a {
border-width:0 0 1px 0;
}
@ -1027,14 +1020,6 @@ div#pedigree {
#footer p#copyright img {
margin-right:10px;
}
#footer p#quality {
width:100%;
text-align:center;
color:#FFF;
}
#footer p#quality img {
float:center;
}
#user_footer {
width:70%;
float:left;

View File

@ -379,12 +379,13 @@ class BasePage:
def write_header(self, of, title):
"""
Note. 'title' is used as currentsection in the navigation links.
Note. 'title' is used as currentsection in the navigation links and
as part of the header title.
"""
of.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n')
of.write('<!DOCTYPE html PUBLIC ')
of.write('\t"-//W3C//DTD XHTML 1.0 Strict//EN" \n')
of.write('\t"-//W3C//DTD XHTML 1.0 Strict//EN" ')
of.write('\t\t"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n')
xmllang = Utils.xml_lang()
of.write('<html xmlns="http://www.w3.org/1999/xhtml" '
@ -400,23 +401,23 @@ class BasePage:
# Link to media reference regions behaviour stylesheet
url = self.report.build_url_fname("behaviour.css", "styles", self.up)
of.write('\t<link href="%s" rel="stylesheet" \n'
'\t\ttype="text/css" media="screen" />\n' % url)
of.write('\t<link href="%s" rel="stylesheet" '
'type="text/css" media="screen" />\n' % url)
# Link to screen stylesheet
url = self.report.build_url_fname(_NARRATIVESCREEN, "styles", self.up)
of.write('\t<link href="%s" rel="stylesheet" \n'
'\t\ttype="text/css" media="screen" />\n' % url)
of.write('\t<link href="%s" rel="stylesheet" '
'type="text/css" media="screen" />\n' % url)
# Link to printer stylesheet
url = self.report.build_url_fname(_NARRATIVEPRINT, "styles", self.up)
of.write('\t<link href="%s" rel="stylesheet" \n'
'\t\ttype="text/css" media="print" />\n' % url)
of.write('\t<link href="%s" rel="stylesheet" '
'type="text/css" media="print" />\n' % url)
# Link to GRAMPS favicon
url = self.report.build_url_image('favicon.ico', 'images', self.up)
of.write('\t<link href="%s" rel="Shortcut Icon" \n'
'\t\ttype="image/icon" />\n' % url)
of.write('\t<link href="%s" rel="Shortcut Icon" '
'ttype="image/icon" />\n' % url)
of.write('</head>\n\n')
of.write('<body id="NarrativeWeb">\n') # Terminated in write_footer()
@ -453,47 +454,47 @@ class BasePage:
of.write('\t<div id="navigation">\n')
of.write('\t\t<ul>\n')
for url_fname, nav_text, cond in navs:
if cond:
navs = [(u, n) for u, n, c in navs if c]
for url_fname, nav_text in navs:
if not url_fname.endswith(self.ext):
url_fname += self.ext
if not url_fname.endswith(self.ext):
url_fname += self.ext
if self.up:
# TODO. Check if build_url_fname can be used.
url_fname = '/'.join(['..']*3 + [url_fname])
if self.up:
# TODO. Check if build_url_fname can be used.
url_fname = '/'.join(['..']*3 + [url_fname])
# TODO. Move this logic to a higher level (caller of write_header).
# TODO. Move this logic to a higher level (caller of write_header).
# Define 'currentsection' to correctly set navlink item CSS id
# 'CurrentSection' for Navigation styling.
# Use 'self.report.cur_fname' to determine 'CurrentSection' for individual
# elements for Navigation styling.
# Define 'currentsection' to correctly set navlink item CSS id
# 'CurrentSection' for Navigation styling.
# Use 'self.report.cur_fname' to determine 'CurrentSection' for individual
# elements for Navigation styling.
# Figure out if we need <li id="CurrentSection"> of just plain <li>
cs = False
if nav_text == currentsection:
# Figure out if we need <li id="CurrentSection"> of just plain <li>
cs = False
if nav_text == currentsection:
cs = True
elif nav_text == _('Surnames'):
if "srn" in self.report.cur_fname:
cs = True
elif _('Surnames') in currentsection:
cs = True
elif nav_text == _('Individuals'):
if "ppl" in self.report.cur_fname:
cs = True
elif nav_text == _('Sources'):
if "src" in self.report.cur_fname:
cs = True
elif nav_text == _('Places'):
if "plc" in self.report.cur_fname:
cs = True
elif nav_text == _('Gallery'):
if "img" in self.report.cur_fname:
cs = True
elif nav_text == _('Surnames'):
if "srn" in self.report.cur_fname:
cs = True
elif _('Surnames') in currentsection:
cs = True
elif nav_text == _('Individuals'):
if "ppl" in self.report.cur_fname:
cs = True
elif nav_text == _('Sources'):
if "src" in self.report.cur_fname:
cs = True
elif nav_text == _('Places'):
if "plc" in self.report.cur_fname:
cs = True
elif nav_text == _('Gallery'):
if "img" in self.report.cur_fname:
cs = True
cs = cs and ' id="CurrentSection"' or ''
of.write('\t\t\t<li%s><a href="%s">%s</a></li>\n' % (cs, url_fname, nav_text))
cs = cs and ' class="CurrentSection"' or ''
of.write('\t\t\t<li%s><a href="%s">%s</a></li>\n' % (cs, url_fname, nav_text))
of.write('\t\t</ul>\n')
of.write('\t</div>\n') # End Navigation Menu

View File

@ -392,7 +392,7 @@ class WebCalReport(Report):
url += self.ext
# Figure out if we need <li id="CurrentSection"> or just plain <li>
cs = url_fname == currentsection and ' id="CurrentSection"' or ''
cs = url_fname == currentsection and ' class="CurrentSection"' or ''
of.write('\t\t<li%s><a href="%s">%s</a></li>\n' % (cs, url, nav_text))
of.write('\t</ul>\n')
@ -444,7 +444,7 @@ class WebCalReport(Report):
# determine if we need to highlight???
highlight = ''
if str(cal_year) == currentsection:
highlight = ' id="CurrentSection"'
highlight = ' class="CurrentSection"'
of.write('\t\t<li%s><a href="%s">%d</a></li>\n'
% (highlight, url, cal_year))
@ -670,7 +670,8 @@ class WebCalReport(Report):
root of the directory tree (i.e. to self.html_dir).
"""
of.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n')
of.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n')
of.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"')
of.write('\t"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n')
xmllang = Utils.xml_lang()
of.write('<html xmlns="http://www.w3.org/1999/xhtml" '
@ -685,19 +686,19 @@ class WebCalReport(Report):
# link to screen stylesheet
fname = '../'*nr_up + 'styles/' + _CALENDARSCREEN
of.write('\t<link rel="stylesheet" href="%s"\n' % fname)
of.write('\t\ttype="text/css" media="screen" />\n')
of.write('\t<link rel="stylesheet" href="%s"' % fname)
of.write('type="text/css" media="screen" />\n')
# link to print stylesheet
if add_print:
fname = '../'*nr_up + 'styles/' + _CALENDARPRINT
of.write('\t<link rel="stylesheet" href="%s"\n' % fname)
of.write('\t\ttype="text/css" media="print" />\n')
of.write('\t<link rel="stylesheet" href="%s"' % fname)
of.write('type="text/css" media="print" />\n')
# link to GRAMPS favicon
fname = '../'*nr_up + 'images/' + 'favicon.ico'
of.write('\t<link rel="shortcut icon" href="%s" \n' % fname)
of.write('\t\ttype="image/icon" />\n')
of.write('\t<link rel="shortcut icon" href="%s" ' % fname)
of.write('type="image/icon" />\n')
of.write('</head>\n\n')