<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
           xmlns:metal="http://xml.zope.org/namespaces/metal"
           xmlns:i18n="http://xml.zope.org/namespaces/i18n">
  <tal:block metal:define-macro="master">
    <tal:block tal:define="local_parameter_list local_parameter_list | python: {};
         choosen_action python: request.get('choosen_action') or [x for x in request.get('workflow_action_listbox').values() if x['workflow_action']][0];
         target_context python: context.getPortalObject().restrictedTraverse(choosen_action['relative_url']);
         target_form python: getattr(target_context, choosen_action['workflow_action'].split('/')[-1]);
         dummy python: request.set('workflow_action', choosen_action['workflow_action'].split('/')[1]);
         dummy python: request.set('here', here);
         dummy python: request.set('mass_workflow_action', True);
         dummy python: request.set('button_title', target_context.Base_getFormViewDialogActionButtonTitle(target_form));
         dummy python: local_parameter_list.update({ 
                   'choosen_action': choosen_action,
                   'cancel_url': request['cancel_url'],
                   'mass_workflow_action': request['mass_workflow_action'],
                 });">
     <tal:block metal:use-macro="here/dialog_main/macros/master">

      <tal:block metal:define-macro="head">
       <tal:block metal:fill-slot="head">
        <tal:block tal:define="head_group python: form.get_fields_in_group('head')">
          <div tal:condition="python: len(head_group) > 0"
               class="head">
            <tal:block tal:repeat="field head_group">
              <tal:block tal:condition="preferred_html_style_developper_mode">
                <tal:block metal:use-macro="developper_shortcut_render/macros/field_developper" />
              </tal:block>
              <tal:block tal:define="field_description field/Field_getDescription"
                         tal:condition="preferred_html_style_translator_mode">
                <tal:block metal:use-macro="developper_shortcut_render/macros/field_translator" />
              </tal:block>
              <tal:block tal:define="value python:request.get(field.id, None)"
                         tal:replace="structure python:field.render(value, request)" />
            </tal:block>
          </div>
        </tal:block>
       </tal:block>
      </tal:block>

      <tal:block metal:fill-slot="main">
        <tal:block tal:define="field_render here/field_render/macros/field_render;">
          <tal:block tal:condition="preferred_html_style_developper_mode">
            <tal:block metal:use-macro="developper_shortcut_render/macros/form" />
          </tal:block>

          <div class="dialog_box">

          <tal:block metal:define-macro="content">
            <div class="content"
                 tal:define="group_list target_form/Form_getGroupTitleAndId">
              <tal:block tal:repeat="group group_list">
                <tal:block tal:define="gid    group/gid">
                  <fieldset tal:condition="python: 'hidden' not in gid and 'bottom' not in gid and 'head' not in gid"
                    tal:attributes="class gid;">
                    <legend tal:content="group/gtitle" class="group_title" />
                    <tal:block tal:repeat="field python: target_form.get_fields_in_group(group['goid'])">
                      <tal:block metal:use-macro="field_render"/>
                    </tal:block>
                  </fieldset>
                </tal:block>
              </tal:block>
              <p class="clear"></p>
            </div>
           </tal:block>
          </div>
        </tal:block>
      </tal:block>

      <tal:block metal:define-macro="bottom">
       <tal:block metal:fill-slot="bottom">
        <tal:block tal:repeat="form python: [target_form, form]">
          <tal:block tal:define="bottom_group python: form.get_fields_in_group('bottom')">
            <div tal:condition="python: len(bottom_group) > 0"
              class="bottom">
              <tal:block tal:repeat="field bottom_group">
                <tal:block tal:condition="preferred_html_style_developper_mode">
                  <tal:block metal:use-macro="developper_shortcut_render/macros/field_developper" />
                </tal:block>
                <tal:block tal:define="field_description field/Field_getDescription"
                           tal:condition="preferred_html_style_translator_mode">
                  <tal:block metal:use-macro="developper_shortcut_render/macros/field_translator" />
                </tal:block>
                <tal:block tal:define="value python:request.get(field.id, None)"
                           tal:replace="structure python:field.render(value, request)" />
              </tal:block>
            </div>
          </tal:block>
         </tal:block>
       </tal:block>
      </tal:block>


      </tal:block>
    </tal:block>
  </tal:block>
</tal:block>