order follows

This commit is contained in:
Kyle Drake 2019-10-30 13:58:38 -07:00
parent 72ac64802e
commit e26e23b439
2 changed files with 6 additions and 2 deletions

View file

@ -534,7 +534,11 @@ class Site < Sequel::Model
# Who this site is following # Who this site is following
def follows_dataset def follows_dataset
super.select_all(:follows).inner_join(:sites, :id=>:actioning_site_id).exclude(:sites__is_deleted => true).exclude(:sites__is_banned => true) super.select_all(:follows).inner_join(:sites, :id=>:actioning_site_id).exclude(:sites__is_deleted => true).order(:follow_count.desc,:views.desc,:updated_at.desc)
end
def profile_follows_actioning_ids
follows_dataset.select(:actioning_site_id).exclude(:sites__site_changed => false).all
end end
=begin =begin

View file

@ -19,7 +19,7 @@
<% if site_follows.empty? %> <% if site_follows.empty? %>
No followers yet. No followers yet.
<% else %> <% else %>
<% site.follows_dataset.select(:actioning_site_id).all.each do |follow| %> <% site.profile_follows_actioning_ids.each do |follow| %>
<% follow_actioning_site = follow.actioning_site_dataset.select(:username).first %> <% follow_actioning_site = follow.actioning_site_dataset.select(:username).first %>
<a href="/site/<%= follow_actioning_site.username %>" title="<%= follow_actioning_site.title %>"><img src="<%= follow_actioning_site.screenshot_url 'index.html', '50x50' %>" class="avatar" onerror="this.src='/img/50x50.png'"></a> <a href="/site/<%= follow_actioning_site.username %>" title="<%= follow_actioning_site.title %>"><img src="<%= follow_actioning_site.screenshot_url 'index.html', '50x50' %>" class="avatar" onerror="this.src='/img/50x50.png'"></a>
<% end %> <% end %>