mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
global activity feed
This commit is contained in:
parent
8fba5e7a9b
commit
d53b6584d5
3 changed files with 38 additions and 27 deletions
|
@ -13,6 +13,8 @@ get '/?' do
|
|||
event = Event.select(:id).where(id: params[:event_id]).first
|
||||
not_found if event.nil?
|
||||
events_dataset = Event.where(id: params[:event_id]).paginate(1, 1)
|
||||
elsif params[:activity] == 'global'
|
||||
events_dataset = Event.select_all(:events).order(:created_at.desc).paginate(@current_page, 100).join_table(:inner, :sites, id: :site_id).where{views > 1500}.or(site_change_id: nil)
|
||||
else
|
||||
events_dataset = current_site.news_feed(@current_page, 10)
|
||||
end
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
|
||||
<% end %>
|
||||
|
||||
<% if params[:activity] != 'global' %>
|
||||
<div class="content">
|
||||
<% if @page_count > 1 %>
|
||||
<div class="txt-Center content eps pagination">
|
||||
|
@ -145,5 +146,6 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%== erb :'_news_templates', layout: false %>
|
||||
|
|
|
@ -1,15 +1,22 @@
|
|||
<div class="header-Outro with-columns">
|
||||
<div class="row content">
|
||||
<div class="col col-66">
|
||||
<h3>Your Feed</h3>
|
||||
<h3>
|
||||
<% if params[:activity] == 'global' %>
|
||||
Global Feed
|
||||
<% else %>
|
||||
Your Feed
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="feed-filter">
|
||||
<% if !@events.empty? && (site.followings_dataset.count > 0) %>
|
||||
<a href="/" <% if params[:activity] != 'mine' %>class="selected"<% end %>>All Activity</a>
|
||||
<a href="/" <% if params[:activity].nil? %>class="selected"<% end %>>All Activity</a>
|
||||
|
||||
<a href="/?activity=mine" <% if params[:activity] == 'mine' %>class="selected"<% end %>>
|
||||
Activity on your profile
|
||||
</a>
|
||||
<% end %>
|
||||
<a href="/?activity=global" <% if params[:activity] == 'global' %>class="selected"<% end %>>Global Activity</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-32">
|
||||
|
|
Loading…
Add table
Reference in a new issue