Verified Commit 83ba5fcd authored by Štěpán Henek's avatar Štěpán Henek 🌩

ajax forms: hiding fix

parent 95dfabe6
......@@ -1292,6 +1292,7 @@ def config_ajax_form(page_name, form_name):
raise bottle.HTTPError(400, "Should be ajax request")
try:
trigger = request.POST.pop("_update", None) is None
hide = request.POST.pop("_hide", False)
controller_id = request.POST.pop("_controller_id", None)
form, response_handler = config_page.get_page_form(
......@@ -1306,6 +1307,7 @@ def config_ajax_form(page_name, form_name):
return template(
form.template_name,
message=message,
hide=hide,
form=form.foris_form,
ajax_form=form,
template_adapter=bottle.Jinja2Template,
......
......@@ -40,7 +40,7 @@ class WifiEditForm(fapi.ForisAjaxForm):
def __init__(self, data, controller_id=None):
super().__init__(data, controller_id)
self.title = _("Setting WiFi for '%s'") % controller_id
self.title = _("Configure WiFi for '%s'") % controller_id
@staticmethod
def prefixed(index, name):
......
<div id="subordinates-edit" style="display: none">
<div id="subordinates-edit" {% if hide %}style="display: none"{% endif %}>
<h3>{{ ajax_form.title }}</h3>
{% include 'config/_message.html.j2' %}
<form id="sub-form" class="config-form" action="{{ ajax_form.url }}" method="post" autocomplete="off" novalidate>
......
<div id="subordinates-edit" style="display: none">
<div id="subordinates-edit" {% if hide %}style="display: none"{% endif %}>
<h3>{{ ajax_form.title }}</h3>
<form id="form-{{ form.name }}" class="config-form" action="{{ ajax_form.url }}" method="post" autocomplete="off" novalidate>
<p class="config-description">{{ form.sections[0].description|safe }}</p>
......
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