8000 Reimplement timeline without using Federails Activities by Floppy · Pull Request #3891 · manyfold3d/manyfold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Reimplement timeline without using Federails Activities #3891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class HomeController < ApplicationController
skip_after_action :verify_policy_scoped

def index
@feed = Timeline.local for_user: current_user
@feed = local_timeline
end

def about
Expand All @@ -15,4 +15,12 @@ def about
def check_library_exists
redirect_to new_library_path if Library.count === 0 # rubocop:disable Pundit/UsePolicyScope
end

def local_timeline
[Model, Creator, Collection].map do |model|
query = policy_scope(model)
query = query.includes(:federails_actor) if SiteSettings.federation_enabled?
query.order(updated_at: :desc).limit(20)
end.flatten.sort_by(&:updated_at).last(20).reverse
end
end
18 changes: 0 additions & 18 deletions

This file was deleted.

33 changes: 0 additions & 33 deletions app/views/activities/_create_actor.html.erb

This file was deleted.

20 changes: 0 additions & 20 deletions app/views/activities/_create_following.html.erb

This file was deleted.

Empty file.
33 changes: 0 additions & 33 deletions app/views/activities/_update_actor.html.erb

This file was deleted.

34 changes: 34 additions & 0 deletions app/views/home/_activity.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<div class="card border-0 border-bottom">
<div class="card-body py-2">
<div class="row">
<div class="col col-auto">
<%= icon icon_for(activity.class), activity.class.model_name.human %>
</div>
<div class="col">
<%- if activity.federails_actor.nil? || activity.federails_actor.local? %>
<%= link_to activity.name, activity %>
<%- elsif activity.federails_actor&.profile_url %>
<%= link_to activity.name, activity.federails_actor&.profile_url %>
<%- else %>
<%= activity.name %>
<%- end %>
<%= server_indicator activity.federails_actor %>
<%= icon("explicit", Model.human_attribute_name(:sensitive)) if activity.respond_to?(:sensitive) && activity.sensitive %>
</div>
<% if activity.is_a? Model %>
<div class="col col-auto">
<%= status_badges(activity) %>
</div>
<% end %>
<div class="col col-auto">
<small>
<% if activity.updated_at >= (activity.created_at + 1.minute) %>
<%= t(".updated", time: time_ago_in_words(activity.updated_at)) %>
<% else %>
<%= t(".created", time: time_ago_in_words(activity.updated_at)) %>
<% end %>
</small>
</div>
</div>
</div>
</div>
4 changes: 1 addition & 3 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
<div class="col-8 offset-md-2">
<% if !@feed.empty? %>
<p class="lead"><%= t(".recent_activity") %></p>
<% @feed.each do |activity| %>
<%= render partial: "activities/#{activity.action.parameterize}_#{activity.entity_type.demodulize.parameterize}", locals: {activity: activity} %>
<% end %>
<%= render partial: "activity", collection: @feed %>
<% else %>
<div class="alert alert-info">
<%= t(".no_activities") %>
Expand Down
6 changes: 3 additions & 3 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ cs:
save: Uložit
view: Zobrazení
home:
activity:
created: přidal před %{time}
updated: aktualizo před %{time}
index:
create_actor: přidal %{name} před %{time}
how_long_ago: před %{time}
no_activities: Prozatím nejsou k dispozici žádné aktivity, ke zobrazení.
recent_activity: Poslední aktivita
search:
placeholder: Co hledáte?
submit: Vyhledávání
update_actor: aktualizováno %{name} před %{time}
jobs:
activity:
creator_added_model:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ de:
save: Speichern
view: Siehe
home:
activity:
created: hinzugefügt vor %{time}
updated: aktualisiert vor %{time}
index:
create_actor: 'hinzugefügt von %{name} vor %{time} '
how_long_ago: vor %{time}
no_activities: Im Moment gibt es keine Aktivitäten zu sehen.
recent_activity: Neuste Aktivität
search:
placeholder: Wonach suchen Sie?
submit: Suche
update_actor: aktualisiert von %{name} vor %{time}
jobs:
activity:
creator_added_model:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ en:
save: Save
view: View
home:
activity:
created: added %{time} ago
updated: updated %{time} ago
index:
create_actor: added by %{name} %{time} ago
how_long_ago: "%{time} ago"
no_activities: There are no activities to display for now.
recent_activity: Recent Activity
search:
placeholder: What are you looking for?
submit: Search
update_actor: updated by %{name} %{time} ago
jobs:
activity:
creator_added_model:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/es.yml
F438
Original file line number Diff line numberDiff line change
Expand Up @@ -327,15 +327,15 @@ es:
save: Guardar
view: Ver
home:
activity:
created: subido hace %{time}
updated: actualizado hace %{time}
index:
create_actor: subido por %{name} hace %{time}
how_long_ago: hace %{time}
no_activities: Por ahora no hay actividades que mostrar.
recent_activity: Actividad reciente
search:
placeholder: "¿Qué busca?"
submit: Buscar
update_actor: actualizado por %{name} hace %{time}
jobs:
activity:
creator_added_model:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ fr:
save: Sauvegarder
view: Afficher
home:
activity:
created: ajouté il y a %{time}
updated: mis à jour il y a %{time}
index:
create_actor: ajouté par %{name} il y a %{time}
how_long_ago: depuis %{time}
no_activities: Il n'y a pas d'activités à afficher pour l'instant.
recent_activity: Activité récente
search:
placeholder: Que recherchez-vous ?
submit: Recherche
update_actor: mis à jour par %{name} il y a %{time}
jobs:
activity:
creator_added_model:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ nl:
save: Opslaan
view: Bekijken
home:
activity:
created: toegevoegd %{time} geleden
updated: bijgewerkt %{time} geleden
index:
create_actor: toegevoegd door %{name} %{time} geleden
how_long_ago: "%{time} geleden"
no_activities: Er zijn momenteel geen activiteiten om weer te geven.
recent_activity: Recente Activiteit
search:
placeholder: Waar zoek je naar?
submit: Zoeken
update_actor: bijgewerkt door %{name} %{time} geleden
jobs:
activity:
creator_added_model:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ pl:
save: Zapisz
view: Widok
home:
activity:
created: dodany %{time} temu
updated: zaktualizowany %{time} temu
index:
create_actor: dodany przez %{name} %{time} temu
how_long_ago: "%{time} temu"
no_activities: Na razie nie ma żadnych aktywności do wyświetlenia.
recent_activity: Ostatnia Aktywność
search:
placeholder: Czego szukasz?
submit: Wyszukaj
update_actor: zaktualizowany przez %{name} %{time} temu
jobs:
activity:
creator_added_model:
Expand Down
Loading
0