CSS and web resources are now a plugin

svn: r15711
This commit is contained in:
Doug Blank 2010-08-12 05:26:45 +00:00
parent e9ad85a05c
commit 2fc5096d23
33 changed files with 14958 additions and 100 deletions

View File

@ -147,6 +147,7 @@ src/plugins/textreport/Makefile
src/plugins/tool/Makefile src/plugins/tool/Makefile
src/plugins/view/Makefile src/plugins/view/Makefile
src/plugins/webreport/Makefile src/plugins/webreport/Makefile
src/plugins/webstuff/Makefile
src/DateHandler/Makefile src/DateHandler/Makefile
src/data/Makefile src/data/Makefile
src/glade/Makefile src/glade/Makefile

View File

@ -1066,8 +1066,6 @@ class PluginRegister(object):
rmlist = [] rmlist = []
ind = lenpd-1 ind = lenpd-1
for plugin in self.__plugindata[lenpd:]: for plugin in self.__plugindata[lenpd:]:
if plugin.category == 'TEST':
import pdb; pdb.set_trace()
ind += 1 ind += 1
plugin.directory = dir plugin.directory = dir
if not valid_plugin_version(plugin.gramps_target_version): if not valid_plugin_version(plugin.gramps_target_version):

View File

@ -57,32 +57,3 @@ book_categories = {
CATEGORY_DRAW : _("Graphics"), CATEGORY_DRAW : _("Graphics"),
} }
#Common data for html reports
## TODO: move to a system where css files are registered
# This information defines the list of styles in the Web reports
# options dialog as well as the location of the corresponding
# stylesheets in src/data.
CSS_FILES = [
# id, user selectable, translated_name, fullpath, navigation target name, additional files
# "default" is used as default
["Basic-Ash", 1, _("Basic-Ash"), os.path.join(const.DATA_DIR, 'Web_Basic-Ash.css'), None, []],
["Basic-Blue", 1, _("Basic-Blue"), os.path.join(const.DATA_DIR, 'Web_Basic-Blue.css'), "navigation-menus.css", []],
["Basic-Cypress", 1, _("Basic-Cypress"), os.path.join(const.DATA_DIR, 'Web_Basic-Cypress.css'), None, []],
["Basic-Lilac", 1, _("Basic-Lilac"), os.path.join(const.DATA_DIR, 'Web_Basic-Lilac.css'), None, []],
["Basic-Peach", 1, _("Basic-Peach"), os.path.join(const.DATA_DIR, 'Web_Basic-Peach.css'), None, []],
["Basic-Spruce", 1, _("Basic-Spruce"), os.path.join(const.DATA_DIR, 'Web_Basic-Spruce.css'), None, []],
["Mainz", 1, _("Mainz"), os.path.join(const.DATA_DIR, 'Web_Mainz.css'), None,
[os.path.join(const.IMAGE_DIR, "Web_Mainz_Bkgd.png"),
os.path.join(const.IMAGE_DIR, "Web_Mainz_Header.png"),
os.path.join(const.IMAGE_DIR, "Web_Mainz_Mid.png"),
os.path.join(const.IMAGE_DIR, "Web_Mainz_MidLight.png")]],
["Nebraska", 1, _("Nebraska"), os.path.join(const.DATA_DIR, 'Web_Nebraska.css'), None, []],
["Visually Impaired", 1, _("Visually Impaired"), os.path.join(const.DATA_DIR, 'Web_Visually.css'), "navigation-menus.css", []],
["No style sheet",1, _("No style sheet"), '', None, []],
["behaviour", 0, "Behaviour", os.path.join(const.DATA_DIR, 'behaviour.css'), None, []],
["default", 0, _("Basic-Ash"), os.path.join(const.DATA_DIR, 'Web_Basic-Ash.css'), None, []],
["Print-Default", 0, "Print-Default", os.path.join(const.DATA_DIR, 'Web_Print-Default.css'), None, []],
["Navigation-Vertical", 0, "Navigation-Vertical", os.path.join(const.DATA_DIR, 'Web_Navigation-Vertical.css'), None, []],
["Navigation-Horizontal", 0, "Navigation-Horizontal", os.path.join(const.DATA_DIR, 'Web_Navigation-Horizontal.css'), None, []],
]

View File

@ -43,8 +43,9 @@ import gtk
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import const import const
from _reportdialog import ReportDialog from _reportdialog import ReportDialog
from gen.plug.report._constants import CSS_FILES
from _papermenu import PaperFrame from _papermenu import PaperFrame
from gui.pluginmanager import GuiPluginManager
PLUGMAN = GuiPluginManager.get_instance()
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -63,12 +64,14 @@ class DocReportDialog(ReportDialog):
self.style_name = "default" self.style_name = "default"
self.firstpage_added = False self.firstpage_added = False
self.CSS = PLUGMAN.process_plugin_data('WEBSTUFF')
ReportDialog.__init__(self, dbstate, uistate, option_class, ReportDialog.__init__(self, dbstate, uistate, option_class,
name, trans_name) name, trans_name)
# Allow for post processing of the format frame, since the # Allow for post processing of the format frame, since the
# show_all task calls events that may reset values # show_all task calls events that may reset values
def init_interface(self): def init_interface(self):
ReportDialog.init_interface(self) ReportDialog.init_interface(self)
self.doc_type_changed(self.format_menu) self.doc_type_changed(self.format_menu)
@ -93,8 +96,7 @@ class DocReportDialog(ReportDialog):
self.doc = self.format(self.selected_style, pstyle) self.doc = self.format(self.selected_style, pstyle)
if not self.format_menu.get_active_plugin().get_paper_used(): if not self.format_menu.get_active_plugin().get_paper_used():
#set css filename #set css filename
self.doc.set_css_filename(const.DATA_DIR + os.sep + self.doc.set_css_filename(self.css_filename)
self.css_filename)
self.options.set_document(self.doc) self.options.set_document(self.doc)
@ -206,11 +208,15 @@ class DocReportDialog(ReportDialog):
css_filename = self.options.handler.get_css_filename() css_filename = self.options.handler.get_css_filename()
active_index = 0 active_index = 0
index = 0 index = 0
for style in CSS_FILES: for (name, id) in sorted([(self.CSS[key]["translation"], self.CSS[key]["id"])
self.css_combo.append_text(style[0]) for key in self.CSS]):
if css_filename == style[1]: if self.CSS[id]["user"]:
active_index = index self.css_combo.append_text(self.CSS[id]["translation"])
index += 1 # Associate this index number with CSS too:
self.CSS[index] = self.CSS[id]
if css_filename == self.CSS[id]["filename"]:
active_index = index
index += 1
self.html_table.attach(self.css_combo,2,3,1,2, yoptions=gtk.SHRINK) self.html_table.attach(self.css_combo,2,3,1,2, yoptions=gtk.SHRINK)
self.css_combo.set_active(active_index) self.css_combo.set_active(active_index)
@ -230,7 +236,7 @@ class DocReportDialog(ReportDialog):
displayed on the screen. The subclass will know whether this displayed on the screen. The subclass will know whether this
entry was enabled. This is for simplicity of programming.""" entry was enabled. This is for simplicity of programming."""
self.css_filename = CSS_FILES[self.css_combo.get_active()][1] self.css_filename = self.CSS[self.css_combo.get_active()]["filename"]
self.options.handler.set_css_filename(self.css_filename) self.options.handler.set_css_filename(self.css_filename)
def on_ok_clicked(self, obj): def on_ok_clicked(self, obj):

