Fixed template data piping

This commit is contained in:
Slatian 2023-10-29 15:36:16 +01:00
parent a33473fdc9
commit bfa383ddbe
2 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,8 @@ impl Engine {
let mut context = tera::Context::new();
context.insert("view", &template_name);
//intented for shared macros
context.insert("format", &settings.format.to_string());
context.insert("format", &settings.format.get_name());
context.insert("mimetype", &settings.format.get_mime_type());
context.insert("language", &settings.lang);
context.insert("dns_resolvers", &settings.available_dns_resolvers);
context.insert("dns_resolver_id", &settings.dns_resolver_id);

View File

@ -1,6 +1,6 @@
{% macro place_dl(place, label="", iso_code_prefix="") -%}
{%- if place -%}
{%- if format=="text/html" %}
{%- if format=="html" %}
{% if label %}<dt>{{label}}</dt>{% endif %}
<dd>{{place.name}} {% if place.iso_code%}({% if iso_code_prefix %}{{iso_code_prefix}}-{% endif %}{{place.iso_code}}){% endif %}</dd>
{% else -%}