<%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> %if message: ${render_msg( message, status )} %endif <%def name="render_selectbox_options( index, field_attr )"> %if field_attr[0] == 'Type': %if field_attr[1].get_selected( return_label=True ) == 'SelectField': <% options = field_attr[2] %>
%for i, option in enumerate(options):
${i+1} ${option[1].get_html()}
%endfor
%endif %endif <%def name="render_field( index, field, saved )"> %if saved:

${index+1}. ${field[0][1].value} (${field[2][1].get_selected( return_value=True )})

%else:
%endif
%for field_attr in field:
${field_attr[1].get_html()} ${render_selectbox_options( index, field_attr )}
%endfor
<%def name="render_layout( index, widget )">
${index+1} ${widget.get_html()}
Edit form definition "${form.name}"
%if response_redirect: %endif %for label, input in form_details:
## TODO: RC, this will keep the form type select list label ## from being displayed here. At this point, the select list is a hidden field. ## Make sure this is the best solution to this problem. %if label != 'Type': %endif
${input.get_html()}
%endfor %if current_form_type == trans.app.model.FormDefinition.types.SAMPLE:
Form Layout
%for index, lg in enumerate(layout_grids): ${render_layout( index, lg )} %endfor
%endif
Fields (${len(form.fields)})
%for ctr, field in enumerate(field_details): %if ctr < len(form.fields): ${render_field( ctr, field, True )} %else: ${render_field( ctr, field, False )} %endif %endfor