View File

@ -18,7 +18,8 @@ SUBDIRS = \
textreport \ textreport \
tool \ tool \
view \ view \
webreport webreport \
webstuff
pkgdatadir = $(datadir)/@PACKAGE@/plugins pkgdatadir = $(datadir)/@PACKAGE@/plugins

View File

@ -81,7 +81,7 @@ import Sort
from gen.plug.menu import PersonOption, NumberOption, StringOption, \ from gen.plug.menu import PersonOption, NumberOption, StringOption, \
BooleanOption, EnumeratedListOption, FilterOption, \ BooleanOption, EnumeratedListOption, FilterOption, \
NoteOption, MediaOption, DestinationOption NoteOption, MediaOption, DestinationOption
from gen.plug.report import ( Report, Bibliography, CSS_FILES ) from gen.plug.report import ( Report, Bibliography)
from gen.plug.report import utils as ReportUtils from gen.plug.report import utils as ReportUtils
from gui.plug.report import MenuReportOptions from gui.plug.report import MenuReportOptions
@ -107,6 +107,8 @@ from libhtmlbackend import HtmlBackend
from libgedcom import make_gedcom_date from libgedcom import make_gedcom_date
from PlaceUtils import conv_lat_lon from PlaceUtils import conv_lat_lon
from gui.pluginmanager import GuiPluginManager
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# constants # constants
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -192,17 +194,8 @@ _html_replacement = {
"<" : "&#60;", "<" : "&#60;",
} }
def make_css_dict(tup): PLUGMAN = GuiPluginManager.get_instance()
return { CSS = PLUGMAN.process_plugin_data('WEBSTUFF')
"id": tup[0],
"user": tup[1],
"translation": tup[2],
"filename": tup[3],
"navigation": tup[4],
"images": tup[5],
}
CSS = dict([(css[0], make_css_dict(css)) for css in CSS_FILES])
# This command then defines the 'html_escape' option for escaping # This command then defines the 'html_escape' option for escaping
# special characters for presentation in HTML based on the above list. # special characters for presentation in HTML based on the above list.
@ -307,9 +300,9 @@ def copy_thumbnail(report, handle, photo, region=None):
photo.get_mime_type(), photo.get_mime_type(),
region) region)
if not os.path.isfile(from_path): if not os.path.isfile(from_path):
from_path = os.path.join(const.IMAGE_DIR, "document.png") from_path = CSS["Document"]["filename"]
else: else:
from_path = os.path.join(const.IMAGE_DIR, "document.png") from_path = CSS["Document"]["filename"]
report.copy_file(from_path, to_path) report.copy_file(from_path, to_path)
return to_path return to_path
@ -1146,7 +1139,7 @@ class BasePage(object):
) )
# Link to Navigation Menus stylesheet # Link to Navigation Menus stylesheet
if CSS[self.report.css]["navigation"]: # in ["Web_Basic-Blue.css", "Web_Visually.css"]: if CSS[self.report.css]["navigation"]:
fname = "/".join(["styles", CSS[self.report.css]["navigation"]]) fname = "/".join(["styles", CSS[self.report.css]["navigation"]])
url = self.report.build_url_fname(fname, None, self.up) url = self.report.build_url_fname(fname, None, self.up)
links += Html("link", href = url, type = "text/css", media = "screen", rel = "stylesheet", indent = False) links += Html("link", href = url, type = "text/css", media = "screen", rel = "stylesheet", indent = False)
@ -5699,7 +5692,7 @@ class NavWebReport(Report):
""" """
# copy behaviour style sheet # copy behaviour style sheet
fname = CSS["behaviour"]["filename"] # "behaviour.css") fname = CSS["behaviour"]["filename"]
self.copy_file(fname, "behaviour.css", "styles") self.copy_file(fname, "behaviour.css", "styles")
# copy screen style sheet # copy screen style sheet
@ -5708,11 +5701,11 @@ class NavWebReport(Report):
self.copy_file(fname, _NARRATIVESCREEN, "styles") self.copy_file(fname, _NARRATIVESCREEN, "styles")
# copy Navigation Menu Layout style sheet if Blue or Visually is being used # copy Navigation Menu Layout style sheet if Blue or Visually is being used
if CSS[self.css]["navigation"]: #== "Web_Basic-Blue.css" or "Web_Visually.css": if CSS[self.css]["navigation"]:
if self.navigation == "Horizontal": if self.navigation == "Horizontal":
fname = CSS["Navigation-Horizontal"]["filename"] #"Web_Navigation-Horizontal.css") fname = CSS["Navigation-Horizontal"]["filename"]
else: else:
fname = CSS["Navigation-Vertical"]["filename"] # "Web_Navigation-Vertical.css") fname = CSS["Navigation-Vertical"]["filename"]
self.copy_file(fname, "navigation-menus.css", "styles") self.copy_file(fname, "navigation-menus.css", "styles")
# copy Mapstraction style sheet if using Place Maps # copy Mapstraction style sheet if using Place Maps
@ -5721,7 +5714,7 @@ class NavWebReport(Report):
self.copy_file(fname, "mapstraction.css", "styles") self.copy_file(fname, "mapstraction.css", "styles")
# copy printer style sheet # copy printer style sheet
fname = CSS["Print-Default"]["filename"] # "Web_Print-Default.css") fname = CSS["Print-Default"]["filename"]
self.copy_file(fname, _NARRATIVEPRINT, "styles") self.copy_file(fname, _NARRATIVEPRINT, "styles")
# copy mapstraction files to mapstraction directory # copy mapstraction files to mapstraction directory
@ -5745,31 +5738,21 @@ class NavWebReport(Report):
# Copy the Creative Commons icon if the Creative Commons # Copy the Creative Commons icon if the Creative Commons
# license is requested # license is requested
if 0 < self.copyright <= len(_CC): if 0 < self.copyright <= len(_CC):
imgs += ["somerights20.gif"] imgs += [CSS["Copyright"]["filename"]]
# include GRAMPS favicon # include GRAMPS favicon
imgs += ["favicon2.ico"]
# we need the blank image gif neede by behaviour.css # we need the blank image gif neede by behaviour.css
imgs += ["blank.gif"]
# add the document.png file for media other than photos # add the document.png file for media other than photos
imgs += ["document.png"] imgs += CSS["All Images"]["images"]
# copy Ancestor Tree graphics if needed??? # copy Ancestor Tree graphics if needed???
if self.graph: if self.graph:
imgs += ["Web_Gender_Female.png", imgs += CSS["Gender Images"]["images"]
"Web_Gender_Male.png" ]
# add system path to images: # Anything css-specific:
imgs = [os.path.join(const.IMAGE_DIR, fname) for fname in imgs] imgs += CSS[self.css]["images"]
# Mainz stylesheet graphics
# will only be used if Mainz is slected as the stylesheet
#if self.css == "Web_Mainz.css":
imgs += CSS[self.css]["images"] #[ "Web_Mainz_Bkgd.png", "Web_Mainz_Header.png",
#"Web_Mainz_Mid.png", "Web_Mainz_MidLight.png" ]
# copy all to images subdir:
for from_path in imgs: for from_path in imgs:
fdir, fname = os.path.split(from_path) fdir, fname = os.path.split(from_path)
self.copy_file(from_path, fname, "images") self.copy_file(from_path, fname, "images")
@ -6643,7 +6626,7 @@ class NavWebOptions(MenuReportOptions):
""" """
css_opts = self.__css.get_value() css_opts = self.__css.get_value()
if CSS[css_opts]["navigation"]: # in ["Web_Basic-Blue.css", "Web_Visually.css"]: if CSS[css_opts]["navigation"]:
self.__navigation.set_available(True) self.__navigation.set_available(True)
else: else:
self.__navigation.set_available(False) self.__navigation.set_available(False)

