2016: Website reports should accept any StyleSheet

This commit is contained in:
SNoiraud 2016-07-15 16:18:30 +02:00
parent 925e413683
commit 86b52ed60b
2 changed files with 9 additions and 2 deletions

View File

@ -119,9 +119,10 @@ THUMB_DIR = os.path.join(HOME_DIR, "thumb")
THUMB_NORMAL = os.path.join(THUMB_DIR, "normal") THUMB_NORMAL = os.path.join(THUMB_DIR, "normal")
THUMB_LARGE = os.path.join(THUMB_DIR, "large") THUMB_LARGE = os.path.join(THUMB_DIR, "large")
USER_PLUGINS = os.path.join(VERSION_DIR, "plugins") USER_PLUGINS = os.path.join(VERSION_DIR, "plugins")
USER_CSS = os.path.join(HOME_DIR, "css")
# dirs checked/made for each Gramps session # dirs checked/made for each Gramps session
USER_DIRLIST = (USER_HOME, HOME_DIR, VERSION_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR, USER_DIRLIST = (USER_HOME, HOME_DIR, VERSION_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR,
THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS) THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS, USER_CSS)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -23,7 +23,7 @@
# python modules # python modules
#------------------------------------------------ #------------------------------------------------
import os import os
from gramps.gen.const import VERSION_DIR, IMAGE_DIR, DATA_DIR from gramps.gen.const import VERSION_DIR, IMAGE_DIR, DATA_DIR, USER_CSS
from gramps.gen.const import GRAMPS_LOCALE as glocale from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext _ = glocale.translation.sgettext
@ -176,6 +176,12 @@ def load_on_reg(dbstate, uistate, plugin):
['marker', 0, 'marker', ['marker', 0, 'marker',
path_img("gramps-geo-mainmap.png"), None, [], [] ], path_img("gramps-geo-mainmap.png"), None, [], [] ],
] ]
# If we add css user files, we must restart gramps to use them.
list_files = os.listdir(USER_CSS)
for cssfile in list_files:
CSS_FILES.append([cssfile, 1, cssfile.replace('.css', ''),
os.path.join(USER_CSS,cssfile),
None, [], [] ])
return CSS_FILES return CSS_FILES
def process_list(data): def process_list(data):