Updated work in WebCal. Updated style elements to match current work.
svn: r13193
This commit is contained in:
@ -322,9 +322,18 @@ div#alphabet ul li.letters a:hover {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 52px;
|
height: 52px;
|
||||||
}
|
}
|
||||||
|
body#WebCal #navigation, body#fullyearlinked #navigation {
|
||||||
|
position: fixed;
|
||||||
|
top: 100px;
|
||||||
|
width: 100%;
|
||||||
|
height: 56px;
|
||||||
|
}
|
||||||
#subnavigation {
|
#subnavigation {
|
||||||
margin:0;
|
position: fixed;
|
||||||
padding:0;
|
top: 136px;
|
||||||
|
width: 100%;
|
||||||
|
height: 56px;
|
||||||
|
border-top: solid 2px #5D835F;
|
||||||
}
|
}
|
||||||
#navigation ul, #subnavigation ul {
|
#navigation ul, #subnavigation ul {
|
||||||
list-style:none;
|
list-style:none;
|
||||||
@ -1380,7 +1389,7 @@ div#pedigree {
|
|||||||
-------------------------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------------------------- */
|
||||||
/* Calendar : General */
|
/* Calendar : General */
|
||||||
body#WebCal {
|
body#WebCal {
|
||||||
padding:0 14px;
|
padding: 172px 14px 0px 14px;
|
||||||
background-color: #542;
|
background-color: #542;
|
||||||
}
|
}
|
||||||
.calendar {
|
.calendar {
|
||||||
@ -1523,6 +1532,9 @@ body#WebCal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Calendar : Full Year */
|
/* Calendar : Full Year */
|
||||||
|
body#fullyearlinked {
|
||||||
|
padding: 144px 14px 0px 14px;
|
||||||
|
}
|
||||||
body#fullyearlinked div.content {
|
body#fullyearlinked div.content {
|
||||||
width:963px;
|
width:963px;
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
|
@ -360,7 +360,7 @@ class WebCalReport(Report):
|
|||||||
const.URL_HOMEPAGE)
|
const.URL_HOMEPAGE)
|
||||||
_META2 = 'name="author" content="%s"' % self.author
|
_META2 = 'name="author" content="%s"' % self.author
|
||||||
|
|
||||||
page, head, body = Html.page(title=title, encoding=self.encoding, lang=xmllang)
|
page, head, body = Html.page(title, self.encoding, xmllang)
|
||||||
|
|
||||||
# GRAMPS favicon
|
# GRAMPS favicon
|
||||||
fname1 = '/'.join([subdirs] + ['images'] + ['favicon.ico'])
|
fname1 = '/'.join([subdirs] + ['images'] + ['favicon.ico'])
|
||||||
@ -369,19 +369,22 @@ class WebCalReport(Report):
|
|||||||
fname2 = '/'.join([subdirs] + ['styles'] + [_CALENDARSCREEN])
|
fname2 = '/'.join([subdirs] + ['styles'] + [_CALENDARSCREEN])
|
||||||
|
|
||||||
# create additional meta tags
|
# create additional meta tags
|
||||||
meta = Html('meta', attr = _META1) + (
|
meta = Html("meta", attr = _META1) + (
|
||||||
Html('meta', attr = _META2,indent=False)
|
Html("meta", attr = _META2, indent=False)
|
||||||
)
|
)
|
||||||
|
|
||||||
# links for GRAMPS favicon and stylesheets
|
# links for GRAMPS favicon and stylesheets
|
||||||
links = Html('link',rel='shortcut icon', href=fname1,type='image/x-icon') + (
|
links = Html("link", rel='shortcut icon', href=fname1,
|
||||||
Html('link',rel='stylesheet', href=fname2,type='text/css',media='screen',indent=False)
|
type = "image/x-icon") + (
|
||||||
|
Html("link",rel="stylesheet", href=fname2, type="text/css", media= "screen",
|
||||||
|
indent = False)
|
||||||
)
|
)
|
||||||
|
|
||||||
# add printer stylesheet to webcalendar() and one_day() only
|
# add printer stylesheet to webcalendar() and one_day() only
|
||||||
if add_print:
|
if add_print:
|
||||||
fname = '/'.join([subdirs] + ['styles'] + [_CALENDARPRINT])
|
fname = '/'.join([subdirs] + ['styles'] + [_CALENDARPRINT])
|
||||||
links += Html('link',rel='stylesheet', href=fname,type='text/css',media='print',indent=False)
|
links += Html("link",rel="stylesheet", href=fname,type="text/css",
|
||||||
|
media="print",indent = False)
|
||||||
|
|
||||||
# add additional meta tags and stylesheet links to head section
|
# add additional meta tags and stylesheet links to head section
|
||||||
head += (meta, links)
|
head += (meta, links)
|
||||||
@ -390,10 +393,10 @@ class WebCalReport(Report):
|
|||||||
body.attr = 'id="%s"' % body_id
|
body.attr = 'id="%s"' % body_id
|
||||||
|
|
||||||
# start header division section
|
# start header division section
|
||||||
headerdiv = Html('div', id="header") + (
|
headerdiv = Html("div", id="header") + (
|
||||||
|
|
||||||
# page title
|
# page title
|
||||||
Html('h1', title, id = "SiteTitle",inline=True),
|
Html("h1", title, id = "SiteTitle", inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Created for ?
|
# Created for ?
|
||||||
@ -404,7 +407,7 @@ class WebCalReport(Report):
|
|||||||
'author' : self.author}
|
'author' : self.author}
|
||||||
else:
|
else:
|
||||||
msg = _('Created for %(author)s') % {'author' : self.author}
|
msg = _('Created for %(author)s') % {'author' : self.author}
|
||||||
headerdiv += Html('p', msg, id="CreatorInfo")
|
headerdiv += Html("p", msg, id="CreatorInfo")
|
||||||
|
|
||||||
# add header division to body
|
# add header division to body
|
||||||
body += headerdiv
|
body += headerdiv
|
||||||
@ -441,12 +444,12 @@ class WebCalReport(Report):
|
|||||||
nrows = get_num_of_rows(num_years, years_in_row)
|
nrows = get_num_of_rows(num_years, years_in_row)
|
||||||
|
|
||||||
# begin year division and table
|
# begin year division and table
|
||||||
yearnav = Html('div', id="navigation")
|
yearnav = Html("div", id="navigation")
|
||||||
year_table = Html('table')
|
year_table = Html("table")
|
||||||
|
|
||||||
for rows in range(0, nrows):
|
for rows in range(0, nrows):
|
||||||
tabrow = Html('tr')
|
trow = Html("tr")
|
||||||
unordered = Html('ul')
|
unordered = Html("ul")
|
||||||
cols = 1
|
cols = 1
|
||||||
while (cols <= years_in_row and cal_year <= self.end_year):
|
while (cols <= years_in_row and cal_year <= self.end_year):
|
||||||
url = ''
|
url = ''
|
||||||
@ -465,10 +468,10 @@ class WebCalReport(Report):
|
|||||||
|
|
||||||
# Figure out if we need <li class="CurrentSection"> or just plain <li>
|
# Figure out if we need <li class="CurrentSection"> or just plain <li>
|
||||||
cs = str(cal_year) == currentsection and 'class="CurrentSection"' or ''
|
cs = str(cal_year) == currentsection and 'class="CurrentSection"' or ''
|
||||||
unordered += Html('li', attr=cs ,inline=True) + (
|
unordered += Html("li", attr=cs , inline = True) + (
|
||||||
|
|
||||||
# create hyperlink
|
# create hyperlink
|
||||||
Html('a', str(cal_year), href = url,inline=True)
|
Html("a", str(cal_year), href = url, inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# increase columns
|
# increase columns
|
||||||
@ -478,10 +481,10 @@ class WebCalReport(Report):
|
|||||||
cal_year += 1
|
cal_year += 1
|
||||||
|
|
||||||
# add unordered list to table row
|
# add unordered list to table row
|
||||||
tabrow += unordered
|
trow += unordered
|
||||||
|
|
||||||
# close row and add to table
|
# close row and add to table
|
||||||
year_table += tabrow
|
year_table += trow
|
||||||
|
|
||||||
# close table and add to year division
|
# close table and add to year division
|
||||||
yearnav += year_table
|
yearnav += year_table
|
||||||
@ -518,8 +521,8 @@ class WebCalReport(Report):
|
|||||||
# Add a link for year_glance() if requested
|
# Add a link for year_glance() if requested
|
||||||
navs.append(('fullyearlinked', _('Year Glance'), self.fullyear))
|
navs.append(('fullyearlinked', _('Year Glance'), self.fullyear))
|
||||||
|
|
||||||
monthnav = Html('div', id="subnavigation")
|
monthnav = Html("div", id="subnavigation")
|
||||||
ul = Html('ul')
|
ul = Html("ul")
|
||||||
|
|
||||||
navs = [(u, n) for u, n, c in navs if c]
|
navs = [(u, n) for u, n, c in navs if c]
|
||||||
for url_fname, nav_text in navs:
|
for url_fname, nav_text in navs:
|
||||||
@ -550,10 +553,10 @@ class WebCalReport(Report):
|
|||||||
|
|
||||||
# Figure out if we need <li class="CurrentSection"> or just plain <li>
|
# Figure out if we need <li class="CurrentSection"> or just plain <li>
|
||||||
cs = url_fname == currentsection and 'class="CurrentSection"' or ''
|
cs = url_fname == currentsection and 'class="CurrentSection"' or ''
|
||||||
ul += Html('li', attr = cs,inline=True) + (
|
ul += Html("li", attr = cs, inline = True) + (
|
||||||
|
|
||||||
# create hyperlink
|
# create hyperlink
|
||||||
Html('a', nav_text, href = url,inline=True)
|
Html("a", nav_text, href = url, inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# add ul to monthnav
|
# add ul to monthnav
|
||||||
@ -611,23 +614,23 @@ class WebCalReport(Report):
|
|||||||
th_txt = '%s %d' % (month_name, year)
|
th_txt = '%s %d' % (month_name, year)
|
||||||
|
|
||||||
# begin calendar table
|
# begin calendar table
|
||||||
cal_table = Html('table', class_='calendar', id = month_name)
|
cal_table = Html("table", class_ = "calendar", id = month_name)
|
||||||
|
|
||||||
# begin table head, <thead>
|
# begin table head, <thead>
|
||||||
thead = Html('thead')
|
thead = Html("thead")
|
||||||
tr = Html('tr')
|
tr = Html("tr")
|
||||||
th = Html('th', th_txt, class_ ='monthName', colspan=7,inline=True)
|
th = Html('th', th_txt, class_ ='monthName', colspan=7, inline = True)
|
||||||
|
|
||||||
# add them together now
|
# add them together now
|
||||||
tr += th
|
tr += th
|
||||||
thead += tr
|
thead += tr
|
||||||
|
|
||||||
# Calendar weekday names header
|
# Calendar weekday names header
|
||||||
weekday_names = Html('tr')
|
weekday_names = Html("tr")
|
||||||
for day_col in range(7):
|
for day_col in range(7):
|
||||||
dayclass = get_class_for_daycol(day_col)
|
dayclass = get_class_for_daycol(day_col)
|
||||||
dayname = get_name_for_daycol(day_col)
|
dayname = get_name_for_daycol(day_col)
|
||||||
th = Html('th', class_ =dayclass,inline=True) + (
|
th = Html('th', class_ =dayclass, inline = True) + (
|
||||||
Html('abbr', dayname[0], title=dayname)
|
Html('abbr', dayname[0], title=dayname)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -638,7 +641,7 @@ class WebCalReport(Report):
|
|||||||
thead += weekday_names
|
thead += weekday_names
|
||||||
|
|
||||||
# begin table body
|
# begin table body
|
||||||
tbody = Html('tbody')
|
tbody = Html("tbody")
|
||||||
|
|
||||||
# get first of the month and month information
|
# get first of the month and month information
|
||||||
current_date, current_ord, monthinfo = get_first_day_of_month(year, month)
|
current_date, current_ord, monthinfo = get_first_day_of_month(year, month)
|
||||||
@ -649,7 +652,7 @@ class WebCalReport(Report):
|
|||||||
week = monthinfo[week_row]
|
week = monthinfo[week_row]
|
||||||
|
|
||||||
# if you look this up in wikipedia, the first week is called week0
|
# if you look this up in wikipedia, the first week is called week0
|
||||||
tr = Html('tr', class_ = 'week%d' % week_row)
|
tr = Html("tr", class_ = "week%d" % week_row)
|
||||||
|
|
||||||
# begin calendar day column
|
# begin calendar day column
|
||||||
for day_col in range(0, 7):
|
for day_col in range(0, 7):
|
||||||
@ -662,7 +665,7 @@ class WebCalReport(Report):
|
|||||||
tdid = "%s%02d" % (abbr_month_name, day)
|
tdid = "%s%02d" % (abbr_month_name, day)
|
||||||
|
|
||||||
# add calendar date division
|
# add calendar date division
|
||||||
datediv = Html('div', day, class_='date',inline=True)
|
datediv = Html("div", day, class_ = "date", inline = True)
|
||||||
|
|
||||||
# a day in the previous or next month
|
# a day in the previous or next month
|
||||||
if day == 0:
|
if day == 0:
|
||||||
@ -678,10 +681,10 @@ class WebCalReport(Report):
|
|||||||
specclass = "next " + dayclass
|
specclass = "next " + dayclass
|
||||||
|
|
||||||
# continue table cell, <td>, without id tag
|
# continue table cell, <td>, without id tag
|
||||||
td = Html('td', class_ = specclass,inline=True) + (
|
td = Html('td', class_ = specclass, inline = True) + (
|
||||||
|
|
||||||
# adds date for previous and next month days
|
# adds date for previous and next month days
|
||||||
Html('div', specday, class_ = 'date',inline=True)
|
Html("div", specday, class_ = "date", inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# add table cell, <td>, to table row, <tr>
|
# add table cell, <td>, to table row, <tr>
|
||||||
@ -721,7 +724,7 @@ class WebCalReport(Report):
|
|||||||
|
|
||||||
# create hyperlink to one_day()
|
# create hyperlink to one_day()
|
||||||
fname_date = full_month_name + '/' + fname_date
|
fname_date = full_month_name + '/' + fname_date
|
||||||
ahref = Html('a', datediv, href=fname_date,inline=True)
|
ahref = Html("a", datediv, href=fname_date, inline = True)
|
||||||
|
|
||||||
# add hyperlink to table cell, <td>
|
# add hyperlink to table cell, <td>
|
||||||
td += ahref
|
td += ahref
|
||||||
@ -733,10 +736,10 @@ class WebCalReport(Report):
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
# continue table cell, <td>, without id tag
|
# continue table cell, <td>, without id tag
|
||||||
td = Html('td', class_ = hilightday,inline=True) + (
|
td = Html('td', class_ = hilightday, inline = True) + (
|
||||||
|
|
||||||
# adds date division
|
# adds date division
|
||||||
Html('div', day, class_ = 'date',inline=True)
|
Html("div", day, class_ = "date", inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# WebCal
|
# WebCal
|
||||||
@ -746,9 +749,9 @@ class WebCalReport(Report):
|
|||||||
td += datediv
|
td += datediv
|
||||||
|
|
||||||
# list the events
|
# list the events
|
||||||
ul = Html('ul')
|
ul = Html("ul")
|
||||||
for nyears, date, text, event in day_list:
|
for nyears, date, text, event in day_list:
|
||||||
ul += Html('li', text,inline=False if event == 'Anniversary'
|
ul += Html("li", text, inline=False if event == 'Anniversary'
|
||||||
else True)
|
else True)
|
||||||
|
|
||||||
# add events to table cell, <td>
|
# add events to table cell, <td>
|
||||||
@ -758,10 +761,10 @@ class WebCalReport(Report):
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
# create empty day with date
|
# create empty day with date
|
||||||
td = Html('td', class_ = dayclass,inline=True) + (
|
td = Html('td', class_ = dayclass, inline = True) + (
|
||||||
|
|
||||||
# adds date division
|
# adds date division
|
||||||
Html('div', day, class_ = 'date',inline=True)
|
Html("div", day, class_ = "date", inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# nothing for this month
|
# nothing for this month
|
||||||
@ -769,7 +772,7 @@ class WebCalReport(Report):
|
|||||||
td = Html('td', class_ = dayclass) + (
|
td = Html('td', class_ = dayclass) + (
|
||||||
|
|
||||||
# adds date division
|
# adds date division
|
||||||
Html('div', day, class_ = 'date',inline=True)
|
Html("div", day, class_ = "date", inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# add table cell, <td>, to table row, <tr>
|
# add table cell, <td>, to table row, <tr>
|
||||||
@ -786,10 +789,10 @@ class WebCalReport(Report):
|
|||||||
if cal == "yg":
|
if cal == "yg":
|
||||||
# Fill up till we have 6 rows, so that the months align properly
|
# Fill up till we have 6 rows, so that the months align properly
|
||||||
for i in range(nweeks, 6):
|
for i in range(nweeks, 6):
|
||||||
six_weeks = Html('tr', class_ = 'week%d' % (i + 1)) + (
|
six_weeks = Html("tr", class_ = "week%d" % (i + 1)) + (
|
||||||
|
|
||||||
# create table cell, <td>
|
# create table cell, <td>
|
||||||
Html('td', colspan=7,inline=True)
|
Html('td', colspan=7, inline = True)
|
||||||
)
|
)
|
||||||
|
|
||||||
# add extra weeks to tbody if needed
|
# add extra weeks to tbody if needed
|
||||||
@ -851,9 +854,9 @@ class WebCalReport(Report):
|
|||||||
note = note or " "
|
note = note or " "
|
||||||
|
|
||||||
# table foot section
|
# table foot section
|
||||||
cal_note = Html('tfoot')
|
cal_note = Html("tfoot")
|
||||||
tr = Html('tr')
|
tr = Html("tr")
|
||||||
td = Html('td', note, colspan=7,inline=True)
|
td = Html('td', note, colspan=7, inline = True)
|
||||||
|
|
||||||
# add table cell to table row
|
# add table cell to table row
|
||||||
# add table row to table foot section
|
# add table row to table foot section
|
||||||
@ -867,7 +870,7 @@ class WebCalReport(Report):
|
|||||||
body += monthly_calendar
|
body += monthly_calendar
|
||||||
|
|
||||||
# create blank line for stylesheets
|
# create blank line for stylesheets
|
||||||
body += Html('div', class_ = 'fullclear',inline=True)
|
body += Html("div", class_ = "fullclear", inline = True)
|
||||||
|
|
||||||
# create footer division section
|
# create footer division section
|
||||||
footer = self.write_footer(nr_up)
|
footer = self.write_footer(nr_up)
|
||||||
@ -925,7 +928,7 @@ class WebCalReport(Report):
|
|||||||
'that date, if there are any!\n'))
|
'that date, if there are any!\n'))
|
||||||
|
|
||||||
# page description
|
# page description
|
||||||
descriptdiv = Html('div', class_ = 'content') + (
|
descriptdiv = Html("div", class_ = "content") + (
|
||||||
|
|
||||||
# message line
|
# message line
|
||||||
Html('p', msg, id='description')
|
Html('p', msg, id='description')
|
||||||
@ -946,7 +949,7 @@ class WebCalReport(Report):
|
|||||||
self.progress.step()
|
self.progress.step()
|
||||||
|
|
||||||
# create blank line for stylesheets
|
# create blank line for stylesheets
|
||||||
body += Html('div', class_ = 'fullclear',inline=True)
|
body += Html("div", class_ = "fullclear", inline = True)
|
||||||
|
|
||||||
# write footer section
|
# write footer section
|
||||||
footer = self.write_footer(nr_up)
|
footer = self.write_footer(nr_up)
|
||||||
@ -1007,19 +1010,19 @@ class WebCalReport(Report):
|
|||||||
|
|
||||||
# set date display as in user prevferences
|
# set date display as in user prevferences
|
||||||
pg_date = _dd.display(event_date)
|
pg_date = _dd.display(event_date)
|
||||||
body += Html('h3', pg_date,inline=True)
|
body += Html('h3', pg_date, inline = True)
|
||||||
|
|
||||||
# list the events
|
# list the events
|
||||||
ol = Html('ol')
|
ol = Html('ol')
|
||||||
for nyears, date, text, event in day_list:
|
for nyears, date, text, event in day_list:
|
||||||
ol += Html('li', text,inline=False if event == 'Anniversary'
|
ol += Html("li", text, inline=False if event == 'Anniversary'
|
||||||
else True)
|
else True)
|
||||||
|
|
||||||
# add ordered list to body section
|
# add ordered list to body section
|
||||||
body += ol
|
body += ol
|
||||||
|
|
||||||
# create blank line for stylesheets
|
# create blank line for stylesheets
|
||||||
body += Html('div', class_ = 'fullclear',inline=True)
|
body += Html("div", class_ = "fullclear", inline = True)
|
||||||
|
|
||||||
# write footer section
|
# write footer section
|
||||||
footer = self.write_footer(nr_up)
|
footer = self.write_footer(nr_up)
|
||||||
@ -1181,7 +1184,7 @@ class WebCalReport(Report):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# begin calendar footer
|
# begin calendar footer
|
||||||
footer = Html('div', id = 'footer')
|
footer = Html("div", id = 'footer')
|
||||||
|
|
||||||
# Display date as user set in preferences
|
# Display date as user set in preferences
|
||||||
msg = _('Generated by <a href="http://gramps-project.org">'
|
msg = _('Generated by <a href="http://gramps-project.org">'
|
||||||
@ -1753,7 +1756,7 @@ def get_day_list(event_date, holiday_list, bday_anniv_list):
|
|||||||
'%(couple)s, <em>%(years)d'
|
'%(couple)s, <em>%(years)d'
|
||||||
'</em> year anniversary', nyears)
|
'</em> year anniversary', nyears)
|
||||||
% {'couple' : text, 'years' : nyears})
|
% {'couple' : text, 'years' : nyears})
|
||||||
txt_str = Html('span', txt_str, class_ = 'yearsmarried')
|
txt_str = Html('span', txt_str, class_ = "yearsmarried")
|
||||||
|
|
||||||
day_list.append((nyears, date, txt_str, event))
|
day_list.append((nyears, date, txt_str, event))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user