Commit f47eeebe authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Fix access to config variables in templates

parent 8ebc2012
# Changelog # Changelog
## next
- Fix access to config variables in jinja2 templates (restoring matomo and sentry tracker)
## 0.5.3 ## 0.5.3
- Upgrade validata-core requirement to `0.7.2` (fix UTF-8 BOM issue) - Upgrade validata-core requirement to `0.7.2` (fix UTF-8 BOM issue)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<a class="navbar-brand" href="{{ url_for('home') }}"> <a class="navbar-brand" href="{{ url_for('home') }}">
<img src="{{ url_for('static', filename='img/logo-horizontal.png') }}" height="15" alt="Validata" /> <img src="{{ url_for('static', filename='img/logo-horizontal.png') }}" height="15" alt="Validata" />
</a> </a>
{% for link in config.header.links %} {% for link in config.CONFIG.header.links %}
<a class="nav-link" href="{{ link.url }}" target="_blank">{{ link.title }}</a> <a class="nav-link" href="{{ link.url }}" target="_blank">{{ link.title }}</a>
{% endfor %} {% endfor %}
<a class="btn btn-outline-danger ml-auto" rel="external" target="_blank" href="https://git.opendatafrance.net/validata/validata-ui/issues/new?issuable_template=Probl%C3%A8me"> <a class="btn btn-outline-danger ml-auto" rel="external" target="_blank" href="https://git.opendatafrance.net/validata/validata-ui/issues/new?issuable_template=Probl%C3%A8me">
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
développée par <a href="https://jailbreak.paris">Jailbreak</a>. développée par <a href="https://jailbreak.paris">Jailbreak</a>.
</p> </p>
<p> <p>
{% for link in config.footer.links %} {% for link in config.CONFIG.footer.links %}
<a href="{{ link.url }}" target="_blank">{{ link.title }}</a> <a href="{{ link.url }}" target="_blank">{{ link.title }}</a>
{{ " | " if not loop.last }} {{ " | " if not loop.last }}
{% endfor %} {% endfor %}
......
...@@ -445,7 +445,7 @@ def validate(schema_instance: SchemaInstance, validata_resource: ValidataResourc ...@@ -445,7 +445,7 @@ def validate(schema_instance: SchemaInstance, validata_resource: ValidataResourc
return render_template( return render_template(
"validation_report.html", "validation_report.html",
config=config.CONFIG, config=config,
badge_msg=badge_msg, badge_msg=badge_msg,
badge_url=badge_url, badge_url=badge_url,
breadcrumbs=[ breadcrumbs=[
...@@ -577,9 +577,7 @@ def home(): ...@@ -577,9 +577,7 @@ def home():
"catalog": schema_info_list, "catalog": schema_info_list,
} }
return render_template( return render_template("home.html", config=config, sections=list(iter_sections()))
"home.html", config=config.CONFIG, sections=list(iter_sections())
)
@app.route("/pdf") @app.route("/pdf")
...@@ -675,7 +673,7 @@ def custom_validator(): ...@@ -675,7 +673,7 @@ def custom_validator():
) )
return render_template( return render_template(
"validation_form.html", "validation_form.html",
config=config.CONFIG, config=config,
branches=schema_instance.branches, branches=schema_instance.branches,
breadcrumbs=[ breadcrumbs=[
{"url": url_for("home"), "title": "Accueil"}, {"url": url_for("home"), "title": "Accueil"},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment