mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-29 22:30:01 +02:00
Show a tooltip on which env needs to be set to override a certain settings parameter
This commit is contained in:
parent
49ddb2938f
commit
d4d80de10f
3 changed files with 34 additions and 1 deletions
25
templates/form/settings_form.html.twig
Normal file
25
templates/form/settings_form.html.twig
Normal 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 %}
|
|
@ -1,6 +1,8 @@
|
|||
{% extends "main_card.html.twig" %}
|
||||
{% macro genId(widget) %}{{ widget.vars.full_name }}{% endmacro %}
|
||||
|
||||
{% form_theme form "form/settings_form.html.twig" %}
|
||||
|
||||
{% block title %}{% 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>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue