<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      i18n:domain="plone">
  <head><title></title></head>
  <body>

    <!-- Id/NameWidgets  - only works for 'id' -->

    <metal:view_macro define-macro="view"
              tal:define="member python:context.portal_membership.getAuthenticatedMember();
                          member_visible_ids python:member.getProperty('visible_ids', context.portal_memberdata.getProperty('visible_ids'));
                          widget_visible_ids widget/ignore_visible_ids|nothing;
                          visible_ids context/portal_properties/site_properties/visible_ids|nothing;
                          local_visible_ids python: visible_ids or widget_visible_ids or member_visible_ids;"
              tal:condition="python: local_visible_ids"
              tal:replace="structure accessor"
    />

    <metal:define define-macro="edit">

      <tal:block tal:define="member python:context.portal_membership.getAuthenticatedMember();
                             member_visible_ids python:member.getProperty('visible_ids', context.portal_memberdata.getProperty('visible_ids'));
                             widget_visible_ids widget/ignore_visible_ids|nothing;
                             visible_ids context/portal_properties/site_properties/visible_ids|nothing;
                             local_visible_ids python: (visible_ids and member_visible_ids) or widget_visible_ids;">
        <tal:block tal:condition="python: local_visible_ids">
            <metal:use use-macro="field_macro | context/widgets/field/macros/edit">
                <input metal:fill-slot="widget_body"
                       type="text"
                       name=""
                       value=""
                       size="30"
                       tal:attributes="name fieldName;
                                       value python:(context.show_id() or not context.plone_utils.isIDAutoGenerated(value)) and value or '';"
                       />
            </metal:use>
        </tal:block>
        <tal:block tal:condition="python: not local_visible_ids">
            <input type="hidden"
                   name="id"
                   tal:attributes="name fieldName;
                                   value python:field.getEditAccessor(here)()"
                   />
        </tal:block>
      </tal:block>
    </metal:define>

    <div metal:define-macro="search">
      <div metal:use-macro="context/widgets/zid/macros/edit">
      </div>
    </div>

  </body>

</html>