View File

@ -52,7 +52,7 @@ log = logging.getLogger(".WebPage")
import gen.lib import gen.lib
import const import const
import constfunc import constfunc
from gen.plug.report import Report, CSS_FILES from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils from gen.plug.report import utils as ReportUtils
from gui.plug.report import MenuReportOptions from gui.plug.report import MenuReportOptions
from gen.plug.menu import BooleanOption, NumberOption, StringOption, \ from gen.plug.menu import BooleanOption, NumberOption, StringOption, \
@ -69,6 +69,7 @@ from gen.display.name import displayer as _nd
import libholiday import libholiday
from libhtml import Html from libhtml import Html
from libhtmlconst import _CHARACTER_SETS, _CC, _COPY_OPTIONS from libhtmlconst import _CHARACTER_SETS, _CC, _COPY_OPTIONS
from gui.pluginmanager import GuiPluginManager
# import styled notes from # import styled notes from
# src/plugins/lib/libhtmlbackend.py # src/plugins/lib/libhtmlbackend.py
@ -88,6 +89,9 @@ _WEB_EXT = ['.html', '.htm', '.shtml', '.php', '.php3', '.cgi']
_CALENDARSCREEN = 'calendar-screen.css' _CALENDARSCREEN = 'calendar-screen.css'
_CALENDARPRINT = 'calendar-print.css' _CALENDARPRINT = 'calendar-print.css'
PLUGMAN = GuiPluginManager.get_instance()
CSS = PLUGMAN.process_plugin_data('WEBSTUFF')
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# WebCalReport # WebCalReport
@ -322,37 +326,34 @@ class WebCalReport(Report):
""" """
# Copy the screen stylesheet # Copy the screen stylesheet
if self.css: if self.css:
fname = os.path.join(const.DATA_DIR, self.css) fname = CSS[self.css]["filename"]
self.copy_file(fname, _CALENDARSCREEN, "styles") self.copy_file(fname, _CALENDARSCREEN, "styles")
# copy Navigation Menu Layout if Blue or Visually is being used # copy Navigation Menu Layout if Blue or Visually is being used
if self.css == "Web_Basic-Blue.css" or "Web_Visually.css": if CSS[self.css]["navigation"]:
fname = os.path.join(const.DATA_DIR, "Web_Navigation-Horizontal.css") fname = CSS["Navigation-Horizontal"]["filename"]
self.copy_file(fname, "Web_Navigation-Menus.css", "styles") self.copy_file(fname, "Web_Navigation-Menus.css", "styles")
# copy print stylesheet # copy print stylesheet
fname = os.path.join(const.DATA_DIR, "Web_Print-Default.css") fname = CSS["Print-Default"]["filename"]
self.copy_file(fname, _CALENDARPRINT, "styles") self.copy_file(fname, _CALENDARPRINT, "styles")
# set imgs to empty # set imgs to empty
imgs = [] imgs = []
if self.css == "Web_Mainz.css": # Mainz stylesheet graphics
# will only be used if Mainz is slected as the stylesheet
# Mainz stylesheet graphics imgs += CSS[self.css]["images"]
# will only be used if Mainz is slected as the stylesheet
imgs += ["Web_Mainz_Bkgd.png", "Web_Mainz_Header.png",
"Web_Mainz_Mid.png", "Web_Mainz_MidLight.png"]
# Copy GRAMPS favicon # Copy GRAMPS favicon
imgs += ['favicon.ico'] imgs += CSS["All Images"]['images']
# copy copyright image # copy copyright image
if 0 < self.copy <= len(_CC): if 0 < self.copy <= len(_CC):
imgs += ['somerights20.gif'] imgs += CSS["Copyright"]['filename']
for fname in imgs: for from_path in imgs:
from_path = os.path.join(const.IMAGE_DIR, fname) fdir, fname = os.path.split(from_path)
self.copy_file(from_path, fname, "images") self.copy_file(from_path, fname, "images")
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
@ -437,7 +438,7 @@ class WebCalReport(Report):
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 horizontal menu if css == Blue or Visually because there is no menus # add horizontal menu if css == Blue or Visually because there is no menus
if self.css in ["Web_Basic-Blue.css", "Web_Visually.css"]: if CSS[self.css]["navigation"]:
# Link to Navigation Menus stylesheet # Link to Navigation Menus stylesheet
fname = os.path.join(subdirs, "styles", "Web_Navigation-Menus.css") fname = os.path.join(subdirs, "styles", "Web_Navigation-Menus.css")
@ -847,7 +848,7 @@ class WebCalReport(Report):
self.progress.set_pass(_('Formatting months ...'), 12) self.progress.set_pass(_('Formatting months ...'), 12)
for month in range(1, 13): for month in range(1, 13):
import pdb; pdb.set_trace()
cal_fname = get_full_month_name(month) cal_fname = get_full_month_name(month)
of = self.create_file(cal_fname, str(year)) of = self.create_file(cal_fname, str(year))
@ -1247,8 +1248,9 @@ class WebCalReport(Report):
""" """
# writes the file out from the page variable; Html instance # writes the file out from the page variable; Html instance
page.write(partial(print, file=of.write)) # This didn't work for some reason, but it does in NarWeb:
#page.write(partial(print, file=of.write))
page.write(lambda line: of.write(line + '\n'))
# close the file now... # close the file now...
self.close_file(of) self.close_file(of)
@ -1388,9 +1390,11 @@ class WebCalOptions(MenuReportOptions):
cright.set_help( _("The copyright to be used for the web files")) cright.set_help( _("The copyright to be used for the web files"))
menu.add_option(category_name, "cright", cright) menu.add_option(category_name, "cright", cright)
css = EnumeratedListOption(_('StyleSheet'), CSS_FILES[0][1]) css = EnumeratedListOption(_('StyleSheet'), CSS["default"]["id"])
for style in CSS_FILES: for (name, id) in sorted([(CSS[key]["translation"], CSS[key]["id"])
css.add_item(style[1], style[0]) for key in CSS.keys()]):
if CSS[id]["user"]:
css.add_item(CSS[id]["translation"], CSS[id]["id"])
css.set_help( _('The stylesheet to be used for the web pages')) css.set_help( _('The stylesheet to be used for the web pages'))
menu.add_option(category_name, "css", css) menu.add_option(category_name, "css", css)

