Cleanup work to make NarrativeWeb and WebCal. With this they should

produce webpages similar to grams 3.x, but under the hood there are a
lot of changes. There are new and improved CSS files and images. And
these are shares between NarrativeWeb and WebCal.
  *** Many thanks to Jason and Rob. ***


svn: r11180
This commit is contained in:
Kees Bakker 2008-10-21 18:57:42 +00:00
parent e08fee7d29
commit 0ead404135
23 changed files with 8963 additions and 2845 deletions

View File

@ -12,6 +12,12 @@ dist_pkgdata_DATA = \
system_filters.xml \
tips.xml\
lds.xml\
Web_Basic-Ash.css\
Web_Basic-Cypress.css\
Web_Basic-Lilac.css\
Web_Basic-Peach.css\
Web_Basic-Spruce.css\
Web_Mainz.css\
Web_Evergreen.css\
Web_Nebraska.css\
Web_Print-Default.css\

1114
src/data/Web_Basic-Ash.css Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1114
src/data/Web_Basic-Lilac.css Normal file

File diff suppressed because it is too large Load Diff

1113
src/data/Web_Basic-Peach.css Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -203,10 +203,10 @@ a:hover {
*/
#header {
width:100%;
height:1cm;
padding:0 0 .9em 0;
height:2cm;
padding:0;
margin:0;
background-color:#139400;
background-color:#22822A;
border-top:solid 4px #D30;
border-bottom:solid 2px #D30;
}
@ -253,10 +253,13 @@ p#user_header {
*/
#navigation {
width:100%;
height:35px;
height:30px;
list-style-type:none;
text-align:center;
vertical-align:middle;
font-size:10px;
margin:0;
padding:0;
background-color:#6AF364;
border-top:solid 4px #D30;
border-bottom:solid 4px #D30;
@ -265,6 +268,8 @@ p#user_header {
display:inline;
width:2em;
text-align:center;
font-size:10px;
padding:0;
margin:0;
}
#navigation ul li a {
@ -281,12 +286,13 @@ p#user_header {
#navigation ul li#CurrentSection a {
border-right:solid 2px #D30;
border-left:solid 2px #D30;
border-top:solid 2px #D30;
border-bottom:solid 2px #FAFAFA;
bborder-top:solid 4px #D30;
border-bottom:solid 1px #FAFAFA;
font-family:Georgia, serif;
font-weight:bold;
font-style:italic;
font-size:16px;
padding:4px;
text-decoration:none;
background-color:#FAFAFA;
color:#426E40;
@ -335,7 +341,7 @@ p#user_header {
color:#FAFAFA;
border:solid 1px #6AF364;
}
.calendar tbody tr.week5, .calendar tbody tr.week6 {
.week3, .week4, .week5 {
border-bottom:solid 1px #000;
}
.calendar tbody tr td {
@ -413,8 +419,6 @@ p#user_header {
.highlight div.date {
background-color:#1E90FF;
color:#FAFAFA;
font-weight:bold;
font-style:italic;
}
/*
@ -1286,6 +1290,7 @@ div#pedigree {
height:1.5cm;
background-color:#139400;
color:#FAFAFA;
font-size:14px;
margin:0;
padding:0;
clear:both;
@ -1298,15 +1303,14 @@ div#pedigree {
}
#footer a:hover {
text-decoration:none;
background-color:#228B22;
background-color:#426E40;
}
#footer img {
border:0;
margin:0;
float:center;
background:none;
}
#footer p#createdate {
font-size:.8em;
float:left;
width:40%;
text-align:left;

1088
src/data/Web_Mainz.css Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -113,7 +113,7 @@ h4 {
color:#C47170;
margin:0;
padding:.2em 0 .2em 20px;
background-color:#FFF;
background-color:#FAFAFA;
border-bottom:solid 1px #F33;
}
h5, h6 {
@ -144,7 +144,7 @@ a {
}
a:hover, a:active {
background-color:#DD9091;
color:#FFF;
color:#FAFAFA;
text-decoration:none;
}
a:visited {
@ -154,7 +154,7 @@ a:visited {
/*
------------------------------------------------------------------------------
Header/Navigation Styles
Header Styles
------------------------------------------------------------------------------
*/
#header {
@ -163,16 +163,14 @@ a:visited {
background-color:#D30;
height:2cm;
}
#header h1 {
font-size:.7cm;
float:center;
text-align:center;
color:#FFF;
margin:0;
padding:0;
}
#header h1#SiteTitle {
font-size:1cm;
#SiteTitle {
font:italic .9cm #FAFAFA;
float:center;
text-align:center;
color:#FAFAFA;
margin:0 auto;
padding:0;
}
#header p {
font-weight:bold;
@ -185,19 +183,25 @@ a:visited {
float:right;
margin:10px;
padding:0;
color:#FFF;
color:#FAFAFA;
}
#GRAMPSinfo a {
color:#FFF;
color:#FAFAFA;
}
.grampsid {
font:normal .8em/1.2em monospace;
color:#903;
}
/*
-------------------------------------------------------------------------------------------------
Navigation Elements
-------------------------------------------------------------------------------------------------
*/
#navigation {
margin:0;
padding:4px 0 0 0;
background-color:#F33;
background-color:#C1B398;
}
#navigation ul {
list-style:none;
@ -219,25 +223,25 @@ a:visited {
font-weight:bold;
text-decoration:none;
margin:0;
padding:5px 5px;
color:#FFF;
padding:5px;
color:#000;
}
#navigation ul li a:hover {
background-color:#C47170;
border-bottom:solid 1px #5D835F;
COLOR:#fafafa;
}
#navigation ul li#CurrentSection a {
padding-bottom:4px;
font-size:16px;
border-top:solid 1px #F33;
border-right:solid 1px #F6F2EE;
border-left:solid 1px #F6F2EE;
border-bottom:solid 1px #F6F2EE;
background-color:#FFF;
background-color:#FAFAFA;
color:#903;
}
#navigation ul li#CurrentSection a:hover {
background-color:#000;
color:#FFF;
color:#FAFAFA;
}
/*
@ -268,13 +272,13 @@ a:visited {
line-height:100%;
text-transform:none;
padding:.3em 0 .2em 0;
background-color:#FFF;
background-color:#FAFAFA;
color:#C47170;
}
.calendar thead tr th.weekend, .calendar thead tr th.weekday {
border:solid 1px #000;
background-color:#C47170;
color:#FFF;
color:#FAFAFA;
}
.calendar thead tr th.saturday, .calendar thead tr th.sunday { }
@ -287,31 +291,22 @@ a:visited {
border-color:#903;
}
.calendar tbody tr td.weekday {
background-color:#FFF;
background-color:#FAFAFA;
}
.calendar tbody tr td.weekend {
background-color:#F6F2EE;
background-color:#CDEFAA;
}
.calendar tbody tr td.saturday {
border-right:solid 1px #903;
border-right:solid 1px #000;
}
.calendar tbody tr td.sunday {
border-left:solid 1px #903;
border-left:solid 1px #000;
}
.calendar tbody tr td#emptyDays {
background-color:#D3D3D3;
line-height:100%;
border:solid 1px #903;
}
.calendar tbody tr td:first-child {
border-left:none;
}
.calendar tbody tr:first-child td {
border-top:none;
}
.calendar tbody tr td:first-child, .calendar tbody tr td:last-child {
background-color:#F6F2EE;
}
.calendar tbody tr td ul {
list-style:none;
font-family:sans-serif;
@ -324,10 +319,7 @@ a:visited {
width:92%;
margin:0 4%;
padding:.2em 0 .3em 0;
border-top:dashed 1px #C1B398;
}
.calendar tbody tr td ul li:first-child {
border:none;
border-top:dashed 1px #000;
}
.calendar tbody tr td ul li em {
font-style:normal;
@ -345,7 +337,7 @@ a:visited {
vertical-align:middle;
font-size:.8em;
height:1cm;
color:#FFF;
color:#FAFAFA;
}
.date {
float:right;
@ -354,19 +346,19 @@ a:visited {
font-size:1.2em;
line-height:100%;
text-align:center;
color:#FFF;
color:#000;
margin:0 0 0 .5em;
padding:.2em 0;
background-color:#F33;
background-color:#C1B900;
}
.highlight div.date {
background-color:#1E90FF;
color:#FFF;
color:#FAFAFA;
}
.next div.date, .previous div.date {
.next span.date, .previous span.date {
background-color:#903;
color:#FFF;
color:#FAFAFA;
}
/*
@ -460,12 +452,12 @@ table.surnamelist tbody tr td.ColumnSurname {
}
table.surnamelist thead tr th.ColumnSurname {
background-color:#DD9091;
color:#FFF;
color:#FAFAFA;
padding:0;
}
table.surnamelist thead tr th.ColumnQuantity {
background-color:#DD9091;
color:#FFF;
color:#FAFAFA;
width:40%;
padding:0;
}
@ -475,14 +467,14 @@ table.infolist thead tr th.ColumnSurname a, table.infolist thead tr th.ColumnQua
}
table#SortByName thead tr th.ColumnSurname a, table#SortByCount thead tr th.ColumnQuantity a {
background-color:#DD9091;
color:#FFF;
color:#FAFAFA;
}
table#SortByName thead tr th.ColumnSurname a:after, table#SortByCount thead tr th.ColumnQuantity a:after {
content:" ↓";
}
table.infolist tbody tr td.ColumnSurname {
padding:0;
background-color:#FFF;
background-color:#FAFAFA;
}
table.infolist tbody tr td.ColumnSurname a {
padding:.1em 10px;
@ -529,7 +521,7 @@ table.surname thead tr th.ColumnParents, table.surname tbody tr td.ColumnParents
#Individuals table.individuallist tbody tr td a:hover {
background-color:#DD9091;
text-decoration:none;
color:#FFF;
color:#FAFAFA;
}
table.individuallist tbody tr td.ColumnSurname {
background:none;
@ -540,7 +532,7 @@ table.individuallist tbody tr td.ColumnSurname a:hover, table.individuallist tbo
background:none;
}
table.individuallist tbody tr td.ColumnName {
background-color:#FFF;
background-color:#FAFAFA;
padding:0;
}
table.individuallist tbody tr td.ColumnName a {
@ -607,7 +599,7 @@ table.individuallist tbody tr td.ColumnName a:hover { }
padding:.1em 10px .3em 10px;
}
#Gallery table.infolist tbody tr td.ColumnName a:hover {
color:#FFF;
color:#FAFAFA;
}
#GalleryNav {
font-size:.8em;
@ -618,12 +610,12 @@ table.individuallist tbody tr td.ColumnName a:hover { }
#GalleryNav a {
font-weight:bold;
text-decoration:none;
background-color:#FFF;
background-color:#FAFAFA;
border:solid 1px #DD909A;
}
#GalleryNav a:hover {
background-color:#DD9091;
color:#FFF;
color:#FAFAFA;
}
#GalleryNav a#Previous {
padding:.4em .7em .3em .7em;
@ -663,7 +655,7 @@ table.individuallist tbody tr td.ColumnName a:hover { }
margin-top:1.5em;
margin-bottom:0;
padding-bottom:0;
background-color:#FFF;
background-color:#FAFAFA;
border-style:solid;
border-width:8px 0 0 0;
border-color:#DD9091;
@ -698,7 +690,7 @@ table.individuallist tbody tr td.ColumnName a:hover { }
}
#streetaddress {
background-color:#208BAA;
color:#FFF;
color:#FAFAFA;
width:85%;
}
#city:after {
@ -975,7 +967,7 @@ div#sourcerefs ol li ol {
position:relative;
z-index:10;
display:block;
color:#FFF;
color:#FAFAFA;
text-align:center;
vertical-align:middle;
text-decoration:none;
@ -993,7 +985,7 @@ div#sourcerefs ol li ol {
margin:5px;
width:160px;
padding:5px 5px 7px 5px;
color:#FFF;
color:#FAFAFA;
}
.boxbg div:hover {
position:relative;
@ -1002,38 +994,38 @@ div#sourcerefs ol li ol {
width:210px;
padding:10px 4px 12px 4px;
background-color:#153282;
color:#FFF;
color:#FAFAFA;
}
.boxbg div a:hover {
position:relative;
z-index:999;
font-size:1em;
width:210px;
color:#FFF;
color:#FAFAFA;
}
.male {
background-color:#1E90FF;
color:#FFF;
color:#FAFAFA;
}
.male div {
background-color:#1e90ff;
color:#FFF;
color:#FAFAFA;
}
.female {
background-color:#F3C;
color:#FFF;
color:#FAFAFA;
}
.female div {
background-color:#F3C;
color:#FFF;
color:#FAFAFA;
}
.unknown {
background-color:#000;
color:#FFF;
color:#FAFAFA;
}
.unknown div {
background-color:#000;
color:#FFF;
color:#FAFAFA;
}
.shadow {
@ -1090,7 +1082,7 @@ div#sourcerefs ol li ol {
#footer p#copyright {
margin:1em;
float:right;
color:#FFF;
color:#FAFAFA;
}
#footer p#copyright p {
margin:0;
@ -1102,19 +1094,19 @@ div#sourcerefs ol li ol {
#footer p#createdate {
float:left;
margin-left:10px;
color:#FFF;
color:#FAFAFA;
}
#footer p#createdate a {
color:#FFF;
color:#FAFAFA;
text-decoration:none;
}
#footer p#quality {
float:center;
text-align:center;
color:#FFF;
color:#FAFAFA;
}
#footer p#quality a {
color:#FFF;
color:#FAFAFA;
text-decoration:none;
}
#footer p#quality img {

File diff suppressed because it is too large Load Diff

View File

@ -70,10 +70,14 @@ dist_pkgdata_DATA = \
document.png\
image-missing.png\
favicon.ico\
NWeb_Mainz_Bkgd.png\
NWeb_Mainz_Header.png\
NWeb_Mainz_MidLight.png\
NWeb_Mainz_Mid.png\
Web_Mainz_Bkgd.png\
Web_Mainz_Header.png\
Web_Mainz_MidLight.png\
Web_Mainz_Mid.png\
Web_Gender_Male.png\
Web_Gender_Female.png\
Web_Gender_MaleFFF.png\
Web_Gender_FemaleFFF.png\
arrow102.gif\
arrow231.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@ -6,6 +6,7 @@
# Copyright (C) 2007 Gary Burton <gary.burton@zen.co.uk>
# Copyright (C) 2007-2008 Stephane Charette <stephanecharette@gmail.com>
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2008 Jason M. Simanek <jason@bohemianalps.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -114,9 +115,14 @@ _XOFFSET = 5
# stylesheets.
_CSS_FILES = [
# First is used as default selection.
[_("Evergreen"), 'Web_Evergreen.css'],
[_("Nebraska"), 'Web_Nebraska.css'],
[_("Simply Red"), 'Web_Simply-Red.css'],
[_("Basic-Ash"), 'Web_Basic-Ash.css'],
[_("Basic-Cypress"), 'Web_Basic-Cypress.css'],
[_("Basic-Lilac"), 'Web_Basic-Lilac.css'],
[_("Basic-Peach"), 'Web_Basic-Peach.css'],
[_("Basic-Spruce"), 'Web_Basic-Spruce.css'],
[_("Mainz"), 'Web_Mainz.css'],
[_("Nebraska"), 'Web_Nebraska.css'],
[_("Visually Impaired"), 'Web_Visually.css'],
[_("No style sheet"), ''],
]
@ -359,10 +365,7 @@ class BasePage:
of.write('</head>\n\n')
of.write('<body id="NarrativeWeb">\n') # Terminated in write_footer()
of.write(' <div id="header">\n')
# FIXME. Do we want an empty GRAMPSinfo div below if no self.linkhome?
msg = ""
of.write('<div id="header">\n')
db = self.report.database
if self.linkhome:
@ -370,26 +373,24 @@ class BasePage:
if home_person:
home_person_url = self.report.build_url_fname_html(home_person.handle, 'ppl', self.up)
home_person_name = home_person.get_primary_name().get_regular_name()
msg = _('Created for <a href="%s">%s</a>') % (home_person_url, home_person_name)
of.write(' <div id="GRAMPSinfo">%s</div>\n' % msg)
of.write(' <h1 id="SiteTitle">%s</h1>\n' % html_escape(self.title_str))
of.write('\t<h1 id="SiteTitle">%s</h1>\n' % html_escape(self.title_str))
header = self.report.options['headernote']
if header:
note = db.get_note_from_gramps_id(header)
of.write(' <p id="user_header">')
of.write('\t<p id="user_header">')
of.write(note.get())
of.write('</p>\n')
of.write('\t</div>\n')
of.write('</div>\n\n')
# Begin Navigation Menu
of.write(' <div id="navigation">\n')
of.write(' <ul>\n')
of.write('<div id="navigation">\n')
of.write('\t<ul>\n')
self.display_nav_links(of, title)
of.write(' </ul>\n')
of.write(' </div>\n') # End Navigation Menu
of.write('\t</ul>\n')
of.write('</div>\n') # End Navigation Menu
divid = ''
if content_divid:
@ -666,9 +667,12 @@ class BasePage:
of.write('\t</div>\n')
def person_link(self, of, url, name, gid=None, thumbnailUrl=None):
of.write('<a href="%s">' % url)
of.write('<a href="%s"' % url)
if not thumbnailUrl:
of.write(' class="noThumb"')
of.write('>')
if thumbnailUrl:
of.write('<img src="%s"><br />' % thumbnailUrl)
of.write('<span class="thumbnail"><img src="%s" width="" height="" alt="Image of %s" /></span>' % (thumbnailUrl, name))
of.write('%s' % name)
if not self.noid and gid:
of.write('&nbsp;<span class="grampsid">[%s]</span>' % gid)
@ -1772,16 +1776,16 @@ class IndividualPage(BasePage):
xoff = _XOFFSET+col*(_WIDTH+_HGAP)
sex = person.get_gender()
if sex == gen.lib.Person.MALE:
divclass = "boxbg male"
divclass = "male"
elif sex == gen.lib.Person.FEMALE:
divclass = "boxbg female"
divclass = "female"
else:
divclass = "boxbg unknown"
of.write('\t\t\t<div class="%s" style="top: %dpx; left: %dpx;">\n' % (divclass, top, xoff+1))
of.write('\t\t\t\t<div class="box">')
divclass = "unknown"
of.write('\t\t\t<div class="boxbg %s AncCol%s" style="top: %dpx; left: %dpx;">\n' % (divclass, col, top, xoff+1))
of.write('\t\t\t\t')
if person.handle in self.ind_list:
thumbnailUrl = None
if self.use_gallery and col < 3:
if self.use_gallery and col < 5:
photolist = person.get_media_list()
if photolist:
photo_handle = photolist[0].get_reference_handle()
@ -1795,8 +1799,7 @@ class IndividualPage(BasePage):
self.person_link(of, url, person_name, thumbnailUrl=thumbnailUrl)
else:
of.write(_nd.display(person))
of.write('</div>\n')
of.write('\t\t\t</div>\n')
of.write('\n\t\t\t</div>\n')
of.write('\t\t\t<div class="shadow" style="top: %dpx; left: %dpx;"></div>\n' % (top+_SHADOW, xoff+_SHADOW))
def extend_line(self, of, y0, x0):
@ -2012,8 +2015,10 @@ class IndividualPage(BasePage):
# table head
of.write('\t\t\t<thead>\n')
of.write('\t\t\t\t<tr>\n')
for h in (_('event|Type'), _('Date'), _('Place'), _('Description'), _('Notes')):
of.write('\t\t\t\t<th>%s</th>' % h)
of.write('\t\t\t\t\t<th>%s</th>\n' % h)
of.write('\t\t\t\t</tr>\n')
of.write('\t\t\t</thead>\n')
of.write('\t\t\t<tbody>\n')
@ -2078,6 +2083,10 @@ class IndividualPage(BasePage):
done_first_note = False
notelist = event.get_note_list()
notelist.extend(event_ref.get_note_list())
if notelist:
of.write('\t\t\t\t\t\t<ol>\n')
else:
of.write('\t\t\t\t\t\t&nbsp;\n')
for notehandle in notelist:
note = db.get_note_from_handle(notehandle)
if note:
@ -2088,11 +2097,9 @@ class IndividualPage(BasePage):
else:
# TODO. Decide what to do with multiline notes.
txt = u" ".join(note_text.split("\n"))
if not done_first_note:
of.write('\t\t\t\t\t\t<ol>\n')
txt = txt or '&nbsp;'
of.write('\t\t\t\t\t\t\t<li>%s</li>\n' % txt)
if done_first_note:
if notelist:
of.write('\t\t\t\t\t\t</ol>\n')
of.write('\t\t\t\t\t</td>\n')
@ -2497,9 +2504,9 @@ class IndividualPage(BasePage):
date = _dd.display(event.get_date_object())
if date and place:
text = _("%(date)s &nbsp; at &nbsp; %(place)s") % { 'date': date, 'place': place }
text = _('%(date)s <span class="preposition">at</span> %(place)s') % { 'date': date, 'place': place }
elif place:
text = _("at &nbsp; %(place)s") % { 'place': place }
text = _('<span class="preposition">at</span> %(place)s') % { 'place': place }
elif date:
text = date
else:
@ -2704,10 +2711,10 @@ class NavWebReport(Report):
imgs = []
if self.css == "Web_Mainz.css":
# Copy Mainz Style Images
imgs += ["NWeb_Mainz_Bkgd.png",
"NWeb_Mainz_Header.png",
"NWeb_Mainz_Mid.png",
"NWeb_Mainz_MidLight.png",
imgs += ["Web_Mainz_Bkgd.png",
"Web_Mainz_Header.png",
"Web_Mainz_Mid.png",
"Web_Mainz_MidLight.png",
"document.png"]
# Copy the Creative Commons icon if the Creative Commons
@ -2715,7 +2722,11 @@ class NavWebReport(Report):
if 0 < self.copyright < 7:
imgs += ["somerights20.gif"]
imgs += ["favicon.ico"]
imgs += ["favicon.ico",
"Web_Gender_Female.png",
"Web_Gender_FemaleFFF.png",
"Web_Gender_Male.png",
"Web_Gender_MaleFFF.png"]
for f in imgs:
from_path = os.path.join(const.IMAGE_DIR, f)

View File

@ -103,10 +103,15 @@ _ARROW_GIF = "arrow102.gif"
# stylesheets.
_CSS_FILES = [
# First is used as default selection.
[_("Evergreen"), 'Web_Evergreen.css'],
[_("Nebraska"), 'Web_Nebraska.css'],
[_("Simply Red"), 'Web_Simply-Red.css'],
[_("No style sheet"), ''],
[_("Basic-Ash"), 'Web_Basic-Ash.css'],
[_("Basic-Cypress"), 'Web_Basic-Cypress.css'],
[_("Basic-Lilac"), 'Web_Basic-Lilac.css'],
[_("Basic-Peach"), 'Web_Basic-Peach.css'],
[_("Basic-Spruce"), 'Web_Basic-Spruce.css'],
[_("Mainz"), 'Web_Mainz.css'],
[_("Nebraska"), 'Web_Nebraska.css'],
[_("Visually Impaired"), 'Web_Visually.css'],
[_("No style sheet"), ''],
]
_CHARACTER_SETS = [
@ -262,6 +267,7 @@ class WebCalReport(Report):
self.warn_dir = True # Only give warning once.
self.has_arrow_gif = False # Set to True after copying to destination
self.imgs = []
calendar.setfirstweekday(_dow_gramps2iso[self.start_dow])
@ -406,6 +412,10 @@ class WebCalReport(Report):
fname = os.path.join(const.IMAGE_DIR, 'somerights20.gif')
self.copy_file(fname, 'somerights20.gif', 'images')
for f in self.imgs:
from_path = os.path.join(const.IMAGE_DIR, f)
self.copy_file(from_path, f, "images")
def display_month_navs(self, of, currentsection, use_home=False):
"""
Will create and display the navigation menu bar
@ -435,8 +445,8 @@ class WebCalReport(Report):
item = [('blankyear', _('Blank Calendar'), self.blankyear)]
navs.append(item)
of.write(' <div id="navigation">\n')
of.write(' <ul>\n')
of.write('<div id="navigation">\n')
of.write('\t<ul>\n')
for item in navs:
for url_fname, nav_text, cond in item:
@ -466,16 +476,10 @@ class WebCalReport(Report):
url += self.ext
cs = cs and ' id="CurrentSection"' or ''
of.write('\t\t<li%s><a href="%s">%s</a></li>\n' % (cs, url, nav_text))
of.write(' <li%s><a name="%s" href="%s">%s</a></li>\n'
% (cs, url_fname, url, nav_text))
of.write(' </ul>\n')
if self.multiyear:
of.write(' </div>\n')
else:
of.write(' </div>\n\n')
of.write('\t</ul>\n')
of.write('</div>\n\n')
def display_year_navs(self, of, currentsection):
"""
@ -485,8 +489,8 @@ class WebCalReport(Report):
if not self.multiyear:
return
of.write(' <div id="navigation">\n')
of.write(' <ul>\n')
of.write('<div id="navigation">\n')
of.write('\t<ul>\n')
cols = 0
cal_year = self.start_year
while ((0 <= cols <= 25) and (self.start_year <= cal_year <= self.end_year)):
@ -518,8 +522,7 @@ class WebCalReport(Report):
# if True, highlight currentsection
cs = cs and ' id="CurrentSection"' or ''
of.write(' <li%s><a href="%s">%s</a></li>\n'
% (cs, url, str(cal_year)))
of.write('\t\t<li%s><a href="%s">%s</a></li>\n' % (cs, url, str(cal_year)))
# increase year
cal_year += 1
@ -527,8 +530,8 @@ class WebCalReport(Report):
# increase column
cols += 1
of.write(' </ul>\n')
of.write(' </div>\n\n')
of.write('\t</ul>\n')
of.write('</div>\n\n')
def calendar_common(self, of, currsec1, currsec2, title, body_id, year, use_home=False):
"""
@ -545,19 +548,18 @@ class WebCalReport(Report):
of.write('<body id="%s">\n' % body_id)
# Header Title
of.write(' <div id="header" />\n')
of.write(' <h1 id="SiteTitle" />%s</h1>\n' % title)
of.write('<div id="header" />\n')
of.write('\t<h1 id="SiteTitle" />%s</h1>\n' % title)
if self.author != '':
of.write(' <div id="GRAMPSinfo" />')
of.write('\t<p id="CreatorInfo">')
if self.email != '':
msg = _('Created for <a href="mailto:%(email)s?subject=WebCal" />%(author)s</a>\n') % {
msg = _('Created for <a href="mailto:%(email)s?subject=WebCal">%(author)s</a>\n') % {
'email' : self.email,
'author' : self.author}
else:
msg = _('Created for %(author)s\n') % {'author' : self.author}
of.write('%s' % msg)
of.write(' </div>\n') # end GRAMPSinfo
of.write(' </div>\n') # end header
of.write('%s</p>\n' % msg)
of.write('</div>\n') # end header
# adjust the months being created if self.partyear is True
# and year is eequal to current year, then start_month is current month
@ -619,22 +621,22 @@ class WebCalReport(Report):
if not self.multiyear:
th_txt = '%s %d' % (month_name, year)
of.write('<!-- %s -->\n\n' % month_name)
of.write(' <table id="%s" class="calendar">\n' % month_name)
of.write(' <thead>\n')
of.write(' <tr>\n')
of.write(' <th colspan="7" class="monthName">%s</th>\n' % th_txt)
of.write(' </tr>\n')
of.write('<table id="%s" class="calendar">\n' % month_name)
of.write('\t<thead>\n')
of.write('\t\t<tr>\n')
of.write('\t\t\t<th colspan="7" class="monthName">%s</th>\n' % th_txt)
of.write('\t\t</tr>\n')
# Calendar weekday names header
of.write(' <tr>\n')
of.write('\t\t<tr>\n')
for day_col in range(7):
dayclass = get_class_for_daycol(day_col)
of.write(' <th class="%s">%s</th>\n' % (dayclass, get_name_for_daycol(day_col)))
of.write(' </tr>\n')
of.write(' </thead>\n')
of.write('\t\t\t<th class="%s">%s</th>\n' % (dayclass, get_name_for_daycol(day_col)))
of.write('\t\t</tr>\n')
of.write('\t</thead>\n')
# begin table body
of.write(' <tbody>\n')
of.write('\t<tbody>\n')
# Compute the first day to display for this month.
# It can also be a day in the previous month.
@ -659,7 +661,7 @@ class WebCalReport(Report):
nweeks = len(monthinfo)
for week_row in range(0, nweeks):
week = monthinfo[week_row]
of.write(' <tr class="week%d">\n' % week_row)
of.write('\t\t<tr class="week%d">\n' % week_row)
for day_col in range(0, 7):
dayclass = get_class_for_daycol(day_col)
@ -674,23 +676,21 @@ class WebCalReport(Report):
specclass = "next " + dayclass
if specclass[0] == 'p': # previous day of last month
of.write(' <td id="prevday%d" ' % specday)
of.write('\t\t\t<td id="prevday%d" ' % specday)
else: # next day of next month
of.write(' <td id="nextday%d" ' % specday)
of.write('\t\t\t<td id="nextday%d" ' % specday)
of.write('class="%s">\n' % specclass)
# span class is used here to differentiate between previous/next days versus calendar days
of.write(' <span class="date">%d</span>\n' % specday)
of.write(' </td>\n')
of.write('\t\t\t\t<div class="date">%d</div>\n' % specday)
of.write('\t\t\t</td>\n')
else: # normal day number in current month
if cal == "by": # blank_year() doesn't need any highlighting or hyperlinks
of.write(' <td id="day%d" class="%s">\n' % (day, dayclass))
of.write(' <div class="date">%d</div>\n' % day)
of.write(' </td>\n')
of.write('\t\t\t<td id="day%d" class="%s">\n' % (day, dayclass))
of.write('\t\t\t\t<div class="date">%d</div>\n' % day)
of.write('\t\t\t</td>\n')
else:
thisday = datetime.date.fromordinal(current_ord)
of.write(' <td id="day%d" ' % day)
of.write('\t\t\t<td id="day%d" ' % day)
if thisday.month == month: # Something this month
holiday_list = self.holidays.get(month, {}).get(thisday.day, [])
bday_anniv_list = self.calendar.get(month, {}).get(thisday.day, [])
@ -701,13 +701,14 @@ class WebCalReport(Report):
# Year at a Glance
if cal == "yg":
of.write(' <a name="%s%d" href="%s/%s%d%s" title="%s%d">\n'
of.write('\t\t\t\t<a id="%s%d" href="%s/%s%d%s" title="%s%d">\n'
% (shrt_month, day, lng_month, shrt_month, day, self.ext, shrt_month, day))
of.write(' <div class="date">%d</div></a>\n' % day)
of.write('\t\t\t\t\t<div class="date">%d</div>\n' % day)
of.write('\t\t\t\t</a>\n')
# WebCal
elif cal == 'wc':
of.write(' <div class="date">%d</div>\n' % day)
of.write('\t\t\t\t<div class="date">%d</div>\n' % day)
# year_glance() and print_page() both need this to itemize the list
self.one_day(of, evt_date, cal, holiday_list, bday_anniv_list)
@ -715,21 +716,21 @@ class WebCalReport(Report):
# no holiday/ bday/ anniversary this day
else:
of.write('class="%s">\n' % dayclass)
of.write(' <div class="date">%d</div>\n' % day)
of.write('\t\t\t\t<div class="date">%d</div>\n' % day)
# no holiday/ bday/ anniversary this month
else:
of.write('class="%s">\n' % dayclass)
of.write(' <div class="date">%d</div>\n' % day)
of.write('\t\t\t\t<div class="date">%d</div>\n' % day)
# close the day/ column
of.write(' </td>\n')
# close the day/ column
of.write('\t\t\t</td>\n')
# change day number
current_ord += 1
# close the week/ row
of.write(' </tr>\n')
of.write('\t\t</tr>\n')
def write_header(self, of, title, skip_print=None):
"""
@ -738,18 +739,18 @@ 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(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n ')
of.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n')
of.write(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n')
of.write('<html xmlns="http://www.w3.org/1999/xhtml" ')
xmllang = Utils.xml_lang()
of.write('xml:lang="%s" lang="%s">\n' % (xmllang, xmllang))
of.write('<head>\n')
of.write(' <title>%s</title>\n' % title)
of.write(' <meta http-equiv="Content-Type" content="text/html;charset=%s" />\n'
of.write('\t<title>%s</title>\n\n' % title)
of.write('\t<meta http-equiv="Content-Type" content="text/html;charset=%s" />\n'
% self.encoding)
of.write(' <meta name="robots" content="noindex" />\n')
of.write(' <meta name="generator" content="GRAMPS 3.1.x: http://www.gramps-project.org" />\n')
of.write(' <meta name="author" content="%s" />\n' % self.author)
of.write('\t<meta name="robots" content="noindex" />\n')
of.write('\t<meta name="generator" content="GRAMPS 3.1.x: http://www.gramps-project.org" />\n')
of.write('\t<meta name="author" content="%s" />\n\n' % self.author)
subdirs = ['..'] * self.nr_up
# Note. We use '/' here because it is a URL, not a OS dependent pathname
@ -758,19 +759,19 @@ class WebCalReport(Report):
fname3 = '/'.join(subdirs + ['images'] + ['favicon.ico'])
# link to _CALENDARSCREEN stylesheet
of.write(' <link rel="stylesheet" href="%s" type="text/css" media="screen" />\n' % fname1)
of.write('\t<link rel="stylesheet" href="%s" type="text/css" media="screen" />\n' % fname1)
# link to _CALENDARPRINT stylesheet
if not skip_print:
of.write(' <link rel="stylesheet" href="%s" type="text/css" media="print" />\n' % fname2)
of.write('\t<link rel="stylesheet" href="%s" type="text/css" media="print" />\n' % fname2)
# link to GRAMPS favicon
of.write(' <link rel="shortcut icon" href="%s" type="image/icon" />\n' % fname3)
of.write('\t<link rel="shortcut icon" href="%s" type="image/icon" />\n' % fname3)
# Add calendar specific embedded style if required
if self.mystyle: # no extra embedded styling necessary
of.write(self.mystyle)
of.write('</head>\n')
of.write('</head>\n\n')
def write_footer(self, of):
"""
@ -786,8 +787,8 @@ class WebCalReport(Report):
msg = _('Generated by <a href="http://gramps-project.org" target="_blank">'
'GRAMPS</a> on %(date)s') % {'date' : value}
of.write(' <div id="footer">\n')
of.write(' <p id="createdate">%s</p>\n' % msg)
of.write('<div id="footer">\n')
of.write('\t<p id="createdate">%s</p>\n' % msg)
if 0 < self.copy < len(_CC):
subdirs = ['..'] * self.nr_up
@ -798,11 +799,11 @@ class WebCalReport(Report):
self.use_copyright = True
else:
text = "&copy; %s %s" % (self.today.year, self.author)
of.write(' <p id="copyright">%s</p>\n' % text)
of.write(' <p id="quality"><a href="http://validator.w3.org/check?uri=referer">')
of.write('\t<p id="copyright">%s</p>\n' % text)
of.write('\t<p id="quality"><a href="http://validator.w3.org/check?uri=referer">')
of.write('<img src="http://www.w3.org/Icons/valid-xhtml10" ')
of.write('alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a></p>\n')
of.write(' </div>\n')
of.write('</div>\n')
of.write('</body>\n')
of.write('</html>\n')
@ -950,40 +951,25 @@ class WebCalReport(Report):
# create calendar common info for each calendar
self.calendar_common(of, lng_month, str(year), _('One Day Within A Year'), my_date, year)
of.write(' <h1 id="OneDay" style="display:block;">%s</h1>\n' % my_date)
of.write('\t<h1 id="OneDay">%s</h1>\n' % my_date)
if self.has_arrow_gif:
of.write(' <ul id="arrow">\n')
of.write('\t<ul id="arrow">\n')
else:
of.write(' <ul>\n')
of.write('\t<ul>\n')
# WebCal
else:
of.write(' <ul>\n')
of.write('\t<ul>\n')
for line in day_list:
for date, text, event in line:
of.write('\t\t<li>%s</li>\n' % text)
# "WebCal" needs more spacing than "Year At A Glance"
if cal == 'wc':
of.write(' <li>')
else:
of.write(' <li>')
of.write('%s\n' % text)
of.write('\t</ul>\n')
if cal == 'wc':
of.write(' </li>\n')
else:
of.write(' </li>\n')
# WebCal needs 25 spaces
if cal == 'wc':
of.write(' </ul>\n')
# "Yeatr At A Glance"
# Only close the file for "Year At A Glance"
if cal == 'yg':
# year_glance needs 13 spaces
of.write(' </ul>\n')
self.write_footer(of)
self.close_file(of)
@ -1031,8 +1017,8 @@ class WebCalReport(Report):
self.calendar_build(of, 'by', year, month)
# close table body
of.write(' </tbody>\n')
of.write(' </table>\n\n')
of.write('\t</tbody>\n')
of.write('</table>\n\n')
# increase progress bar
self.progress.step()
@ -1090,11 +1076,11 @@ class WebCalReport(Report):
self.progress.set_pass(_('Creating Year At A Glance calendars'), (self.end_month - self.start_month))
# page description
of.write(' <p id="description">\n')
of.write(_(' This calendar is meant to give you access to all your data at a glance '
'compressed into one page. Clicking on a <b>red square</b> will take you to a '
of.write('<p id="description">\n')
of.write(_('This calendar is meant to give you access to all your data at a glance '
'compressed into one page. Clicking on a <strong>red square</strong> will take you to a '
'page that shows all the events for that date!\n'))
of.write(' </p>\n\n')
of.write('</p>\n\n')
for month in range(self.start_month, (self.end_month + 1)):
@ -1103,25 +1089,25 @@ class WebCalReport(Report):
# Note. The week rows are filled up to make them all 6 weeks long.
nweeks = len(calendar.monthcalendar(self.year, month))
for i in range(nweeks+1, 7):
of.write(' <tr class="week%d">\n' % i)
of.write(' <td id="emptyDays" colspan="7">\n')
of.write(' </td>\n')
of.write(' </tr>\n')
of.write('\t\t<tr class="week%d">\n' % i)
of.write('\t\t\t<td id="emptyDays" colspan="7">\n')
of.write('\t\t\t</td>\n')
of.write('\t\t</tr>\n')
# close table body before writing note
of.write(' </tbody>\n')
of.write('\t</tbody>\n')
# create note section for "Year At A Glance"
note = self.month_notes[month-1].strip()
note = note or "&nbsp;"
of.write(' <tfoot>\n')
of.write(' <tr>\n')
of.write(' <td class="note" colspan="7">\n')
of.write(' %s\n' % note)
of.write(' </td>\n')
of.write(' </tr>\n')
of.write(' </tfoot>\n')
of.write(' </table>\n\n')
of.write('\t<tfoot>\n')
of.write('\t\t<tr>\n')
of.write('\t\t\t<td class="note" colspan="7">\n')
of.write('\t\t\t\t%s\n' % note)
of.write('\t\t\t</td>\n')
of.write('\t\t</tr>\n')
of.write('\t</tfoot>\n')
of.write('</table>\n\n')
# increase progress bar
self.progress.step()
@ -1153,6 +1139,14 @@ class WebCalReport(Report):
# get data from database for birthdays/ anniversaries
self.collect_data()
if self.css == "Web_Mainz.css":
# Copy Mainz Style Images
self.imgs += ["Web_Mainz_Bkgd.png",
"Web_Mainz_Header.png",
"Web_Mainz_Mid.png",
"Web_Mainz_MidLight.png",
]
# Copy all files for the calendars being created
self.copy_calendar_files()
@ -1259,17 +1253,17 @@ class WebCalReport(Report):
self.calendar_build(of, 'wc', year, month)
# close table body before note section
of.write(' </tbody>\n')
of.write('\t</tbody>\n')
# create note section for "WebCal"
note = self.month_notes[month-1].strip()
note = note or "&nbsp;"
of.write(' <tfoot>\n')
of.write(' <tr>\n')
of.write(' <td class="note" colspan="7">%s</td>\n' % note)
of.write(' </tr>\n')
of.write(' </tfoot>\n')
of.write(' </table>\n\n')
of.write('\t<tfoot>\n')
of.write('\t\t<tr>\n')
of.write('\t\t\t<td class="note" colspan="7">%s</td>\n' % note)
of.write('\t\t</tr>\n')
of.write('\t</tfoot>\n')
of.write('</table>\n\n')
# write footer section, and close file
self.write_footer(of)
@ -1471,7 +1465,7 @@ class WebCalOptions(MenuReportOptions):
partyear = BooleanOption(_('Create Partial Year calendar'), False)
partyear.set_help(_('Create a partial year calendar. The start month will be'
'equal to the current month to the end of the year.'))
' equal to the current month to the end of the year.'))
menu.add_option(category_name, 'partyear', partyear)
self.__multiyear = BooleanOption(_('Create multiple year calendars'), False)