Skip to content

Commit

Permalink
Fix part of publiclab#8542 Add followers/following count in followers…
Browse files Browse the repository at this point in the history
…/following page (publiclab#9301)
  • Loading branch information
17sushmita authored and reginaalyssa committed Oct 16, 2021
1 parent c26777f commit f811a67
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions app/views/users/show_follow.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
<h3><%= @user.username %></h3>
<ul class="nav nav-tabs border-0">
<li class="nav-item">
<%= link_to "Followers", followers_path(@user.username),class: "nav-link #{@title=='Followers' ? 'active' : ''}" %>
<%= link_to followers_path(@user.username),class: "nav-link #{@title=='Followers' ? 'active' : ''}" do %>
Followers
<span class="badge badge-secondary">
<%= @user.followers.where(status: 1).length.to_s %>
</span>
<% end %>
</li>
<li class="nav-item">
<%= link_to "Following", following_path(@user.username), class: "nav-link #{@title=='Following' ? 'active' : ''}" %>
</li>
<%= link_to following_path(@user.username), class: "nav-link #{@title=='Following' ? 'active' : ''}" do %>
Following
<span class="badge badge-secondary">
<%= @user.following_users.where(status: 1).length.to_s %>
</span>
<% end %>
</li>
</ul>
<% if @users.length > 0 %>
<table class="table">
Expand Down

0 comments on commit f811a67

Please sign in to comment.