View File

@ -0,0 +1,47 @@
# This is the src/plugins/webstuff level Makefile for Gramps
# We could use GNU make's ':=' syntax for nice wildcard use,
# but that is not necessarily portable.
# If not using GNU make, then list all .py files individually
DATAFILES = \
css/behaviour.css \
css/Web_Basic-Spruce.css \
css/Web_Mainz.css \
css/Web_Basic-Ash.css \
css/Web_Navigation-Horizontal.css \
css/Web_Basic-Blue.css \
css/Web_Navigation-Vertical.css \
css/Web_Basic-Cypress.css \
css/Web_Nebraska.css \
css/Web_Basic-Lilac.css \
css/Web_Print-Default.css \
css/Web_Basic-Peach.css \
css/Web_Visually.css \
images/blank.gif \
images/document.png \
images/favicon2.ico \
images/favicon.ico \
images/Web_Gender_Female.png \
images/Web_Gender_Male.png \
images/Web_Mainz_Bkgd.png \
images/Web_Mainz_Header.png \
images/Web_Mainz_MidLight.png \
images/Web_Mainz_Mid.png
pkgdatadir = $(datadir)/@PACKAGE@/plugins/webstuff
pkgdata_PYTHON = \
webstuff.py \
webstuff.gpr.py
pkgpyexecdir = @pkgpyexecdir@/plugins/webstuff
pkgpythondir = @pkgpythondir@/plugins/webstuff
# Clean up all the byte-compiled files
MOSTLYCLEANFILES = *pyc *pyo
GRAMPS_PY_MODPATH = "../../"
pycheck:
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
pychecker $(pkgdata_PYTHON));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,102 @@
/*
# encoding: utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright 2008-2010 Rob G. Healey <robhealey1@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
**************************************************************************************************
GRAMPS Cascading Style Sheet
Style Name: Web_Navigation-Horizontal Stylesheet
***************************************************************************************************
# $Id: Web_Navigation-Horizontal.css 15207 2010-04-17 16:50:00Z robhealey1 $
Body Element
----------------------------------------------------- */
body {
margin: 0 auto;
padding: 0px 4px 0px 4px;
width: 1060px;
}
/* lphabet Navigation
----------------------------------------------------- */
div#alphabet {
width: 100%;
margin: 0;
}
div#alphabet ul {
list-style: none;
min-width: 770px;
height: 24px;
margin: 0;
padding: 0px 0px 0px 16px;
border-width: 2px 0px 2px 0px;
border-style: solid;
}
div#alphabet ul li {
border-width: 0px 2px 0px 2px;
border-style: solid;
margin: 0;
float: left;
}
div#alphabet ul li:first-child {
border-left: none;
}
div#alphabet ul li a {
font: normal 16px sans;
display: block;
padding: 4px 8px 4px 8px;
float: left;
margin: 0;
text-decoration: none;
}
/* Navigation/ Subnavigation
----------------------------------------------------- */
div#navigation, div#subnavigation {
width: 100%;
margin: 0;
}
div#navigation ul, div#subnavigation ul {
list-style: none;
min-width: 900px;
height: 32px;
margin: 0;
padding: 0px 0px 0px 10px;
border-width: 2px 0px 2px 0px;
border-style: solid;
}
div#navigation ul li, div#subnavigation ul li {
border-width: 0px 2px 0px 2px;
border-style: solid;
float: left;
margin: 0;
}
div#navigation ul li:first-child, div#subnavigation ul li:first-child {
border-left: none;
margin: 0 auto;
padding: 0;
}
div#navigation ul li a, div#subnavigation ul li a {
display: block;
padding: 8px 6px 6px 6px;
font: normal 12px serif;
text-decoration: none;
}

