Skip to content

Commit f811a67

Browse files
17sushmitareginaalyssa
authored andcommitted
Fix part of publiclab#8542 Add followers/following count in followers/following page (publiclab#9301)
1 parent c26777f commit f811a67

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

app/views/users/show_follow.html.erb

+13-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@
22
<h3><%= @user.username %></h3>
33
<ul class="nav nav-tabs border-0">
44
<li class="nav-item">
5-
<%= link_to "Followers", followers_path(@user.username),class: "nav-link #{@title=='Followers' ? 'active' : ''}" %>
5+
<%= link_to followers_path(@user.username),class: "nav-link #{@title=='Followers' ? 'active' : ''}" do %>
6+
Followers
7+
<span class="badge badge-secondary">
8+
<%= @user.followers.where(status: 1).length.to_s %>
9+
</span>
10+
<% end %>
611
</li>
712
<li class="nav-item">
8-
<%= link_to "Following", following_path(@user.username), class: "nav-link #{@title=='Following' ? 'active' : ''}" %>
9-
</li>
13+
<%= link_to following_path(@user.username), class: "nav-link #{@title=='Following' ? 'active' : ''}" do %>
14+
Following
15+
<span class="badge badge-secondary">
16+
<%= @user.following_users.where(status: 1).length.to_s %>
17+
</span>
18+
<% end %>
19+
</li>
1020
</ul>
1121
<% if @users.length > 0 %>
1222
<table class="table">

0 commit comments

Comments
 (0)