<label class="workflow-state-toggle pat-subform pat-autosubmit pat-inject ${python:'pat-select' if not display_as_button else None}"
       id="workflow-state"
       title="Change the workflow state"
       data-pat-inject="${view/form_pat_inject_options}"
       tal:define="
         states view/get_workflow_transitions;
         display_as_button view/display_as_button;
       "
       tal:condition="view/available"
       i18n:attributes="title"
       i18n:domain="ploneintranet"
>

  <input name="dx_modified"
         type="hidden"
         value="${view/dx_modified}"
  />
  <span tal:replace="structure here/@@authenticator/authenticator"></span>

  <tal:one_transition condition="display_as_button">

    <button class="pat-button default"
            name="workflow_action"
            type="submit"
            value="${state/action}"
            tal:define="
              state python:states[1];
            "
            i18n:comment="INFO: This is a dynamic translation message which is already translated elsewhere. Keep it as-is."
            i18n:translate=""
    >${state/action_title|state/action}</button>
  </tal:one_transition>

  <select id="workflow_action"
          disabled="${python: None if len(states) &gt; 1 else ''}"
          name="workflow_action"
          tal:condition="not: display_as_button"
  >
    <option selected="${state/selected|nothing}"
            title="${state/title}"
            value="${state/current_state_id|state/action}"
            tal:repeat="state states"
            i18n:comment="INFO: This is a dynamic translation message which is already translated elsewhere. Keep it as-is."
            i18n:translate=""
    >${state/title}</option>
  </select>

</label>
