<init tal:omit-tag=""
      tal:define="
        global node request/node;
        global disable_notes python:1;
        global toc_depth python:int(test(node.hasAttribute('toc_depth'), node.getAttribute('toc_depth'), -1));
" />

<div metal:use-macro="container/macro_edit_view/macros/edit_view"
  xmlns:i18n="http://xml.zope.org/namespaces/i18n"
  i18n:domain="silva_document">
<div metal:fill-slot="edit_input" tal:omit-tag="">
  <toc tal:replace="structure here/content" />
</div>
<div metal:fill-slot="element_controls" tal:omit-tag="">
  <span i18n:translate="">Table of contents depth:</span>
<select class="manipulator"
  name="toc_depth">
  <option value="0" 
    tal:attributes="selected python:test(toc_depth == 1 - 1, 'selected', nothing)" i18n:translate="">
    1 level
  </option>
  <loop 
    tal:omit-tag="" 
    tal:repeat="ittr python:range(2,10)">
    <option 
      tal:attributes="
        value python:ittr - 1;
        selected python:test(toc_depth == ittr - 1, 'selected', nothing)" i18n:translate="">
      <span tal:replace="ittr" i18n:name="n"/>
      levels
    </option>
  </loop>
  <option value="-1" 
    tal:attributes="selected python:test(toc_depth == -1, 'selected', nothing)" i18n:translate="">
    unlimited
  </option>
</select>
</div>
</div>
