 <div class="margins"
  tal:define="
    view here;
    model request/model;
    root_url model/get_root_url;
    title model/get_title_editable;
    breadcrumb_vein string:Edit;
    has_access here/has_change_access_permission;">
  <tal:block condition="has_access">
    <tal:block condition="model/isValid | nothing">
      <h3>
        <a href="tab_access"
          title="Back to Groups"
          tal:attributes="href python:'%s/edit/tab_access_groups' % model.get_container().absolute_url()">
          <img alt="Up to top of Access tab"
            border="0"
            height="16"
            width="16"
            tal:attributes="src string:${root_url}/globals/left.gif" />
          Back
        </a>
      </h3>
      <h2>
        <span tal:replace="model/meta_type">
          Meta type
        </span>
        for
        <span class="document-title">
          &#xab;<tal:block content="model/get_title_or_id" />&#xbb;
        </span>
      </h2>

      <h3>
        Virtual Group &#8216;members&#8217;
      </h3>
      <!-- Defined virtual groups listing -->
      <metal:block use-macro="view/macro_groups_listing/macros/virtual_groups_listing">
        <metal:block fill-slot="listing_actions">
          <input class="button"
            name="add_groups_from_virtualgroup_to_virtualgroup:method"
            title="Copy groups as defined on selected virtual group(s)."
            type="submit"
            value="Copy from virtual group(s)" />
        </metal:block>
      </metal:block>
      <!-- Defined groups listing -->
      <metal:block use-macro="view/macro_groups_listing/macros/normal_groups_listing">
        <metal:block fill-slot="listing_actions">
          <input class="button"
            name="add_groups_to_virtualgroup:method"
            title="Add selected group(s) to this virtual group."
            type="submit"
            value="Add to virtual group" />
        </metal:block>
      </metal:block>

      <!-- Group listing table -->
      <form action="."
        method="POST">
        <table class="borders top bottom left right"
          border="0"
          cellpadding="5"
          cellspacing="0"
          style="empty-cells:show;"
          tal:define="groupids model/listGroups">
          <tr align="left"
            valign="top">
            <th>
              <b>
                Groupname
              </b>
            </th>
          </tr>
          <tal:block repeat="groupid groupids">
            <tr valign="top"
              tal:define="
                oddrow repeat/groupid/odd;"
              tal:attributes="class python:test(oddrow, 'focus', 'focus-cycle')">
              <td align="left">
                <input name="groupids:list"
                  type="checkbox"
                  value="groupid"
                  tal:attributes="value groupid" />
                &nbsp;
                <b tal:content="groupid">
                  groupname
                </b>
              </td>
            </tr>
          </tal:block>
          <tr class="focus"
            tal:condition="not:groupids">
            <td>
              <i>
                Virtual Group does not have any "member groups"
              </i>
            </td>
          </tr>
          <tr class="controls-cycle"
            valign="top">
            <td align="left">
              <input class="warningbutton"
                name="remove_groups_from_virtualgroup:method"
                title="Remove selected group(s) from this virtual group."
                type="submit"
                value="Remove groups"
                onClick="return confirm('Really remove?')"
                tal:condition="groupids" />
            </td>
          </tr>
        </table>
      </form>
    </tal:block>

    <tal:block condition="not:model/isValid | nothing">
      "Things to do when virtual groups is not in it original location"
    </tal:block>
  </tal:block>
</div>
