[%# Take data in a var named "fields" and render it. %] [% i = 0 %] [% FOREACH category = fields %]

[% category.category %]

[% FOREACH field = category.fields %] [% IF field.section %]

[% field.section %]

[% ELSE %] [% NEXT UNLESS field.name %] [% NEXT UNLESS field.type %] [%# Fetch the value name for a shortcut %] [% value = values.${field.name} %] [% IF field.icon %] [% field.label || field.name %] [% END %] [% field.label || field.name %]
[% IF field.text %] [% field.text %]
[% END %] [% IF field.type == "text" %] [% ELSIF field.type == "number" %] [% ELSIF field.type == "radio" %] [% j = 0 %] [% WHILE j < field.options.size %][%#>%] [% jValue = field.options.$j %] [% j = j + 1 %] [% jContent = field.options.$j %] [% j = j + 1 %]
[% END %] [% ELSIF field.type == "select" %] [% ELSIF field.type == "height" %] [% tmp = "${field.name}-feet" %] [% value = values.$tmp %] feet [% tmp = "${field.name}-inches" %] [% value = values.$tmp %] inches [% ELSIF field.type == "number-range" %] [% ELSIF field.type == "checkgroup" %] [% j = 0 %] [% WHILE j < field.options.size %][%#>%] [% jValue = field.options.$j %] [% j = j + 1 %] [% jContent = field.options.$j %] [% j = j + 1 %]
[% END %] [% ELSIF field.type == "essay" %] [% ELSIF field.type == "timezone" %] [% current_timezone = value %] [% INCLUDE "time-zone-select.html" %] [% ELSIF field.type == "boolean" %] [% ELSE %] error unknown type [% field.type %] [% END %]

[% END %] [% END %]

[% i = i + 1 %] [% END %]