user tree: users with no parents don't descend from anything

This commit is contained in:
Carl Chenet 2017-05-23 12:55:45 +02:00
parent 3d54a8ea83
commit 5a3ac372b8
2 changed files with 16 additions and 8 deletions

View file

@ -912,6 +912,12 @@ div.comment_form_container textarea {
height: auto;
}
li.noparent:before,
ul.noparent:before {
border-top: 0 !important;
border-left: 0 !important;
}
ul.user_tree {
color: #888;
}

View file

@ -3,21 +3,23 @@
<strong><%= @title %> (<%= @user_count %>)</strong>
</p>
<p>
<%= t('.newestusers') %>
<%= raw @newest.map{|u| "<a href=\"/u/#{u.username}\" class=\"" <<
(u.is_new?? "new_user" : "") << "\">#{u.username}</a> " <<
"(#{u.karma})" }.join(", ") %>
</p>
<% if @newest %>
<p>
<%= t('.newestusers') %>
<%= raw @newest.map{|u| "<a href=\"##{u.username}\" class=\"" <<
(u.is_new?? "new_user" : "") << "\">#{u.username}</a> " <<
"(#{u.karma})" }.join(", ") %>
</p>
<% end %>
<ul class="tree user_tree">
<ul class="tree user_tree noparent">
<% subtree = @users_by_parent[nil] %>
<% ancestors = [] %>
<% while subtree %>
<% if (user = subtree.pop) %>
<li>
<li class="<%= user.invited_by_user_id ? "" : "noparent" %>">
<a href="/u/<%= user.username %>"
<% if !user.is_active? %>
class="inactive_user"