View File

@ -0,0 +1,148 @@
/*
# encoding: utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright 2008-2010 Rob G. Healey <robhealey1@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
**************************************************************************************************
GRAMPS Cascading Style Sheet
Style Name: Web_Navigation-Vertical.css Stylesheet
***************************************************************************************************
# $Id: Web_Navigation-Vertical.css 15241 2010-04-19 11:07:00Z robhealey1 $
Header
----------------------------------------------------- */
#header {
position: fixed;
top: 0px;
left: 0px;
overflow: auto;
width: 100%;
height: 65px;
}
/* Body Element
----------------------------------------------------- */
body {
color: #000;
background-color: #FFF;
padding: 60px 0px 0px 136px;
}
/* Alphabet Navigation
----------------------------------------------------- */
div#alphabet {
width: 100%;
margin: 0;
padding: 0;
border: solid 2px #000;
}
div#alphabet ul {
list-style:none;
min-width: 900px;
height: 24px;
margin:0;
padding: 0px 0px 0px 9px;
border-bottom: solid 2px #000;
}
div#alphabet ul li {
float: left;
}
div#alphabet ul li:first-child {
margin-left: 10px;
}
div#alphabet ul li:after {
content: "| ";
}
div#alphabet ul li a {
display: block;
padding: 4px 8px 4px 8px;
float: left;
font: .8em bold italic small-caps verdana, serif;
color: #000;
text-decoration:none;
margin:0;
}
/* Navigation
----------------------------------------------------- */
div#navigation {
position: fixed;
left: 0px;
top: 55px;
}
div#navigation ul {
width: 132px;
height: 424px;
list-style: none;
padding: 0px 0px 0px 8px;
border: solid 4px #000;
}
div#navigation ul li {
display: inline;
font: bold 14px/100% sans;
float: left;
border-width: 0px 0px 2px 0px;
border-style: solid;
}
div#navigation ul li:first-child {
border-top: none;
padding-top: 20px;
}
div#navigation ul li a {
text-decoration: none;
display: block;
padding: 8px;
}
/* SubNavigation
----------------------------------------------------- */
div#subnavigation {
width: 100%;
margin: 0;
padding: 0;
border: solid 2px #000;
}
div#subnavigation ul {
list-style:none;
min-width: 900px;
height: 40px;
margin:0;
padding: 0px 0px 0px 16px;
border-bottom: solid 2px #5D835F;
}
div#subnavigation ul li {
float:left;
}
div#subnavigation ul li:after {
content: "| ";
}
div#subnavigation ul li a {
display: block;
padding: 12px 16px 14px 1px;
float:left;
font: .8em bold italic small-caps verdana, serif;
color: #000;
text-decoration:none;
margin:0;
}
div#subnavigation ul li a:hover {
background-color: #C1B398;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,700 @@
/*
**************************************************************************************************
Copyright Holder and License
**************************************************************************************************
GRAMPS Cascading Style Sheet
Style Name: Print Style Sheet
Style Author: Jason M. Simanek (2008)
Modified by Rob G. Healey, July 2008-2010
**************************************************************************************************
This website was created with GRAMPS <http://www.gramps-project.org/>
--------------------------------------------------------------------------------------------------
GRAMPS is a Free Software Project for Genealogy, offering a professional
genealogy program, and a wiki open to all. It is a community project, created,
developed and governed by genealogists.
'Go to <http://gramps-project.org/> to learn more!
--------------------------------------------------------------------------------------------------
(C) Copyright 2008-2010 Rob G. Healey
This file is part of the GRAMPS program.
GRAMPS is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, version 2 of the License.
GRAMPS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
GRAMPS. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------------------------
Color Palette
--------------------------------------------------------------------------------------------------
gray #A7A7A7
red #520
black #000
white #FFF
---------------------------------------------------------------------------------------------------
# $Id: Web_Print-Default.css 15639 2010-07-16 03:17:08Z robhealey1 $
NarrativeWeb Styles
--------------------------------------------------------------------------------------------
General Elements
----------------------------------------------------- */
body {
color:#000;
margin:0;
padding:0;
background-color:#FFF;
}
div {
margin:0;
padding:0;
}
img {
border:none;
margin:0;
}
.content { }
.content div.snapshot {
float:right;
margin:1.6em;
padding-top: .5cm;
background:none;
}
.content div.snapshot div.thumbnail {
margin:0;
padding:0;
background:none;
}
.content .thumbnail a:link:after, .content .thumbnail a:visited:after {
content:"";
}
.fullclear {
width:100%;
height:1pt;
margin:0;
padding:0;
clear:both;
}
/* General Text
----------------------------------------------------- */
h1 {
font:normal 16pt/18pt serif;
margin:0;
padding:0;
}
h2 {
font:normal 18pt/23pt serif;
display:inline;
margin:0;
padding:0;
}
h3 {
font:normal 18pt/23pt serif;
text-align:left;
display:inline;
margin:0 0 0 8pt;
padding:0;
}
h4 {
display: block;
clear: both;
font: normal 14pt/16pt serif;
margin: 8pt 0 0 0;
padding: 8pt 0 1pt 0;
border-top: solid .5pt #A7A7A7;
}
h5, h6 {
font:normal 14pt/16pt serif;
font-style:italic;
margin:0;
padding:0;
}
p {
font:normal 11pt/14pt serif;
}
p#description {
margin:0 0 14pt 0;
}
a:link, a:visited {
color:#520;
text-decoration:underline;
}
.content a:link:after, content a:visited:after {
font-size:70%;
font-family:sans-serif;
content:" (" attr(href) ") ";
}
.content ol li a:link {
text-decoration:none;
}
.content ol li a:link:after, .content ol li a:visited:after {
content:"";
}
sup {
line-height:0;
}
ol {
font:normal .9em/1.6em sans-serif;
margin-top:0;
margin-bottom:0;
padding-top:.5em;
padding-bottom:0;
}
/* Header
----------------------------------------------------- */
#Header {
padding: 0 0 8pt 0;
margin: 0 0 8pt 0;
border-bottom: solid .5pt #000;
}
#SiteTitle {
text-align: left;
margin-left: 20px;
padding: 0;
}
#user_header {
font-style: italic;
text-align: center;
margin: 0;
padding: 0
}
.grampsid {
font-size: 60%;
font-family: monospace;
color: #A7A7A7
}
/* Navigation
----------------------------------------------------- */
#alphabet, #navigation, #subnavigation { display:none; }
/* Main Table
----------------------------------------------------- */
table {
width:100%;
margin:0;
padding:0;
border:none;
border-collapse:collapse;
border-bottom:solid .5pt #FFF;
}
table thead tr th {
text-align:left;
font:normal 11pt/13pt serif;
color:#000;
margin:0;
padding:0;
padding-bottom:1pt;
border-bottom:solid .5pt #000;
}
.content table thead tr th a {
text-decoration:none;
}
.content table thead tr th a:link:after, .content table thead tr th a:visited:after {
content:"";
}
table tbody tr td {
font:normal 9pt/11pt sans-serif;
vertical-align:middle;
padding:2pt 6pt 1pt 0;
border-bottom:dashed .5pt #A7A7A7;
}
.content table tbody tr td a {
text-decoration:none;
}
.content table tbody tr td a:link:after, .content table tbody tr td a:visited:after {
content:"";
}
table tr.BeginLetter td, table.infolist tr.BeginSurname td {
border-top:solid .5pt #A7A7A7;
}
table tbody tr td.ColumnRowLabel {
width: 3%;
color: #A7A7A7;
text-align: center;
}
table tr td.ColumnLetter {
width: 6%;
text-align: center;
}
table tr td.ColumnAttribute {
width: 10%;
}
.content table tbody tr td.ColumnName a {
text-decoration: none;
}
table tbody tr td.ColumnBirth {
width: 10%;
}
table tbody tr td.ColumnDeath {
width: 10%;
text-decoration: underline;
}
table tbody tr td.ColumnParents {
font-size: 70%;
}
table tbody tr td.ColumnParents span.mother:before {
content: "+ ";
}
/* Home/Welcome
----------------------------------------------------- */
#Home p {
margin:0 0 9pt 0;
}
#Home img {
float:right;
margin:0;
padding:0 0 9pt 9pt;
}
/* Introduction
----------------------------------------------------- */
#Introduction p {
margin:0 0 9pt 0;
}
#Introduction img {
float:right;
margin:0;
padding:0 0 9pt 9pt;
}
/* Surnames
----------------------------------------------------- */
#Surnames { }
table.surnamelist tr thead th.ColumnSurname, #Surnames table.surnamelist tbody tr td.ColumnSurname {
width:50%;
}
table#SortByName thead tr th.ColumnSurname a:after, table#SortByCount thead tr th.ColumnQuantity a:after {
content:" ↓";
}
table.surname thead tr th.ColumnParents, table.surname tbody tr td.ColumnParents {
width:35%;
}
/* Individuals
----------------------------------------------------- */
/* PlaceDetail
------------------------------------------------------ */
div#PlaceDetail h5 {
text-align: center;
float: center;
font: normal 1.4em sans;
border-bottom: double 4px #000;
}
/* Gallery
----------------------------------------------------- */
#GalleryDetail h2 {
display:none;
}
#GalleryNav {
display:none;
}
#GalleryDisplay {
margin:0 auto;
padding:0;
position:relative;
overflow:hidden;
text-align:center;
}
#GalleryDisplay img {
margin:0 auto;
border:solid 1pt #542;
}
#GalleryDetail h3 {
display:block;
text-align:center;
margin:2pt 0 8pt 0;
}
/* Download
----------------------------------------------------- */
#Download p {
margin:0 0 9pt 0;
}
#Download img {
float:right;
margin:0;
padding:0 0 9pt 9pt;
}
/* Contact
----------------------------------------------------- */
#researcher {
margin:16pt 0 0 0;
}
#Contact img {
float:right;
margin:0;
padding:0 0 9pt 9pt;
}
#researcher h3 {
margin:0;
}
#researcher span {
font:normal .9em/1.4em serif;
display:block;
float:left;
margin-right:.4em;
}
#city {
clear:left;
}
#city:after {
content:",";
}
#email {
clear:left;
}
/* Subsections
----------------------------------------------------- */
#Home, #Introduction, #Download, #Contact {
padding:3em 20px;
}
/* Subsections : Events
----------------------------------------------------- */
#IndividualDetail .ColumnValue {
padding:4pt 0;
}
.ColumnValue p {
font:normal 9pt/11pt sans-serif;
margin:1pt 0 0 18pt;
}
/* Subsections : Gallery
----------------------------------------------------- */
#indivgallery h4 {
margin-bottom:1em;
}
#indivgallery .thumbnail {
margin:0;
float:left;
width:130px;
height:150px;
text-align:center;
}
#indivgallery .thumbnail a {
display:block;
margin:0;
padding:0;
background:none;
}
#indivgallery .thumbnail a img {
margin:0;
padding:0;
border:solid .5pt #000;
}
#indivgallery div.thumbnail p {
font:normal 7pt/9pt sans-serif;
text-align:center;
width:80%;
margin:0 auto;
padding:0;
}
/* Subsections : Pedigree
----------------------------------------------------- */
#pedigree a {
text-decoration:none;
}
.content #pedigree a:link:after, .content #pedigree a:visited:after {
content:"";
}
.pedigreegen {
font:normal 10pt/12pt sans-serif;
list-style:none;
margin:8pt 0 0 0;
padding:0 0 0 20px;
}
.pedigreegen li ol {
list-style:none;
margin-left:16pt;
}
.pedigreegen li ol li ol {
font:normal 9pt/11pt sans-serif;
list-style:decimal;
margin-left:16pt;
}
.pedigreegen li ol li ol li ol.spouselist {
list-style:none;
margin-left:0;
}
.spouselist li.spouse ol {
list-style:decimal;
margin-left:16pt;
}
.spouse a {
font-weight:normal;
font-style:normal;
}
.spouse:before {
content: "+ ";
}
.thisperson {
font-weight:bold;
}
/* Subsections : Ancestors Tree
----------------------------------------------------- */
#tree {
page-break-before:always;
margin:0;
padding:0;
}
#treeContainer {
position:relative;
z-index:1;
}
#treeContainer div.boxbg a:link:after, #treeContainer div.boxbg a:visited:after {
font-size:70%;
font-family:sans-serif;
content:"";
}
.boxbg {
position:absolute;
margin:0;
padding:0;
background:none;
}
#treeContainer div.boxbg span.thumbnail {
display:block;
margin:0 auto;
}
.boxbg a {
position:relative;
z-index:10;
display:block;
font:normal .7em/1.4em sans-serif;
text-align:center;
text-decoration:none;
width:50pt;
padding:5pt 8pt;
margin:5pt 0 0 0;
background-color:#FFF;
border:solid 1pt #000;
}
#treeContainer div.AncCol3 span.thumbnail, #treeContainer div.AncCol4 span.thumbnail {
display:none;
}
.shadow {
display:none;
}
#tree div div.bvline {
position:absolute;
z-index:2;
height:1pt;
margin:0;
padding:0;
background-color:#FFF;
border-bottom:solid .5pt #A7A7A7
}
#tree div div.bhline {
position:absolute;
z-index:2;
width:1pt;
margin:0;
padding:0;
background-color:#FFF;
border-right:solid .5pt #A7A7A7
}
.ghline, .gvline {
display:none;
}
/* Footer
----------------------------------------------------- */
#footer {
width:100%;
margin:0;
padding:.1in 0 0 0;
clear:both;
border-top:solid .5pt #000;
}
#user_footer {
float:left;
width:70%;
}
#user_footer p {
font-style:italic;
}
p#createdate {
float: left;
width: 3.9in;
font: normal 9pt/10pt sans-serif;
margin: 0;
}
#copyright {
float: right;
width: 4in;
margin: 0;
font: normal 9pt/10pt sans-serif;
text-align: right;
}
/* Calendar Styles
-------------------------------------------------------------------------------------------- */
/* Calendar : General */
body#WebCal h1#SiteTitle {
float:left;
font-size:14pt;
line-height:16pt;
padding-bottom:.1in;
}
.calendar {
clear:both;
empty-cells:show;
width:100%;
font-size:14pt;
font-weight:normal;
margin:0;
padding:0;
border:none;
border-collapse:collapse;
}
.calendar thead, .calendar tbody {
border-style:solid;
border-width:2pt 2pt 2pt 2pt;
border-color:#000;
}
.calendar tbody {
border-top:none;
}
.calendar thead tr th {
width:12%;
font-family:sans-serif;
font-size:10pt;
font-weight:bold;
text-align:center;
text-transform:uppercase;
padding:.2em 0 .1em 0;
}
.calendar thead tr th.monthName {
width:100%;
font-size:20pt;
line-height:100%;
text-transform:none;
padding:5pt;
border-width:0;
}
#CreatorInfo {
float:right;
margin:0 10px 0 0;
}
body#WebCal a {
text-decoration:none;
color:#000;
}
.calendar tfoot {
border:none;
}
.calendar tfoot tr td {
font-size:12pt;
font-style:italic;
padding:.7em 5% 1em 5%;
}
/* Calendar : Date Numeral */
.calendar td div.date {
float:right;
display:block;
font-size:16pt;
line-height:100%;
font-weight:bold;
text-align:center;
color:#000;
margin:0 0 0 .5em;
padding:7pt;
}
.calendar td.highlight div.date {
color:#F00;
}
/* Calendar : Date Container */
.calendar tbody tr td {
vertical-align:top;
height:4em;
padding:0;
border-width:1px 0 0 1px;
border-style:solid;
border-color:#999;
}
.calendar tbody tr td:first-child {
border-left:none;
}
.calendar tbody tr:first-child td {
border-top:none;
}
/* Calendar : Date Detail */
.calendar tbody tr td ul {
list-style:none;
font-family:sans-serif;
font-size:8pt;
margin:30pt 0 5pt 0;
padding:0;
}
.calendar tbody tr td ul li {
display:block;
width:92%;
margin:0 4%;
padding:.2em 0 .3em 0;
border-top:dashed .5pt #999;
}
.calendar tbody tr td ul li:first-child {
border:none;
}
.calendar tbody tr td ul li em {
font-style:normal;
color:#000;
}
.calendar tbody tr td ul li span.yearsmarried em {
color:#000;
}
/* Calendar : Previous-Next Month */
.calendar tbody tr td.previous,
.calendar tbody tr td.next,
.calendar tbody tr td.previous div.date,
.calendar tbody tr td.next div.date {
font-weight:normal;
font-size:12pt;
color:#999;
}
/* Calendar : Full Year */
body#fullyearlinked div.content {
width:963px;
margin:0 auto;
padding:15px 0 2px 2px;
}
body#fullyearlinked table.calendar {
float:left;
width:320px;
height:18em;
border:solid 1px #000;
}
body#fullyearlinked table.calendar thead tr th {
height:2em;
}
body#fullyearlinked table.calendar thead tr th.monthName {
font-size:1.2em;
padding:2px 0;
}
body#fullyearlinked table.calendar tbody tr td {
height:3em;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
/*
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright 2009 Stephane Charette and Jason Simanek
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
**************************************************************************************************
GRAMPS cascading style sheet for common behaviour independant of styles
Style Name: n/a (used by many different styles)
Style Author: Stephane Charette and Jason Simanek
**************************************************************************************************
-------------
Image Gallery
-------------
# $Id: behaviour.css 13749 2009-12-10 06:50:21Z robhealey1 $
ensure RegionBox <ol> is hidden and has no margins/padding that would shift the image */
ol.RegionBox {
display:none;
list-style:none;
margin:0;
padding:0;
}
/* show the RegionBox <ol> When the mouse hovers over the gallery */
div#GalleryDisplay:hover ol.RegionBox {
display:block;
}
/* define how <li> tags should normally look within RegionBox */
ol.RegionBox li {
margin:0;
padding:0;
display:block;
position:absolute;
text-align:center;
text-decoration:none;
border:dashed 1px #999;
background:url(../images/blank.gif) repeat;
/* IE doesn't work correctly with "hover" if the <li> tag is empty,
* so fill the <li> with a blank image; this way the mouse will be
* considered in the <li> tag anywhere over the background image
*/
}
/* use a solid border when the mouse hovers over the <li> tags */
ol.RegionBox li:hover {
z-index:100;
border:solid 1px #FFF;
}
/* links are kept hidden... */
ol.RegionBox li a {
display:none;
}
/* ...until we hover over them */
ol.RegionBox li:hover a {
display:block;
text-decoration:none;
border-bottom:solid 1px #FFF;
background-color:#888;
color:#FFF;
}
/* underline is hidden until we hover over the links */
ol.RegionBox li:hover a:hover {
text-decoration:underline;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,39 @@
# encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Doug Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id $
#------------------------------------------------------------------------
#
# Stylesheets
#
#------------------------------------------------------------------------
register(GENERAL,
id = 'system webstuff',
category = "WEBSTUFF",
name = _("Webstuff"),
description = _("Provides a collection of resources for the web"),
version = '1.0',
gramps_target_version = '3.3',
fname = "webstuff.py",
load_on_reg = True,
process = "process_list",
)

View File

@ -0,0 +1,118 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Douglas Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id: $
import os
import const
from gen.ggettext import sgettext as _
def make_css_dict(tup):
"""
Basically, make a named tuple.
"""
return {
"id": tup[0],
"user": tup[1],
"translation": tup[2],
"filename": tup[3],
"navigation": tup[4],
"images": tup[5],
}
def load_on_reg(dbstate, uistate, plugin):
"""
Runs when plugin is registered.
"""
dir, fname = os.path.split(__file__)
CSS_FILES = [
# id, user selectable?, translated_name, fullpath, navigation target name, additional files
# "default" is used as default
["Basic-Ash", 1, _("Basic-Ash"),
os.path.join(dir, "css", 'Web_Basic-Ash.css'), None, []],
["Basic-Blue", 1, _("Basic-Blue"),
os.path.join(dir, "css", 'Web_Basic-Blue.css'), "Web_Navigation-Menus.css", []],
["Basic-Cypress", 1, _("Basic-Cypress"),
os.path.join(dir, "css", 'Web_Basic-Cypress.css'), None, []],
["Basic-Lilac", 1, _("Basic-Lilac"),
os.path.join(dir, "css", 'Web_Basic-Lilac.css'), None, []],
["Basic-Peach", 1, _("Basic-Peach"),
os.path.join(dir, "css", 'Web_Basic-Peach.css'), None, []],
["Basic-Spruce", 1, _("Basic-Spruce"),
os.path.join(dir, "css", 'Web_Basic-Spruce.css'), None, []],
["Mainz", 1, _("Mainz"),
os.path.join(dir, "css", 'Web_Mainz.css'), None,
[os.path.join(dir, "images", "Web_Mainz_Bkgd.png"),
os.path.join(dir, "images", "Web_Mainz_Header.png"),
os.path.join(dir, "images", "Web_Mainz_Mid.png"),
os.path.join(dir, "images", "Web_Mainz_MidLight.png")]],
["Nebraska", 1, _("Nebraska"),
os.path.join(dir, "css", 'Web_Nebraska.css'), None, []],
["Visually Impaired", 1, _("Visually Impaired"),
os.path.join(dir, "css", 'Web_Visually.css'), "Web_Navigation-Menus.css", []],
["No style sheet",1, _("No style sheet"), '', None, []],
["behaviour", 0, "Behaviour",
os.path.join(dir, "css", 'behaviour.css'), None, []],
["default", 0, _("Basic-Ash"),
os.path.join(dir, "css", 'Web_Basic-Ash.css'), None, []],
["Print-Default", 0, "Print-Default",
os.path.join(dir, "css", 'Web_Print-Default.css'), None, []],
["Navigation-Vertical", 0, "Navigation-Vertical",
os.path.join(dir, "css", 'Web_Navigation-Vertical.css'), None, []],
["Navigation-Horizontal", 0, "Navigation-Horizontal",
os.path.join(dir, "css", 'Web_Navigation-Horizontal.css'), None, []],
['Gender Images', 0, 'Gender Images', None, None,
[os.path.join(dir, "images", "Web_Gender_Female.png"),
os.path.join(dir, "images", "Web_Gender_Male.png"),
]],
['All Images', 0, 'All Images', None, None,
[os.path.join(dir, "images", "favicon2.ico"),
os.path.join(dir, "images", "blank.gif"),
os.path.join(dir, "images", "document.png")]],
['Copyright', 0, 'Copyright', os.path.join(dir, "images", "somerights20.gif"), None, []],
['Document', 0, 'Document', os.path.join(dir, "images", "document.png"), None, []],
]
return CSS_FILES
def process_list(data):
"""
Gather all of the web resources together, and allow override files
if available.
"""
retval = []
for row in data:
file = row[3]
if file:
path, filename = os.path.split(file)
# is there a override file in the VERSION_DIR/webstuff?
# eg, ~/.gramps/gramps33/webstuff/Web_Nebraska.css
# if so, replace this one:
override = os.path.join(const.VERSION_DIR, "webstuff", filename)
if os.path.exists(override):
row[3] = override
retval.append(row)
# {"Mainz": {"id": "Mainz", "user":1, ...}}
retdict = {}
for css in retval:
if css[0] in retdict:
retdict[css[0]]["images"].append(css[5])
else:
retdict[css[0]] = make_css_dict(css)
return retdict