From c090392b413f3a60c98956387b99073eeb16a21f Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Wed, 27 Mar 2024 10:02:02 -0500 Subject: [PATCH] limit how many follows are shown --- views/_follows.erb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/views/_follows.erb b/views/_follows.erb index 851257e7..05b1e5dc 100644 --- a/views/_follows.erb +++ b/views/_follows.erb @@ -1,22 +1,26 @@ -<% site_followings = site.followings_dataset.count %> -<% if (!is_current_site && site_followings > 0) || is_current_site %> +<% site_followings_count = site.followings_dataset.count %> +<% if (!is_current_site && site_followings_count > 0) || is_current_site %>

<%= is_current_site ? 'Sites you follow' : 'This site follows' %>

- <% if site_followings == 0 %> + <% if site_followings_count == 0 %>

You are not following any sites yet. Add some by browsing sites or looking at your tags. <% else %> - <% site.followings_dataset.select(:site_id).all.each do |following| %> + <% site.followings_dataset.select(:site_id).limit(Site::MAX_DISPLAY_FOLLOWS).each do |following| %> <% end %> + + <% if Site::MAX_DISPLAY_FOLLOWS < site_followings_count %> + see more + <% end %> <% end %>

<% end %> -<% site_follows = site.follows_dataset.count %> -<% if (!is_current_site && site_follows > 0) || is_current_site %> +<% site_follows_count = site.follows_dataset.count %> +<% if (!is_current_site && site_follows_count > 0) || is_current_site %>

Followers

- <% if site_follows == 0 %> + <% if site_follows_count == 0 %> No followers yet. <% else %> <% site_profile_follows_actioning_ids = site.profile_follows_actioning_ids %>