#{param name=permissions/}
#{param name=keyword/}

<%
  import org.exoplatform.task.util.StringUtil;
  import org.exoplatform.commons.utils.HTMLEntityEncoder;
	
  def encoder = HTMLEntityEncoder.getInstance();
%>

<% if (permissions.size() == 0) {%>
    <div class="muted text-center">
        &{message.noUserOrGroupFound}
    </div>
<%} else {%>
<ul>
    <% for (def index in 0 .. permissions.size() - 1) {
            def perm = permissions.get(index);
            def display = perm.displayName;
            display = StringUtil.highlight(display, keyword, '<strong>', '</strong>');
        %>
        <li class="data ${index == 0 ? 'active' : ''}"
            data-suggest-permission="${perm.id}"
            data-suggest-displayname="${encoder.encode(perm.displayName)}"
            data-suggest-type="${perm.type}"
            data-suggest-mstype="${perm.membershipType}"
            data-suggest-groupid="${perm.groupId}"
            data-suggest-groupname="${perm.groupName}">
            ${display} (${perm.id})
            <!--<span class="user-status"><i class="uiIconColorCircleOrange"></i></span>-->
        </li>
    <%}%>
</ul>
<%}%>

