diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py
index 82f6e08d0..5c66ae4b9 100644
--- a/src/plugins/webreport/NarrativeWeb.py
+++ b/src/plugins/webreport/NarrativeWeb.py
@@ -78,7 +78,6 @@ import gen.lib
import const
from GrampsCfg import get_researcher
import Sort
-import GrampsLocale
from gen.plug import PluginManager
from gen.plug.menu import PersonOption, NumberOption, StringOption, \
BooleanOption, EnumeratedListOption, FilterOption, \
@@ -430,15 +429,6 @@ class BasePage:
Creates the navigation menu
"""
- # Determine if there will be a link to WebCal or not???
- use_webcal = False
- webcal_link = self.report.webcal_link
- if webcal_link.strip() != '':
- if not webcal_link.endswith(self.ext):
- webcal_link += self.ext
- if os.path.isfile(webcal_link):
- use_webcal = True
-
navs = [
(self.report.index_fname, _('Home'), self.report.use_home),
(self.report.intro_fname, _('Introduction'), self.report.use_intro),
@@ -449,7 +439,6 @@ class BasePage:
('download', _('Download'), self.report.inc_download),
('contact', _('Contact'), self.report.use_contact),
('sources', _('Sources'), True),
- (webcal_link, _('Web Calendar'), use_webcal),
]
of.write('\t
\n')
@@ -2851,8 +2840,6 @@ class NavWebReport(Report):
self.graph = self.options['graph']
- self.webcal_link = self.options['webcal_link']
-
if self.use_home:
self.index_fname = "index"
self.surname_fname = "surnames"
@@ -3427,13 +3414,6 @@ class NavWebOptions(MenuReportOptions):
nogid.set_help(_('Whether to include the Gramps ID of objects'))
menu.add_option(category_name, 'nogid', nogid)
- today = time.localtime()
- lng_month = GrampsLocale.long_months[today[1]]
- fpath = '/'.join([const.USER_HOME] + ['WEBCAL'] + [str(today[0])] + [lng_month])
- webcal_link = StringOption(_('Link to Web Calendar'), fpath)
- webcal_link.set_help(_('Choose your link to Web Calendars if you want?'))
- menu.add_option(category_name, 'webcal_link', webcal_link)
-
def __add_privacy_options(self, menu):
"""
Options on the "Privacy" tab.
diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py
index e6ade3cda..293ad9ef0 100644
--- a/src/plugins/webreport/WebCal.py
+++ b/src/plugins/webreport/WebCal.py
@@ -389,43 +389,34 @@ class WebCalReport(Report):
for url_fname, nav_text, cond in navs:
url = ''
- currentsection = False
+ cs = False
if cond:
subdirs = ['..'] * nr_up
subdirs.append(str(year))
- # Note. We use '/' here because it is a URL, not a OS dependent pathname
if type(url_fname) == int:
url_fname = get_full_month_name(url_fname)
if type(nav_text) == int:
nav_text = get_short_month_name(nav_text)
- # Figure out if we need stylesheet highlighting or not
- highlight = ''
+ # Figure out if we need
or just plain
+ print url_fname, currentsection
if url_fname == currentsection:
- highlight = ' id="CurrentSection"'
+ cs = True
+ # Note. We use '/' here because it is a URL, not a OS dependent pathname
url = url_fname
if not url.startswith('http:'):
+ url = '/'.join(subdirs + [url_fname])
- # if url already ends with an extension, like home link?
- # do not add subdirs
- if url.endswith(self.ext):
- subdirs = []
- url = '/'.join(subdirs + [url_fname])
- else:
- url = '/'.join(subdirs + [url_fname])
- if not url.endswith(self.ext):
- url += self.ext
+ if not _has_webpage_extension(url, self.ext):
+ url += self.ext
- if currentsection:
- section = ' id="CurrentSection"'
- else:
- section = ''
+ cs = cs and ' id="CurrentSection"' or ''
of.write('\t\t%s\n'
- % (section, url, nav_text))
+ % (cs, url, nav_text))
of.write('\t\n')
of.write('
\n\n')
@@ -501,7 +492,7 @@ class WebCalReport(Report):
of.write('