Source

pyramid_uniform / pyramid_uniform / templates / zpt / formish / widgets / CheckboxMultiChoiceTree / widget.html

Full commit
<%page args="field" />

<%
optionkeys = [k for k,v in field.widget.options]
%>

<%def name="render_subtree(field, optiontrees)">
% if len(optiontrees['children']) > 0:
<ul>
% for optiontree in optiontrees['children']:
<%
option = optiontree['data']
index = optionkeys.index(option[0])
%>
  <li><input id="${field.cssname}-${index}" name="${field.name}" type="checkbox" value="${option[0]}"${field.widget.checked(option,field)|n} />
  <label for="${field.cssname}-${index}">${option[1]}</label>
  ${render_subtree(field,optiontree)}
  </li> 
% endfor
</ul>
% endif
</%def>

${render_subtree(field,field.widget.optiontree)}