'Displays the form and any of the changes made to it in edit mode. In this method
all the widgets are build for all name, description and all the fields of a form
definition.'

def show_editable_form_definition(self, trans, form_definition, current_form, message='', status='done', response_redirect=None, **kwd):

    util.Params(kwd)
    form_details = [('Name', TextField('name', 40, current_form['name'])), ('Description', TextField('description', 40, current_form['desc'])), ('Type', HiddenField('form_type_select_field', current_form['type']))]
    form_layout = []
    if (current_form['type'] == trans.app.model.FormDefinition.types.SAMPLE):
        for (index, layout_name) in enumerate(current_form['layout']):
            form_layout.append(TextField(('grid_layout%i' % index), 40, layout_name))
    field_details = []
    for (field_index, field) in enumerate(current_form['fields']):
        field_widgets = self.build_form_definition_field_widgets(trans=trans, layout_grids=current_form['layout'], field_index=field_index, field=field, form_type=current_form['type'])
        field_details.append(field_widgets)
    return trans.fill_template('/admin/forms/edit_form_definition.mako', form_details=form_details, field_details=field_details, form_definition=form_definition, field_types=trans.model.FormDefinition.supported_field_types, message=message, status=status, current_form_type=current_form['type'], layout_grids=form_layout, response_redirect=response_redirect)
