<table class="table">
  <% if (rooms!=null) {
    def fav=null;%>
    <% rooms.each { room -> %>
    <%
      if (fav==null && room.isFavorite()) fav="";
      else if ("".equals(fav) && !room.isFavorite()) fav="border-top:1px solid #CCC;";
      else if ("border-top:1px solid #CCC;".equals(fav)) fav=" ";
    %>
    <tr id="users-online-<%=room.user%>" class="users-online" style="<%=fav%>">
      <td class="td-status">
        <span class="<% if (room.isFavorite) { %>user-favorite<% } else { %>user-status<% } %>" user-data="<%=room.user%>"></span><span class="user-<%=room.status%>"></span>
      </td>
      <td>
        <% if (room.isActive()) { %>
          <span user-data="<%=room.user%>" room-data="<%=room.room%>" class="room-link" data-fullname="<%=room.escapedFullname%>"><%=room.escapedFullname%></span>
        <% } else { %>
          <span class="room-inactive"><%=room.user%></span>
        <% } %>
      </td>
      <td>
        <% if (room.unreadTotal>0) { %>
        <span class="room-total badgeDefault badgePrimary mini" style="float:right;" data="<%=room.unreadTotal%>"><%=room.unreadTotal%></span>
        <% } %>
      </td>
    </tr>
    <% } %>
  <% } %>
</table>