<tal:doctype tal:replace="structure string:&lt;!DOCTYPE html&gt;" />
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      lang="en"
      xml:lang="en"
      i18n:domain="ploneintranet"
>
  <head>
    <meta tal:replace="context/@@http-cache-headers" />
  </head>
  <body>
    <div id="document-body">
      <div id="document-content">
        <div class="item-selector" tal:define="proto nocall:here/@@proto;">
          <div class="tiptap-items search-result users"
              tal:define="results view/results"
          >
            <tal:if condition="python:len(results) == 0">
              <p class="tiptap-noresult"
                 i18n:translate="mentions__no_result">No users matching your criteria "<i18n:term name="term">${view/request/usersearch}</i18n:term>" found.</p>
            </tal:if>
            <tal:loop repeat="it results">
            <tal:def
                      define="
                            pas_uid python:view.pas_uid(it);
                            title python:view.title(it);
                            is_group python:view.is_group(it);
                            num_users python:view.num_users(it) if is_group else None;
                      "
            >
              <div class="
                     item
                     ${python: ('group user-group' if is_group else 'user') + (' has-description' if is_group and num_users is not None else ' has-no-description')}
                     tiptap-item disable-patterns
                   "
                  data-tiptap-value="${title}"
              >
                <a class="close-panel follow pat-inject"
                   href="${it/getURL}"
                   data-mention="${pas_uid}"
                >
                  <img class="group-badge"
                       alt=""
                       src="${it/getURL}/@@logo.jpg"
                       tal:condition="it/has_thumbs"
                  />
                  <tal:avatar
                        condition="not:is_group"
                        replace="structure python:proto.get_avatar_tag(it.getId)" />
                  <strong class="title">${title}</strong>

                  <tal:is_group condition="is_group">
                    <tal:num_users condition="num_users">
                        <br />
                        <dfn class="byline"
                             i18n:translate=""
                        ><tal:num i18n:name="num_users">${num_users}</tal:num>
                          Users</dfn>
                    </tal:num_users>
                  </tal:is_group>
                </a>
              </div>
            </tal:def>
            </tal:loop>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
