For branding: use none instead of undefined

This commit is contained in:
Olivier 'reivilibre
2025-10-28 15:51:34 +00:00
parent 7356047f27
commit 1803f2b0ac
4 changed files with 10 additions and 10 deletions

View File

@@ -58,9 +58,9 @@ impl Object for SiteBranding {
fn get_value(self: &Arc<Self>, name: &Value) -> Option<Value> {
match name.as_str()? {
"server_name" => Some(self.server_name.clone().into()),
"policy_uri" => self.policy_uri.clone().map(Value::from),
"tos_uri" => self.tos_uri.clone().map(Value::from),
"imprint" => self.imprint.clone().map(Value::from),
"policy_uri" => Some(Value::from(self.policy_uri.clone())),
"tos_uri" => Some(Value::from(self.tos_uri.clone())),
"imprint" => Some(Value::from(self.imprint.clone())),
_ => None,
}
}

View File

@@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details.
-#}
<footer class="legal-footer">
{%- if branding.policy_uri is defined or branding.tos_uri is defined -%}
{%- if branding.policy_uri is not none or branding.tos_uri is not none -%}
<nav>
{%- if branding.policy_uri is defined -%}
{%- if branding.policy_uri is not none -%}
<a href="{{ branding.policy_uri }}" referrerpolicy="no-referrer" title="{{ _('branding.privacy_policy.alt') }}" class="cpd-link" data-kind="primary">
{{- _("branding.privacy_policy.link") -}}
</a>
{%- endif -%}
{%- if branding.policy_uri is defined and branding.tos_uri is defined -%}
{%- if branding.policy_uri is not none and branding.tos_uri is not none -%}
<div class="separator" aria-hidden="true"></div>
{%- endif -%}
{%- if branding.tos_uri is defined -%}
{%- if branding.tos_uri is not none -%}
<a href="{{ branding.tos_uri }}" referrerpolicy="no-referrer" title="{{ _('branding.terms_and_conditions.alt') }}" class="cpd-link" data-kind="primary">
{{- _("branding.terms_and_conditions.link") -}}
</a>
@@ -27,7 +27,7 @@ Please see LICENSE files in the repository root for full details.
</nav>
{%- endif -%}
{%- if branding.imprint is defined -%}
{%- if branding.imprint is not none -%}
<p class="imprint">{{ branding.imprint }}</p>
{%- endif -%}
</footer>

View File

@@ -49,7 +49,7 @@ Please see LICENSE files in the repository root for full details.
<input {{ field.attributes(f) }} class="cpd-text-control" type="password" autocomplete="new-password" required />
{% endcall %}
{% if branding.tos_uri is defined %}
{% if branding.tos_uri is not none %}
{% call(f) field.field(label=_("mas.register.terms_of_service", tos_uri=branding.tos_uri), name="accept_terms", form_state=form, inline=true, class="my-4") %}
<div class="cpd-form-inline-field-control">
<div class="cpd-checkbox-container">

View File

@@ -175,7 +175,7 @@ Please see LICENSE files in the repository root for full details.
</div>
{% endif %}
{% if branding.tos_uri is defined %}
{% if branding.tos_uri is not none %}
{% call(f) field.field(label=_("mas.register.terms_of_service", tos_uri=branding.tos_uri), name="accept_terms", form_state=form_state, inline=true, class="my-4") %}
<div class="cpd-form-inline-field-control">
<div class="cpd-checkbox-container">