mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
order follows
This commit is contained in:
parent
72ac64802e
commit
e26e23b439
2 changed files with 6 additions and 2 deletions
|
@ -534,7 +534,11 @@ class Site < Sequel::Model
|
|||
|
||||
# Who this site is following
|
||||
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
|
||||
|
||||
=begin
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<% if site_follows.empty? %>
|
||||
No followers yet.
|
||||
<% 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 %>
|
||||
<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 %>
|
||||
|
|
Loading…
Add table
Reference in a new issue