From 4316c96c803a56b52551a9707fb20c9648cf7e82 Mon Sep 17 00:00:00 2001 From: Elia Bellavista Date: Thu, 2 May 2024 17:03:46 +0200 Subject: [PATCH] ckan 2.10 globals --- .../ckanext/d4science_theme/__init__.py | 9 +++++++++ .../ckanext/d4science_theme/templates/header.html | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ckanext-d4science_theme/ckanext/d4science_theme/__init__.py b/src/ckanext-d4science_theme/ckanext/d4science_theme/__init__.py index e69de29..2a1f5be 100644 --- a/src/ckanext-d4science_theme/ckanext/d4science_theme/__init__.py +++ b/src/ckanext-d4science_theme/ckanext/d4science_theme/__init__.py @@ -0,0 +1,9 @@ +from flask import Flask, g +from ckan.lib.app_globals import app_globals + +app = Flask(__name__) + +# Aggiungi main_css al contesto globale di Flask +@app.before_request +def before_request(): + g.main_css = app_globals.main_css \ No newline at end of file diff --git a/src/ckanext-d4science_theme/ckanext/d4science_theme/templates/header.html b/src/ckanext-d4science_theme/ckanext/d4science_theme/templates/header.html index bdb8ced..5367fb5 100644 --- a/src/ckanext-d4science_theme/ckanext/d4science_theme/templates/header.html +++ b/src/ckanext-d4science_theme/ckanext/d4science_theme/templates/header.html @@ -124,7 +124,8 @@ {% endblock %} {% block header_site_search %} -