Show a tooltip on which env needs to be set to override a certain settings parameter

This commit is contained in:
Jan Böhmer 2025-08-24 12:03:37 +02:00
parent 49ddb2938f
commit d4d80de10f
3 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,25 @@
{% extends "form/extended_bootstrap_layout.html.twig" %}
{% block form_label %}
{# If parameter_envvar exists on form then show it as tooltip #}
{% if parameter_envvar is defined and parameter_envvar is not null %}
{%- set label_attr = label_attr|merge({title: 'settings.tooltip.overrideable_by_env'|trans(arguments = {'%env%': (parameter_envvar)|trim})}) -%}
{% endif %}
{{- parent() -}}
{% endblock %}
{% block checkbox_radio_label %}
{# If parameter_envvar exists on form then show it as tooltip #}
{% if parameter_envvar is defined and parameter_envvar is not null %}
{%- set label_attr = label_attr|merge({title: 'settings.tooltip.overrideable_by_env'|trans(arguments = {'%env%': (parameter_envvar)|trim})}) -%}
{% endif %}
{{- parent() -}}
{% endblock %}
{% block tristate_label %}
{# If parameter_envvar exists on form then show it as tooltip #}
{% if parameter_envvar is defined and parameter_envvar is not null %}
{%- set label_attr = label_attr|merge({title: 'settings.tooltip.overrideable_by_env'|trans(arguments = {'%env%': (parameter_envvar)|trim})}) -%}
{% endif %}
{{- parent() -}}
{% endblock %}

View file

@ -1,6 +1,8 @@
{% extends "main_card.html.twig" %} {% extends "main_card.html.twig" %}
{% macro genId(widget) %}{{ widget.vars.full_name }}{% endmacro %} {% macro genId(widget) %}{{ widget.vars.full_name }}{% endmacro %}
{% form_theme form "form/settings_form.html.twig" %}
{% block title %}{% trans %}settings.title{% endtrans %}{% endblock %} {% block title %}{% trans %}settings.title{% endtrans %}{% endblock %}
{% block card_title %}<i class="fa-solid fa-gears fa-fw"></i> {% trans %}settings.title{% endtrans %}{% endblock %} {% block card_title %}<i class="fa-solid fa-gears fa-fw"></i> {% trans %}settings.title{% endtrans %}{% endblock %}
@ -57,4 +59,4 @@
</div> </div>
{{ form_end(form) }} {{ form_end(form) }}
{% endblock %} {% endblock %}

View file

@ -13027,5 +13027,11 @@ Please note, that you can not impersonate a disabled user. If you try you will g
<target>System settings</target> <target>System settings</target>
</segment> </segment>
</unit> </unit>
<unit id="3YsJ4i6" name="settings.tooltip.overrideable_by_env">
<segment>
<source>settings.tooltip.overrideable_by_env</source>
<target>The value of this parameter can be overridden by setting the environment variable "%env%".</target>
</segment>
</unit>
</file> </file>
</xliff> </xliff>