diff --git a/src/data/Web_Visually.css b/src/data/Web_Visually.css index d8d161884..4427fd0c0 100644 --- a/src/data/Web_Visually.css +++ b/src/data/Web_Visually.css @@ -269,7 +269,7 @@ table.infolist { } table.infolist tr th { font:normal 1.1em/1.2em serif; - color:#FFF; + color:#000; margin:0; padding:.2em 10px; background-color:#6AF364; diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 6755054ca..9fe69c624 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -115,6 +115,9 @@ _WEBHEADER = 'Web_Mainz_Header.png' _WEBMID = 'Web_Mainz_Mid.png' _WEBMIDLIGHT = 'Web_Mainz_MidLight.png' +# Web page filename extensions +_WEB_EXT = ['.html', '.htm', '.shtml', '.php', '.php3', '.cgi'] + _INCLUDE_LIVING_VALUE = 99 # Arbitrary number _NAME_COL = 3 @@ -140,26 +143,27 @@ _CSS_FILES = [ [_("Mainz"), 'Web_Mainz.css'], [_("Nebraska"), 'Web_Nebraska.css'], [_("Visually Impaired"), 'Web_Visually.css'], - [_("No style sheet"), ''], ] _CHARACTER_SETS = [ # First is used as default selection. - [_('Unicode (recommended)'), 'utf-8'], - ['ISO-8859-1', 'iso-8859-1' ], - ['ISO-8859-2', 'iso-8859-2' ], - ['ISO-8859-3', 'iso-8859-3' ], - ['ISO-8859-4', 'iso-8859-4' ], - ['ISO-8859-5', 'iso-8859-5' ], - ['ISO-8859-6', 'iso-8859-6' ], - ['ISO-8859-7', 'iso-8859-7' ], - ['ISO-8859-8', 'iso-8859-8' ], - ['ISO-8859-9', 'iso-8859-9' ], - ['ISO-8859-10', 'iso-8859-10' ], - ['ISO-8859-13', 'iso-8859-13' ], - ['ISO-8859-14', 'iso-8859-14' ], - ['ISO-8859-15', 'iso-8859-15' ], + # As you see these on the internet, they are in full capital letters. + # UTF-8 is specifically identified instead of the entire unicode set. + [_('Unicode UTF-8 (recommended)'), 'UTF-8'], + ['ISO-8859-1', 'ISO-8859-1' ], + ['ISO-8859-2', 'ISO-8859-2' ], + ['ISO-8859-3', 'ISO-8859-3' ], + ['ISO-8859-4', 'ISO-8859-4' ], + ['ISO-8859-5', 'ISO-8859-5' ], + ['ISO-8859-6', 'ISO-8859-6' ], + ['ISO-8859-7', 'ISO-8859-7' ], + ['ISO-8859-8', 'ISO-8859-8' ], + ['ISO-8859-9', 'ISO-8859-9' ], + ['ISO-8859-10', 'ISO-8859-10' ], + ['ISO-8859-13', 'ISO-8859-13' ], + ['ISO-8859-14', 'ISO-8859-14' ], + ['ISO-8859-15', 'ISO-8859-15' ], ['koi8_r', 'koi8_r', ], ] @@ -208,12 +212,10 @@ _COPY_OPTIONS = [ _('No copyright notice'), ] - wrapper = TextWrapper() wrapper.break_log_words = True wrapper.width = 20 - _html_dbl_quotes = re.compile(r'([^"]*) " ([^"]*) " (.*)', re.VERBOSE) _html_sng_quotes = re.compile(r"([^']*) ' ([^']*) ' (.*)", re.VERBOSE) _html_replacement = { @@ -353,7 +355,6 @@ 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 += '
' msg += _('Created for %s') % (home_person_url, home_person_name) of.write('\t

%s

\n' % msg) @@ -462,7 +463,7 @@ class BasePage: 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): + if not _has_webpage_extension(url_fname): url_fname += self.ext if self.up: @@ -476,7 +477,7 @@ class BasePage: # Use 'self.report.cur_fname' to determine 'CurrentSection' for individual # elements for Navigation styling. - # Figure out if we need
  • of just plain
  • + # Figure out if we need
  • of just plain
  • cs = False if nav_text == currentsection: cs = True @@ -780,9 +781,6 @@ class IndividualListPage(BasePage): of = self.report.create_file("individuals") self.write_header(of, _('Individuals')) - # begin alphabetic navigation - self.alphabet_navigation(of, db, person_handle_list, _PERSON) - of.write('
    \n') msg = _("This page contains an index of all the individuals in the " @@ -795,6 +793,10 @@ class IndividualListPage(BasePage): showparents = report.options['showparents'] of.write('\t

    %s

    \n' % msg) + + # begin alphabetic navigation + self.alphabet_navigation(of, db, person_handle_list, _PERSON) + of.write('\t\n') of.write('\t\n') of.write('\t\t\n') @@ -1062,9 +1064,6 @@ class PlaceListPage(BasePage): of = self.report.create_file("places") self.write_header(of, _('Places')) - # begin alphabetic navigation - self.alphabet_navigation(of, db, place_handles, _PLACE) - of.write('
    \n') msg = _("This page contains an index of all the places in the " @@ -1073,6 +1072,9 @@ class PlaceListPage(BasePage): of.write('\t

    %s

    \n' % msg ) + # begin alphabetic navigation + self.alphabet_navigation(of, db, place_handles, _PLACE) + of.write('\t
    \n') of.write('\t\n') of.write('\t\t\n') @@ -3335,7 +3337,7 @@ class NavWebOptions(MenuReportOptions): self.__update_filters() ext = EnumeratedListOption(_("File extension"), ".html" ) - for etype in ['.html', '.htm', '.shtml', '.php', '.php3', '.cgi']: + for etype in _WEB_EXT: ext.add_item(etype, etype) ext.set_help( _("The extension to be used for the web files")) menu.add_option(category_name, "ext", ext) @@ -3346,12 +3348,6 @@ class NavWebOptions(MenuReportOptions): cright.set_help( _("The copyright to be used for the web files")) menu.add_option(category_name, "cright", cright) - encoding = EnumeratedListOption(_('Character set encoding'), _CHARACTER_SETS[0][1] ) - for eopt in _CHARACTER_SETS: - encoding.add_item(eopt[1], eopt[0]) - encoding.set_help( _("The encoding to be used for the web files")) - menu.add_option(category_name, "encoding", encoding) - css = EnumeratedListOption(_('StyleSheet'), _CSS_FILES[0][1]) for style in _CSS_FILES: css.add_item(style[1], style[0]) @@ -3465,6 +3461,12 @@ class NavWebOptions(MenuReportOptions): """ category_name = _("Advanced") + encoding = EnumeratedListOption(_('Character set encoding'), _CHARACTER_SETS[0][1] ) + for eopt in _CHARACTER_SETS: + encoding.add_item(eopt[1], eopt[0]) + encoding.set_help( _("The encoding to be used for the web files")) + menu.add_option(category_name, "encoding", encoding) + linkhome = BooleanOption(_('Include link to home person on every ' 'page'), False) linkhome.set_help(_('Whether to include a link to the home person')) @@ -3620,6 +3622,18 @@ def get_first_letters(db, handle_list, key): return first_letters +def _has_webpage_extension(url): + """ + determine if a filename has an extension or not... + + url = filename to be checked + """ + + for ext in _WEB_EXT: + if url.endswith(ext): + return True + return False + # ------------------------------------------ # # Register Plugin