Moved CreatorInfo from write_footer() back to write_header(). Removed maximum calendars years, and fixed display_year_nav().
svn: r11972
This commit is contained in:
parent
c0af02cadd
commit
4730f744ba
@ -295,7 +295,7 @@ class BasePage:
|
|||||||
sorted_first_letter.sort(locale.strcoll)
|
sorted_first_letter.sort(locale.strcoll)
|
||||||
|
|
||||||
num_ltrs = len(sorted_first_letter)
|
num_ltrs = len(sorted_first_letter)
|
||||||
if num_ltrs <= 25:
|
if num_ltrs <= 26:
|
||||||
of.write('\t<div id="navigation">\n')
|
of.write('\t<div id="navigation">\n')
|
||||||
of.write('\t\t<ul>\n')
|
of.write('\t\t<ul>\n')
|
||||||
for ltr in sorted_first_letter:
|
for ltr in sorted_first_letter:
|
||||||
@ -303,20 +303,19 @@ class BasePage:
|
|||||||
of.write('\t\t</ul>\n')
|
of.write('\t\t</ul>\n')
|
||||||
of.write('\t</div>\n')
|
of.write('\t</div>\n')
|
||||||
else:
|
else:
|
||||||
nrows = (num_ltrs / 25)
|
nrows = (num_ltrs / 26)
|
||||||
index = 0
|
index = 0
|
||||||
for rows in range(0, nrows):
|
for rows in range(0, nrows):
|
||||||
of.write('\t<div id="navigation">\n')
|
of.write('\t<div id="navigation">\n')
|
||||||
of.write('\t\t<ul>\n')
|
of.write('\t\t<ul>\n')
|
||||||
cols = 0
|
cols = 0
|
||||||
while (cols <= 24 and index <= num_ltrs):
|
while (cols <= 26 and index <= num_ltrs):
|
||||||
of.write('\t\t\t<li><a href="#%s">%s</a></li>\n'
|
of.write('\t\t\t<li><a href="#%s">%s</a></li>\n'
|
||||||
% (sorted_first_letter[index], sorted_first_letter[index]))
|
% (sorted_first_letter[index], sorted_first_letter[index]))
|
||||||
cols += 1
|
cols += 1
|
||||||
index += 1
|
index += 1
|
||||||
of.write('\t\t<ul>\n')
|
of.write('\t\t<ul>\n')
|
||||||
of.write('\t</div>\n')
|
of.write('\t</div>\n')
|
||||||
return of
|
|
||||||
|
|
||||||
def write_footer(self, of):
|
def write_footer(self, of):
|
||||||
|
|
||||||
@ -337,13 +336,6 @@ class BasePage:
|
|||||||
msg = _('Generated by <a href="http://gramps-project.org">'
|
msg = _('Generated by <a href="http://gramps-project.org">'
|
||||||
'GRAMPS</a> on %(date)s') % {'date' : value}
|
'GRAMPS</a> on %(date)s') % {'date' : value}
|
||||||
|
|
||||||
if self.report.options['linkhome']:
|
|
||||||
home_person = self.report.database.get_default_person()
|
|
||||||
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 += _('<br />for <a href="%s">%s</a>') % (home_person_url, home_person_name)
|
|
||||||
|
|
||||||
of.write('\t<p id="createdate">%s</p>\n' % msg)
|
of.write('\t<p id="createdate">%s</p>\n' % msg)
|
||||||
|
|
||||||
copy_nr = self.report.copyright
|
copy_nr = self.report.copyright
|
||||||
@ -417,9 +409,17 @@ class BasePage:
|
|||||||
header = self.report.options['headernote']
|
header = self.report.options['headernote']
|
||||||
if header:
|
if header:
|
||||||
note = self.report.database.get_note_from_gramps_id(header)
|
note = self.report.database.get_note_from_gramps_id(header)
|
||||||
of.write('\t<p id="user_header">')
|
of.write('\t<p id="user_header">%s</p>\n' % note.get())
|
||||||
of.write(note.get())
|
|
||||||
of.write('</p>\n')
|
linkhome = self.report.options['linkhome']
|
||||||
|
if linkhome:
|
||||||
|
home_person = self.report.database.get_default_person()
|
||||||
|
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('\t<p id="CreatorInfo">%s</p>\n' % msg)
|
||||||
|
|
||||||
of.write('</div>\n')
|
of.write('</div>\n')
|
||||||
|
|
||||||
# Begin Navigation Menu
|
# Begin Navigation Menu
|
||||||
|
@ -431,13 +431,20 @@ class WebCalReport(Report):
|
|||||||
currentsection = proper styling of this navigation bar
|
currentsection = proper styling of this navigation bar
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# creating more than one year
|
||||||
|
if not self.multiyear:
|
||||||
|
return
|
||||||
|
|
||||||
|
num_years = (self.end_year - self.start_year)
|
||||||
|
cal_year = self.start_year
|
||||||
|
|
||||||
|
nrows = (num_years / 16)
|
||||||
|
for rows in range(0, (nrows + 1)):
|
||||||
of.write('<div id="navigation">\n')
|
of.write('<div id="navigation">\n')
|
||||||
of.write('\t<ul>\n')
|
of.write('\t<ul>\n')
|
||||||
cols = 0
|
cols = 0
|
||||||
cal_year = self.start_year
|
while (cols <= 15 and cal_year <= self.end_year):
|
||||||
while (cols <= 25 and cal_year <= self.end_year):
|
|
||||||
url = ''
|
url = ''
|
||||||
currentsection = False
|
|
||||||
|
|
||||||
# begin subdir level
|
# begin subdir level
|
||||||
subdirs = ['..'] * nr_up
|
subdirs = ['..'] * nr_up
|
||||||
@ -452,26 +459,22 @@ class WebCalReport(Report):
|
|||||||
url = '/'.join(subdirs + [full_month_name]) + self.ext
|
url = '/'.join(subdirs + [full_month_name]) + self.ext
|
||||||
|
|
||||||
# determine if we need to highlight???
|
# determine if we need to highlight???
|
||||||
|
highlight = ''
|
||||||
if str(cal_year) == currentsection:
|
if str(cal_year) == currentsection:
|
||||||
currentsection = True
|
highlight = ' id="CurrentSection"'
|
||||||
|
|
||||||
# if True, highlight currentsection
|
of.write('\t\t<li%s><a href="%s">%d</a></li>\n'
|
||||||
if currentsection:
|
% (highlight, url, cal_year))
|
||||||
section = ' id="CurrentSection"'
|
|
||||||
else:
|
|
||||||
section = ''
|
|
||||||
|
|
||||||
of.write('\t\t<li%s><a href="%s">%s</a></li>\n'
|
# increase columns
|
||||||
% (section, url, str(cal_year)))
|
|
||||||
|
|
||||||
# increase year
|
|
||||||
cal_year += 1
|
|
||||||
|
|
||||||
# increase column
|
|
||||||
cols += 1
|
cols += 1
|
||||||
|
|
||||||
|
# increase calendar year
|
||||||
|
cal_year += 1
|
||||||
|
|
||||||
|
# close row and div section in for each row
|
||||||
of.write('\t</ul>\n')
|
of.write('\t</ul>\n')
|
||||||
of.write('</div>\n\n')
|
of.write('</div>\n')
|
||||||
|
|
||||||
def calendar_common(self, of, nr_up, year, currentsection, title, use_home=False):
|
def calendar_common(self, of, nr_up, year, currentsection, title, use_home=False):
|
||||||
"""
|
"""
|
||||||
@ -910,17 +913,11 @@ class WebCalReport(Report):
|
|||||||
# Copy all files for the calendars being created
|
# Copy all files for the calendars being created
|
||||||
self.copy_calendar_files()
|
self.copy_calendar_files()
|
||||||
|
|
||||||
# create calendars with multiple years up to twenty-five years
|
|
||||||
# navigation bar length will only support twenty-five years at any given time
|
|
||||||
if self.multiyear:
|
if self.multiyear:
|
||||||
# Clip to max 25 years
|
|
||||||
if ((self.end_year - self.start_year + 1) > 25):
|
|
||||||
self.end_year = self.start_year + 25 - 1
|
|
||||||
|
|
||||||
for cal_year in range(self.start_year, (self.end_year + 1)):
|
for cal_year in range(self.start_year, (self.end_year + 1)):
|
||||||
|
|
||||||
# generate progress pass for year ????
|
# generate progress pass for year ????
|
||||||
self.progress.set_pass(_('Creating year %d calendars') % cal_year, '')
|
self.progress.set_pass(_('Creating year %d calendars') % cal_year, 1)
|
||||||
|
|
||||||
# initialize the holidays dict to fill:
|
# initialize the holidays dict to fill:
|
||||||
self.holidays = {}
|
self.holidays = {}
|
||||||
@ -946,9 +943,6 @@ class WebCalReport(Report):
|
|||||||
if self.country != 0:
|
if self.country != 0:
|
||||||
self.__get_holidays(cal_year)
|
self.__get_holidays(cal_year)
|
||||||
|
|
||||||
# generate progress pass for single year
|
|
||||||
#self.progress.set_pass(_('Creating calendars'), 12)
|
|
||||||
|
|
||||||
# create "WebCal" calendar pages
|
# create "WebCal" calendar pages
|
||||||
self.web_cal(cal_year)
|
self.web_cal(cal_year)
|
||||||
|
|
||||||
@ -1482,6 +1476,10 @@ def get_day_list(event_date, holiday_list, bday_anniv_list):
|
|||||||
# number of years married, ex: 10
|
# number of years married, ex: 10
|
||||||
nyears = event_date.get_year() - date.get_year()
|
nyears = event_date.get_year() - date.get_year()
|
||||||
|
|
||||||
|
# no negative years
|
||||||
|
# years have to be at least zero
|
||||||
|
if nyears > -1:
|
||||||
|
|
||||||
# number of years for birthday, ex: 10 years
|
# number of years for birthday, ex: 10 years
|
||||||
age_str = event_date - date
|
age_str = event_date - date
|
||||||
age_str.format(precision=1)
|
age_str.format(precision=1)
|
||||||
|
Loading…
Reference in New Issue
Block a user