Merge "Move descriptions for hidden fields on top of dynamic_ui forms" into stable/mitaka
This commit is contained in:
commit
b93493ada9
|
@ -450,8 +450,9 @@ class Wizard(views.ModalFormMixin, LazyWizard):
|
|||
else:
|
||||
env_name = get_next_quick_environment_name(self.request)
|
||||
|
||||
context['field_descriptions'] = services.get_app_field_descriptions(
|
||||
field_descr, extended_descr = services.get_app_field_descriptions(
|
||||
self.request, app_id, self.steps.index)
|
||||
|
||||
context.update({'type': app.fully_qualified_name,
|
||||
'service_name': app.name,
|
||||
'app_id': app_id,
|
||||
|
@ -460,6 +461,8 @@ class Wizard(views.ModalFormMixin, LazyWizard):
|
|||
'do_redirect': self.get_wizard_flag('do_redirect'),
|
||||
'drop_wm_form': self.get_wizard_flag('drop_wm_form'),
|
||||
'prefix': self.prefix,
|
||||
'field_descriptions': field_descr,
|
||||
'extended_descriptions': extended_descr,
|
||||
})
|
||||
return context
|
||||
|
||||
|
|
|
@ -240,9 +240,13 @@ def get_app_field_descriptions(request, app_id, index):
|
|||
|
||||
form_cls = app.forms[index]
|
||||
descriptions = []
|
||||
no_field_descriptions = []
|
||||
for name, field in six.iteritems(form_cls.base_fields):
|
||||
title = field.description_title
|
||||
description = field.description
|
||||
if description:
|
||||
descriptions.append((name, title, description))
|
||||
return descriptions
|
||||
if field.widget.is_hidden:
|
||||
no_field_descriptions.extend([description, title])
|
||||
else:
|
||||
descriptions.append((name, title, description))
|
||||
return descriptions, no_field_descriptions
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
{% for ext_description in extended_descriptions %}
|
||||
<p>{{ ext_description }}</p>
|
||||
{% endfor %}
|
||||
<div class="left">
|
||||
{{ wizard.management_form }}
|
||||
{% if wizard.form.forms %}
|
||||
|
@ -42,10 +45,8 @@
|
|||
{% endwith %}
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
<p>{{ extended_description }}</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
<h3>{{ service_name }}</h3>
|
||||
{% for name, title, description in field_descriptions %}
|
||||
<p>
|
||||
{% if title %}
|
||||
|
|
Loading…
Reference in New Issue