Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7670761

Browse files
17sushmitabillymoroney1
authored andcommittedDec 28, 2021
Followers/following page: avatar and grid (publiclab#9315)
* Fix part of publiclab#8542 Enhance Followers/Following Page * Refactured previous commit changes
1 parent d921074 commit 7670761

File tree

3 files changed

+92
-14
lines changed

3 files changed

+92
-14
lines changed
 
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.follow-list{
2+
margin: -1px;
3+
list-style-type: none;
4+
}
5+
.follow-list .follow-img img{
6+
max-width: 100%;
7+
}
8+
.follow-list{
9+
margin: -1px;
10+
list-style-type: none;
11+
}
12+
.follow-list {
13+
padding: 0;
14+
}
15+
.follow-list > li {
16+
float: left;
17+
width: 50%;
18+
}
19+
.follow-list > li > a {
20+
display: block;
21+
text-decoration: none;
22+
color: #000;
23+
padding: 0.625rem;
24+
margin: 1px;
25+
background: #fff;
26+
}
27+
.follow-list > li > a:after,
28+
.follow-list > li > a:before {
29+
content: "";
30+
display: table;
31+
clear: both;
32+
}
33+
.follow-list .follow-img {
34+
float: left;
35+
width: 3rem;
36+
height: 3rem;
37+
overflow: hidden;
38+
background: #efeff4;
39+
}
40+
.follow-list .follow-info {
41+
margin-left: 3.625rem;
42+
}
43+
.follow-list .follow-info h4 {
44+
margin: 0.3125rem 0;
45+
font-size: 0.875rem;
46+
font-weight: 600;
47+
}
48+
.follow-list .follow-info p {
49+
color: #666;
50+
margin: 0;
51+
}
52+
53+
@media (max-width: 767px) {
54+
.follow-list > li {
55+
float: none;
56+
width: auto;
57+
}
58+
}

‎app/views/users/show_follow.html.erb

+33-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<%= stylesheet_link_tag "show_follow" %>
2+
13
<div class="container">
24
<h3><%= @user.username %></h3>
35
<ul class="nav nav-tabs border-0">
@@ -19,22 +21,39 @@
1921
</li>
2022
</ul>
2123
<% if @users.length > 0 %>
22-
<table class="table">
23-
<tbody>
24-
<% @users.each do |user| %>
25-
<tr class="followers-row">
26-
<td><%= link_to "<i class='fa fa-user-o'></i> #{user.username}".html_safe, user_path(user.username) %>
27-
</tr>
28-
<% end %>
29-
</table>
30-
<% if @pagy %>
31-
<%= raw pagy_bootstrap_nav @pagy %>
32-
<% else %>
33-
<%= will_paginate @users, renderer: WillPaginate::ActionView::BootstrapLinkRenderer %>
34-
<% end %>
24+
25+
<div class="profile-container border-top p-2">
26+
<div class="row row-space-20">
27+
<div class="col-md-8">
28+
<div class="tab-content p-0">
29+
<div class="tab-pane fade active show" id="profile-follows">
30+
<ul class="follow-list clearfix">
31+
<% @users.each do |user| %>
32+
<li>
33+
<%= link_to user_path(user.username) do %>
34+
<div class="follow-img"><img src="<%= user.profile_image %>" alt="" /></div>
35+
<div class="follow-info">
36+
<h4> <%= user.username %></h4>
37+
<p><small><%= user.followers.where(status: 1).length %> followers, <%= user.following_users.where(status: 1).length %> following</small></p>
38+
</div>
39+
<% end %>
40+
</li>
41+
<% end %>
42+
</ul>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
</br>
48+
<% if @pagy %>
49+
<%= raw pagy_bootstrap_nav @pagy %>
50+
</div>
51+
<% else %>
52+
<%= will_paginate @users, renderer: WillPaginate::ActionView::BootstrapLinkRenderer %>
53+
<% end %>
3554
<% else %>
3655
<p class="pt-3 border-top">
3756
<%= @user.username %><%= @title === "Followers" ? " has no followers yet" : " is not following anyone yet" %>
3857
</p>
3958
<% end %>
40-
</div>
59+
</div>

‎config/initializers/assets.rb

+1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@
3939
'spam2.css',
4040
'spam2.js',
4141
'print_new.css',
42+
'show_follow.css',
4243
]

0 commit comments

Comments
 (0)
Please sign in to comment.