diff --git a/cms/settings.py b/cms/settings.py index 1f9407c5..2ba4503e 100644 --- a/cms/settings.py +++ b/cms/settings.py @@ -105,16 +105,23 @@ USE_L10N = True USE_TZ = True SITE_ID = 1 -# these are the logos by default. SVG gets a priority -# which means it will be used if available -# if you want to override them, set the new paths here -# and place the files on the static/images folder +# these are the portal logos (dark and light) +# set new paths for svg or png if you want to override +# svg has priority over png, so if you want to use +# custom pngs and not svgs, remove the lines with svgs +# or set as empty strings +# example: +# PORTAL_LOGO_DARK_SVG = "" +# PORTAL_LOGO_LIGHT_SVG = "" +# place the files on static/images folder PORTAL_LOGO_DARK_SVG = "/static/images/logo_dark.svg" PORTAL_LOGO_DARK_PNG = "/static/images/logo_dark.png" PORTAL_LOGO_LIGHT_SVG = "/static/images/logo_light.svg" PORTAL_LOGO_LIGHT_PNG = "/static/images/logo_dark.png" - +# paths to extra css files to be included, eg "/static/css/custom.css" +# place css inside static/css folder +EXTRA_CSS_PATHS = [] # protection agains anonymous users # per ip address limit, for actions as like/dislike/report TIME_TO_ACTION_ANONYMOUS = 10 * 60 diff --git a/files/context_processors.py b/files/context_processors.py index 585d656d..d4ffbff9 100644 --- a/files/context_processors.py +++ b/files/context_processors.py @@ -13,11 +13,11 @@ def stuff(request): ret["DEFAULT_THEME"] = settings.DEFAULT_THEME ret["PORTAL_NAME"] = settings.PORTAL_NAME - ret["PORTAL_LOGO_DARK_SVG"] = settings.PORTAL_LOGO_DARK_SVG - ret["PORTAL_LOGO_DARK_PNG"] = settings.PORTAL_LOGO_DARK_PNG - ret["PORTAL_LOGO_LIGHT_SVG"] = settings.PORTAL_LOGO_LIGHT_SVG - ret["PORTAL_LOGO_LIGHT_PNG"] = settings.PORTAL_LOGO_LIGHT_PNG - + ret["PORTAL_LOGO_DARK_SVG"] = getattr(settings, 'PORTAL_LOGO_DARK_SVG', "") + ret["PORTAL_LOGO_DARK_PNG"] = getattr(settings, 'PORTAL_LOGO_DARK_PNG', "") + ret["PORTAL_LOGO_LIGHT_SVG"] = getattr(settings, 'PORTAL_LOGO_LIGHT_SVG', "") + ret["PORTAL_LOGO_LIGHT_PNG"] = getattr(settings, 'PORTAL_LOGO_LIGHT_PNG', "") + ret["EXTRA_CSS_PATHS"] = getattr(settings, 'EXTRA_CSS_PATHS', []) ret["PORTAL_DESCRIPTION"] = settings.PORTAL_DESCRIPTION ret["LOAD_FROM_CDN"] = settings.LOAD_FROM_CDN ret["CAN_LOGIN"] = settings.LOGIN_ALLOWED diff --git a/templates/common/head-links.html b/templates/common/head-links.html index 6b93a303..a22713ab 100644 --- a/templates/common/head-links.html +++ b/templates/common/head-links.html @@ -28,4 +28,9 @@ + {% for css_path in EXTRA_CSS_PATHS %} + + + {% endfor %} +