From 534188f81a10fa1eb76bd00f89d328991f174802 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Sat, 26 Sep 2009 17:11:03 +0000 Subject: [PATCH] User choice of either horizontal or vertical alphabet navigation bar. Changes to all of the stylesheets to accomodate this change. Fixes to RepositoryList and alphabet_navigation also. Not all stylesheets are completed upto the new choice yet. svn: r13258 --- src/data/Web_Alphabet-Horizontal.css | 56 +++++---- src/data/Web_Alphabet-Vertical.css | 20 ++-- src/data/Web_Basic-Ash.css | 67 ++++------- src/data/Web_Basic-Cypress.css | 166 +++++++++++--------------- src/data/Web_Basic-Lilac.css | 37 ------ src/data/Web_Basic-Peach.css | 37 ------ src/data/Web_Basic-Spruce.css | 37 ------ src/data/Web_Mainz.css | 37 ------ src/data/Web_Nebraska.css | 37 ------ src/data/Web_Visually.css | 83 ++++--------- src/plugins/webreport/NarrativeWeb.py | 120 ++++++++++++------- 11 files changed, 232 insertions(+), 465 deletions(-) diff --git a/src/data/Web_Alphabet-Horizontal.css b/src/data/Web_Alphabet-Horizontal.css index af341ba30..f8bc9ad59 100644 --- a/src/data/Web_Alphabet-Horizontal.css +++ b/src/data/Web_Alphabet-Horizontal.css @@ -1,4 +1,3 @@ - /* ************************************************************************************************** Copyright Holder and License @@ -15,7 +14,7 @@ and a wiki open to all. It is a community project, created, developed and govern Go to http://gramps-project.org to learn more! -------------------------------------------------------------------------------------------------- -Copyright 2009 Rob G. Healey +Copyright (C) 2009 Rob G. Healey This file is part of the GRAMPS program. @@ -31,62 +30,73 @@ see . -------------------------------------------------------------------------------------------------- # $Id: $ + NarrativeWeb ----------------------------------------------------------------------------------------------- */ +body#NarrativeWeb { + margin: 0; + padding: 156px 0px 0px 0px; +} /* Header ----------------------------------------------------- */ #header { - margin:0; - height:1.5cm; - padding:0 0 .9em 0; + position: fixed; + top: 0px; + left: 0px; + overflow: auto; + width: 100%; + height: 90px; + margin: 0; } /* Footer ----------------------------------------------------- */ #footer { - clear:both; - height:1.5cm; - width:100%; - font-size:12px; - line-height:130%; - font-family:sans-serif; - margin:0; - padding:0; + width: 100%; + height: 60px; + overflow: auto; + clear: both; + font-size: 12px; + margin: 0; } /* Alphabet Navigation ----------------------------------------------------- */ -div#alphabet { +#alphabet { + position: fixed; + top: 136px; + left: 24px; padding:0; margin:0; } -div#alphabet ul { +#alphabet ul { list-style:none; min-width:770px; height:24px; margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; + padding: 0px 0px 0px 16px; + border-width: 2px 0px 4px 0px; + border-color: #000; + border-style: solid; background-color:#6AF364; } -div#alphabet ul li:after { +#alphabet ul li:after { content:" |"; } -div#alphabet ul li.letters { +#alphabet ul li { margin:0; float:left; } -div#alphabet ul li.letters a { +#alphabet ul li a { display:block; + padding: 4px 8px 4px 8px; float:left; font:bold 16px/100% sans; color:#000; margin:0; - padding:5px 5px; text-decoration:none; } -div#alphabet ul li.letters a:hover { +#alphabet ul li a:hover { background-color:#000; color:#FFF; } diff --git a/src/data/Web_Alphabet-Vertical.css b/src/data/Web_Alphabet-Vertical.css index 502adb4d9..17e6bec10 100644 --- a/src/data/Web_Alphabet-Vertical.css +++ b/src/data/Web_Alphabet-Vertical.css @@ -14,7 +14,7 @@ and a wiki open to all. It is a community project, created, developed and govern Go to http://gramps-project.org to learn more! -------------------------------------------------------------------------------------------------- -Copyright 2009 Rob G. Healey +Copyright (C) 2009 Rob G. Healey This file is part of the GRAMPS program. @@ -30,12 +30,12 @@ see . -------------------------------------------------------------------------------------------------- # $Id: $ + NarrativeWeb ------------------------------------------------------------------------------------------------ */ body#NarrativeWeb { + padding: 136px 0px 0px 54px; margin: 0; - padding: 130px 0px 0px 54px; background-color: #FFF; - font-family: Arial, sans, sans-serif, Helvetica; } /* Header @@ -47,7 +47,6 @@ body#NarrativeWeb { overflow: auto; width: 100%; height: 90px; - margin: 0; } /* Footer @@ -65,23 +64,18 @@ body#NarrativeWeb { ----------------------------------------------------- */ #alphabet { position: fixed; - top: 136px; left: 4px; width: 44px; - height: 408px; + height: 416px; overflow-x: auto; border-width: 2px 4px 2px 4px; border-style: solid; - border-color: #5D835F; } #alphabet ul { display: inline; list-style: none; margin: 0; } -#alphabet ul li:first-child { - margin-top: 10px; -} #alphabet ul li { font: bold 14px/100% sans; color: #000; @@ -90,6 +84,12 @@ body#NarrativeWeb { float: left; border-bottom: solid 2px #000; } +#alphabet ul li:first-child { + border: 0; +} +#alphabet ul li:last-child { + border: 0; +} #alphabet ul li a { text-decoration: none; } diff --git a/src/data/Web_Basic-Ash.css b/src/data/Web_Basic-Ash.css index f663c5936..7758de179 100644 --- a/src/data/Web_Basic-Ash.css +++ b/src/data/Web_Basic-Ash.css @@ -48,18 +48,16 @@ white #FFF # $Id$ NarrativeWeb Styles ------------------------------------------------------------------------------------------------- - - General Elements ------------------------------------------------------ */ - -body { +--------------------------------------------------------------------------------------------- */ +body#NarrativeWeb { + padding-top: 90px; font-family:sans-serif; color:#000; - margin:0; - padding:0; background-color:#FFF; } + +/* General Elements +----------------------------------------------------- */ div { margin:0; padding:0; @@ -163,13 +161,14 @@ a:visited { /* Header ----------------------------------------------------- */ #header { - padding:15px 15px 2px 15px; - margin:0; background-color:#EEE; } #SiteTitle { - color:#333; - margin:0 0 3px 0; + margin:0; + padding:.5em 0 0.5em 10px; + font-size: 40px; + color: #FFF; + font-style: italic; } #header p { font-size:1em; @@ -178,41 +177,13 @@ a:visited { margin:0; } -/* Alphabet Navigation +/* Alphabet Navigation bar ----------------------------------------------------- */ #alphabet { - padding:0; - margin:0; -} -#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; -background-color:#EEE; -} -#alphabet ul li.letters { - margin:0; - float:left; -} -.letters:after { - content:" |"; -} -#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color:#000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -#alphabet ul li.letters a:hover { - background-color:#000; - color:#FFF; + position: fixed; + top: 136px; + background-color: #EEE; + border-color: #000; } /* Navigation @@ -222,6 +193,11 @@ background-color:#EEE; padding:4px 0 0 0; background-color:#EEE; } +body#NarrativeWeb #navigation { + position: fixed; + top: 104px; + left: 0px; +} #navigation ul, #subnavigation ul { list-style:none; min-width:770px; @@ -259,6 +235,7 @@ background-color:#EEE; } #navigation ul li.CurrentSection a:hover { background-color:#FFF; + border-bottom: solid 1px #000; } #subnavigation ul li.CurrentSection a { border-width:0 0 1px 0; diff --git a/src/data/Web_Basic-Cypress.css b/src/data/Web_Basic-Cypress.css index c365122be..4dd89d5cf 100644 --- a/src/data/Web_Basic-Cypress.css +++ b/src/data/Web_Basic-Cypress.css @@ -45,16 +45,17 @@ white #FFF # $Id$ - General Elements + NarrativeWeb Styles +-------------------------------------------------------------------------------------------- */ +body#NarrativeWeb { + font-family: sans-serif; + color: #000; + background-color: #FFF; +} + +/* General Elements ----------------------------------------------------- */ -body { - font-family:sans-serif; - color:#000; - margin:0; - padding:0; - background-color:#FFF; -} div { margin:0; padding:0; @@ -156,13 +157,14 @@ a:visited { /* Header ----------------------------------------------------- */ #header { - padding:15px 15px 2px 15px; - margin:0; background-color:#454; } #SiteTitle { + margin:0; + padding:.5em 0 0.5em 10px; + font-size: 40px; color:#E0E6E0; - margin:0 0 3px 0; + font-style: italic; } #header p { font-size:1em; @@ -171,41 +173,60 @@ a:visited { margin:0; } -/* Alphabet Navigation +/* Footer +----------------------------------------------------- */ +#footer { + width:100%; + font-size:12px; + color:#E0E6E0; + background-color:#454; + border-top:solid 1px #454; +} +#footer a, #footer a:visited { + text-decoration:none; + color:#E0E6E0; +} +#footer a:hover { + text-decoration:underline; + background:none; +} +#footer img { + border:0; + margin:0 auto; + vertical-align:middle; +} +#footer p#createdate { + float:left; + width:40%; + text-align:left; + margin-left:10px; +} +#footer p#copyright { + float:right; + width:40%; + text-align:right; + margin-right:10px; +} +#footer p#copyright img { + margin-right:10px; +} +#user_footer { + width:70%; + float:left; + margin:1em; +} +#user_footer p { + font:normal 1em/1.2em serif; + margin:0; + padding:0; +} + +/* Alphabet Navigation Bar ----------------------------------------------------- */ #alphabet { - padding:0; - margin:0; -} -#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; - background-color:#454; -} -#alphabet ul li.letters { - margin:0; - float:left; -} -.letters:after { - content:" |"; -} -#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color:#000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -#alphabet ul li.letters a:hover { - background-color:#000; - color:#FFF; + position: fixed; + top: 122px; + background-color: #454; } /* Navigation @@ -215,6 +236,11 @@ a:visited { padding:4px 0 0 0; background-color:#454; } +body#NarrativeWeb #navigation { + position: fixed; + top: 90px; + left: 0px; +} #navigation ul { list-style:none; min-width:770px; @@ -1030,58 +1056,6 @@ div#sourcerefs ol li ol { background-color:#E0E6E0; } -/* Footer ------------------------------------------------------ */ -#footer { - clear:both; - width:100%; - font-size:12px; - line-height:130%; - color:#E0E6E0; - margin:0; - padding:0; - background-color:#454; - border-top:solid 1px #454; -} -#footer a, #footer a:visited { - text-decoration:none; - color:#E0E6E0; -} -#footer a:hover { - text-decoration:underline; - background:none; -} -#footer img { - border:0; - margin:0 auto; - vertical-align:middle; -} -#footer p#createdate { - float:left; - width:40%; - text-align:left; - margin-left:10px; -} -#footer p#copyright { - float:right; - width:40%; - text-align:right; - margin-right:10px; -} -#footer p#copyright img { - margin-right:10px; -} -#user_footer { - width:70%; - float:left; - margin:1em; -} -#user_footer p { - font:normal 1em/1.2em serif; - margin:0; - padding:0; -} - /* Calendar Styles -------------------------------------------------------------------------------------------- */ /* Calendar : General */ diff --git a/src/data/Web_Basic-Lilac.css b/src/data/Web_Basic-Lilac.css index 314f0c595..40c5cc7ad 100644 --- a/src/data/Web_Basic-Lilac.css +++ b/src/data/Web_Basic-Lilac.css @@ -176,43 +176,6 @@ a:visited { margin:0; } -/* Alphabet Navigation ------------------------------------------------------ */ -#alphabet { - padding:0; - margin:0; -} -#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; - background-color:#E0E0E9; -} -#alphabet ul li.letters { - margin:0; - float:left; -} -.letters:after { - content:" |"; -} -#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color:#000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -#alphabet ul li.letters a:hover { - background-color:#000; - color:#FFF; -} - /* Navigation ----------------------------------------------------- */ #navigation, #subnavigation { diff --git a/src/data/Web_Basic-Peach.css b/src/data/Web_Basic-Peach.css index e0998b6ed..aa9235c05 100644 --- a/src/data/Web_Basic-Peach.css +++ b/src/data/Web_Basic-Peach.css @@ -177,43 +177,6 @@ a:visited { margin:0; } -/* Alphabet Navigation ------------------------------------------------------ */ -#alphabet { - padding:0; - margin:0; -} -#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; - background-color:#FFE09F; -} -#alphabet ul li.letters { - margin:0; - float:left; -} -.letters:after { - content:" |"; -} -#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color:#000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -#alphabet ul li.letters a:hover { - background-color:#000; - color:#FFF; -} - /* Navigation ----------------------------------------------------- */ #navigation, #subnavigation { diff --git a/src/data/Web_Basic-Spruce.css b/src/data/Web_Basic-Spruce.css index ba1fd304c..be5821f3c 100644 --- a/src/data/Web_Basic-Spruce.css +++ b/src/data/Web_Basic-Spruce.css @@ -177,43 +177,6 @@ a:visited { margin:0; } -/* Alphabet Navigation ------------------------------------------------------ */ -#alphabet { - padding:0; - margin:0; -} -#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; - background-color:#EAEEF4; -} -#alphabet ul li.letters { - margin:0; - float:left; -} -.letters:after { - content:" |"; -} -#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color:#000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -#alphabet ul li.letters a:hover { - background-color:#000; - color:#FFF; -} - /* Navigation ----------------------------------------------------- */ #navigation, #subnavigation { diff --git a/src/data/Web_Mainz.css b/src/data/Web_Mainz.css index 047c8f118..d1d3bf934 100644 --- a/src/data/Web_Mainz.css +++ b/src/data/Web_Mainz.css @@ -198,43 +198,6 @@ a:visited { margin:0 0 5px 50px; } -/* Alphabet Navigation ------------------------------------------------------ */ -#alphabet { - padding:0; - margin:0; -} -#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; - background:url(../images/Web_Mainz_MidLight.png) #FFF2C6; -} -#alphabet ul li.letters { - margin:0; - float:left; -} -.letters:after { - content:" |"; -} -#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color:#000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -#alphabet ul li.letters a:hover { - background-color:#000; - color:#FFF; -} - /* Navigation ----------------------------------------------------- */ #navigation, #subnavigation { diff --git a/src/data/Web_Nebraska.css b/src/data/Web_Nebraska.css index 8b1fccb88..059d7c95d 100644 --- a/src/data/Web_Nebraska.css +++ b/src/data/Web_Nebraska.css @@ -203,43 +203,6 @@ p#user_header { background-color:#542; } -/* Alphabet Navigation ------------------------------------------------------ */ -#alphabet { - padding:0; - margin:0; -} -#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; - background-color:#A97; -} -#alphabet ul li.letters { - margin:0; - float:left; -} -.letters:after { - content:" |"; -} -#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color:#000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -#alphabet ul li.letters a:hover { - background-color:#000; - color:#FFF; -} - /* Navigation ----------------------------------------------------- */ #navigation, #subnavigation { diff --git a/src/data/Web_Visually.css b/src/data/Web_Visually.css index c16a93b98..73eb43c19 100644 --- a/src/data/Web_Visually.css +++ b/src/data/Web_Visually.css @@ -51,18 +51,16 @@ Females Web_Gender_Female.png # $Id$ NarrativeWeb Styles --------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------- */ +body#NarrativeWeb { + font-family: Arial, sans, sans-serif, Helvetica; + color: #000; + background-color: #FFF; +} - General Elements +/* General Elements ----------------------------------------------------- */ -body#NarrativeWeb { - color: #000; - margin: 0; - padding: 130px 0px 0px 54px; - background-color: #FFF; - font-family: Arial, sans, sans-serif, Helvetica; -} div { margin:0; padding:0; @@ -196,13 +194,6 @@ span.preposition { /* Header ----------------------------------------------------- */ #header { - position: fixed; - top: 0px; - left: 0px; - overflow: auto; - width: 100%; - height: 90px; - margin: 0; background-color: #542; border-bottom: solid 8px #5D835F; } @@ -211,7 +202,7 @@ span.preposition { padding:.5em 0 0.5em 10px; font-size: 40px; color: #FFF; - font-style:italic; + font-style: italic; } p#user_header { font-size:1.3em; @@ -224,14 +215,8 @@ p#user_header { /* Footer ----------------------------------------------------- */ #footer { - width: 100%; - height: 60px; - overflow: auto; - clear: both; - font-size: 12px; color: #FFF; background-color: #542; - margin: 0; border-top: solid 8px #5D835F; } #footer a, #footer a:visited { @@ -275,42 +260,12 @@ p#user_header { padding:0; } -/* Alphabet Navigation +/* Alphabet Navigation Bar ----------------------------------------------------- */ #alphabet { position: fixed; top: 136px; - left: 4px; - width: 50px; - height: 800px; - overflow: auto; - background-color :#6AF364; - border-width: 2px 4px 0px 4px; - border-style: solid; - border-color: #5D835F; -} -#alphabet ul { - display: inline; - list-style: none; - margin: 0; -} -#alphabet ul li:first-child { - margin-top: 10px; -} -#alphabet ul li { - font: bold 14px/100% sans; - color: #000; - padding: 6px 10px 6px 16px; - margin:0; - float: left; - border-bottom: solid 2px #000; -} -#alphabet ul li a { - text-decoration: none; -} -#alphabet ul li a:hover { - display: block; - background-color: #C1B398; + background-color: #6AF364; } /* Navigation @@ -328,8 +283,8 @@ body#NarrativeWeb #navigation { min-width:770px; height:32px; margin:0; - padding:0 0 0 20px; - border-bottom:solid 2px #5D835F; + padding: 0px 0px 0px 20px; + border-bottom: solid 2px #5D835F; } #navigation ul li, #subnavigation ul li { margin:0; @@ -349,7 +304,7 @@ body#WebCal div#navigation ul li a { } #navigation ul li a:hover, #subnavigation ul li a:hover { margin-top: -6px; - padding: 11px 10px 12px 1px; + padding: 11px 11px 12px 10px; background-color: #C1B398; color: #000; } @@ -357,7 +312,7 @@ body#WebCal div#navigation ul li a { font-weight:bold; font-style: italic; margin-top:-6px; - padding: 11px 10px 12px 1px; + padding: 11px 11px 12px 10px; background-color: #CCC; color: #000; } @@ -897,7 +852,15 @@ table.download td.ColumnModified { /* Repositories ------------------------------------------------------ */ -#RepositoryList table.repolist tbody tr td.ColumnName { +div#RepositoryList { } + +div#RepositoryList table.repolist tbody tr td.ColumnRowLabel { + width: 14%; +} +div#RepositoryList table.repolist tbody tr td.ColumnType { + width: 14%; +} +div#RepositoryList table.repolist tbody tr td.ColumnName { background-color: #FFF; } diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index e7c2dd462..ca88c2214 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -142,7 +142,7 @@ SHEAD = _('Sources') ST = _('Status') STATE = _('State/ Province') STREET = _('Street') -THEAD = _('Type') +THEAD = _("Type") TMPL = _('Temple') VHEAD = _('Value') @@ -785,7 +785,7 @@ class BasePage(object): 'year' : year} elif 0 < copyright <= len(_CC): # Note. This is a URL - fname = '/'.join(["images", "somerights20.gif"]) + fname = "/".join(["images", "somerights20.gif"]) url = self.report.build_url_fname(fname, None, up=False) text = _CC[copyright] % {'gif_fname' : url} @@ -922,7 +922,7 @@ class BasePage(object): 'year' : year} elif 0 < copy_nr <= len(_CC): # Note. This is a URL - fname = '/'.join(["images", "somerights20.gif"]) + fname = "/".join(["images", "somerights20.gif"]) url = self.report.build_url_fname(fname, None, self.up) text = _CC[copy_nr] % {'gif_fname' : url} footer += Html('p', text, id='copyright') @@ -953,31 +953,36 @@ class BasePage(object): body.attr = 'id="NarrativeWeb" ' # create additional meta tags - meta = (Html('meta', attr = _META1) + - Html('meta', attr = _META2, indent=False) + meta = (Html("meta", attr = _META1) + + Html("meta", attr = _META2, indent=False) ) # Link to media reference regions behaviour stylesheet - fname = '/'.join(["styles", "behaviour.css"]) - url1= self.report.build_url_fname(fname, None, self.up) + fname = "/".join(["styles", "behaviour.css"]) + url1 = self.report.build_url_fname(fname, None, self.up) + + # link to alphabet navigation bar layout + fname = "/".join(["styles", "alphabet-layout.css"]) + url2 = self.report.build_url_fname(fname, None, self.up) # Link to _NARRATIVESCREEN stylesheet - fname = '/'.join(["styles", _NARRATIVESCREEN]) + fname = "/".join(["styles", _NARRATIVESCREEN]) url3 = self.report.build_url_fname(fname, None, self.up) # Link to _NARRATIVEPRINT stylesheet - fname = '/'.join(["styles", _NARRATIVEPRINT]) + fname = "/".join(["styles", _NARRATIVEPRINT]) url4 = self.report.build_url_fname(fname, None, self.up) # Link to GRAMPS favicon - fname = '/'.join(['images', 'favicon.ico']) + fname = "/".join(['images', 'favicon.ico']) url5 = self.report.build_url_image('favicon.ico', 'images', self.up) # create stylesheet and favicon links - links = [Html('link', href=url5, type='image/x-icon', rel='shortcut icon'), - Html('link', href=url1, type='text/css', media='screen', rel='stylesheet'), - Html('link', href=url3, type='text/css', media='screen', rel='stylesheet'), - Html('link', href=url4, type='text/css', media='print', rel='stylesheet') + links = [Html("link", href=url5, type="image/x-icon", rel="shortcut icon"), + Html("link", href=url1, type="text/css", media="screen", rel="stylesheet"), + Html("link", href = url2, type="text/css", media="screen", rel="stylesheet"), + Html("link", href=url3, type="text/css", media="screen", rel="stylesheet"), + Html("link", href=url4, type="text/css", media='print', rel="stylesheet") ] # add additional meta and link tags @@ -1105,9 +1110,9 @@ class BasePage(object): real_path, newpath = self.report.prepare_copy_media(photo) # TODO. Check if build_url_fname can be used. - newpath = '/'.join(['..']*3 + [newpath]) + newpath = "/".join(['..']*3 + [newpath]) if ( Utils.win ): - newpath = newpath.replace('\\','/') + newpath = newpath.replace('\\',"/") # begin hyperlink # description is given only for the purpose of the alt tag in img element @@ -1165,9 +1170,9 @@ class BasePage(object): self.report.add_lnkref_to_photo(photo, lnkref) real_path, newpath = self.report.prepare_copy_media(photo) # TODO. Check if build_url_fname can be used. - newpath = '/'.join(['..']*3 + [newpath]) + newpath = "/".join(['..']*3 + [newpath]) if ( Utils.win ): - newpath = newpath.replace('\\','/') + newpath = newpath.replace('\\',"/") # begin hyperlink section += self.media_link(photo_handle, newpath, descr, True, False) @@ -1510,17 +1515,17 @@ class IndividualListPage(BasePage): with Html("div", class_ = "content", id="Individuals") as individuallist: body += individuallist - # add alphabet navigation - alpha_nav = alphabet_navigation(db, person_handle_list, _PERSON) - if alpha_nav is not None: - individuallist += alpha_nav - # Individual List page message msg = _("This page contains an index of all the individuals in the " "database, sorted by their last names. Selecting the person’s " "name will take you to that person’s individual page.") individuallist += Html('p', msg, id='description') + # add alphabet navigation + alpha_nav = alphabet_navigation(db, person_handle_list, _PERSON) + if alpha_nav is not None: + individuallist += alpha_nav + # begin table and table head with Html("table", class_ = "infolist IndividualList") as table: individuallist += table @@ -1849,17 +1854,17 @@ class PlaceListPage(BasePage): with Html("div", class_ = "content", id="Places") as placelist: body += placelist - # begin alphabet navigation - alpha_nav = alphabet_navigation(db, place_handles, _PLACE) - if alpha_nav is not None: - placelist += alpha_nav - # place list page message msg = _("This page contains an index of all the places in the " "database, sorted by their title. Clicking on a place’s " "title will take you to that place’s page.") placelist += Html('p', msg, id='description') + # begin alphabet navigation + alpha_nav = alphabet_navigation(db, place_handles, _PLACE) + if alpha_nav is not None: + placelist += alpha_nav + # begin places table and table head with Html("table", class_ = "infolist placelist") as table: placelist += table @@ -2611,7 +2616,8 @@ class SurnameListPage(BasePage): ORDER_BY_NAME = 0 ORDER_BY_COUNT = 1 - def __init__(self, report, title, person_handle_list, order_by=ORDER_BY_NAME, filename="surnames"): + def __init__(self, report, title, person_handle_list, order_by=ORDER_BY_NAME, + filename="surnames"): BasePage.__init__(self, report, title) db = report.database @@ -2626,13 +2632,6 @@ class SurnameListPage(BasePage): with Html("div", class_ = "content", id="surnames") as surnamelist: body += surnamelist - # add alphabet navigation... - # only if surname list not surname count - if order_by == self.ORDER_BY_NAME: - alpha_nav = alphabet_navigation(db, person_handle_list, _PERSON) - if alpha_nav is not None: - surnamelist += alpha_nav - # page message msg = _( 'This page contains an index of all the ' 'surnames in the database. Selecting a link ' @@ -2640,6 +2639,13 @@ class SurnameListPage(BasePage): 'database with this same surname.') surnamelist += Html('p', msg, id='description') + # add alphabet navigation... + # only if surname list not surname count + if order_by == self.ORDER_BY_NAME: + alpha_nav = alphabet_navigation(db, person_handle_list, _PERSON) + if alpha_nav is not None: + surnamelist += alpha_nav + if order_by == self.ORDER_BY_COUNT: table_id = 'SortByCount' else: @@ -3412,9 +3418,9 @@ class IndividualPage(BasePage): mime_type = photo.get_mime_type() if mime_type: (photoUrl, thumbnailUrl) = self.report.prepare_copy_media(photo) - thumbnailUrl = '/'.join(['..']*3 + [thumbnailUrl]) + thumbnailUrl = "/".join(['..']*3 + [thumbnailUrl]) if ( Utils.win ): - thumbnailUrl = thumbnailUrl.replace('\\','/') + thumbnailUrl = thumbnailUrl.replace('\\',"/") url = self.report.build_url_fname_html(person.handle, 'ppl', True) boxbg += self.person_link(url, person, name_style=True, thumbnailUrl=thumbnailUrl) @@ -4424,8 +4430,8 @@ class RepositoryListPage(BasePage): table += thead trow = Html("tr") + ( - Html("th", " ", class_ = "ColumnRowLabel", inline = True), - Html("th", _('Type'), class_ = "ColumnType", inline = True), + Html("th", _("Number"), class_ = "ColumnRowLabel", inline = True), + Html("th", THEAD, class_ = "ColumnType", inline = True), Html("th", _('Name'), class_ = "ColumnName", inline = True) ) thead += trow @@ -4441,8 +4447,9 @@ class RepositoryListPage(BasePage): trow = Html("tr") tbody += trow - # index number - tcell = Html("td", index+1, class_ = "ColumnRowLabel", inline = True) + # index number -- lower roman numerals + tcell = Html("td", index + 1class_ = "ColumnRowLabel", + inline = True) trow += tcell # repository type @@ -4592,6 +4599,9 @@ class NavWebReport(Report): # include GENDEX page or not? self.inc_gendex = self.options['inc_gendex'] + # Specify the layout for the alphabet navigation bar + self.alphabar = self.options["alpha_nav_bar"] + # Download Options Tab self.inc_download = self.options['incdownload'] self.downloadnote = self.options['downloadnote'] @@ -4766,6 +4776,12 @@ class NavWebReport(Report): fname = os.path.join(const.DATA_DIR, "behaviour.css") self.copy_file(fname, "behaviour.css", "styles") + # copy alphabet navigation bar layout + fname = os.path.join(const.DATA_DIR, "Web_Alphabet-Horizontal.css") + if self.alphabar == "Vertical": + fname = os.path.join(const.DATA_DIR, "Web_Alphabet-Vertical.css") + self.copy_file(fname, "alphabet-layout.css", "styles") + # copy screen stylesheet if self.css: fname = os.path.join(const.DATA_DIR, self.css) @@ -5144,9 +5160,9 @@ class NavWebReport(Report): subdirs.append(subdir) if up: subdirs = ['..']*3 + subdirs - nname = '/'.join(subdirs + [fname]) + nname = "/".join(subdirs + [fname]) if ( Utils.win ): - nname = nname.replace('\\','/') + nname = nname.replace('\\',"/") return nname def build_url_fname_html(self, fname, subdir=None, up=False): @@ -5167,9 +5183,9 @@ class NavWebReport(Report): see backslashes in the URL. """ if ( Utils.win ): - fname = fname.replace('\\','/') + fname = fname.replace('\\',"/") subdirs = self.build_subdirs(subdir, fname, up) - return '/'.join(subdirs + [fname]) + return "/".join(subdirs + [fname]) def create_file(self, fname, subdir=None, ext=None): if ext is None: @@ -5518,6 +5534,18 @@ class NavWebOptions(MenuReportOptions): encoding.set_help( _("The encoding to be used for the web files")) menu.add_option(category_name, "encoding", encoding) + alpha_opts = [ + [_("Horizontal"), "Horizontal" ], + [_("Vertical"), "Vertical" ], + ] + + alpha_nav_bar = EnumeratedListOption(_("Alphabet Navigation Layout"), alpha_opts[0][1] ) + for opt in alpha_opts: + alpha_nav_bar.add_item(opt[0], opt[1] ) + alpha_nav_bar.set_help(_("Specify which direction the alphabet " + "navigation bar is presented.") ) + menu.add_option(category_name, "alpha_nav_bar", alpha_nav_bar) + linkhome = BooleanOption(_('Include link to home person on every ' 'page'), False) linkhome.set_help(_('Whether to include a link to the home person'))