8000 Added a simple "following" page by Floppy · Pull Request #3542 · manyfold3d/manyfold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added a simple "following" page #3542

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 6 commits into from
Feb 7, 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
6 changes: 3 additions & 3 deletions app/controllers/follows_controller.rb
8000
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class FollowsController < ApplicationController

def index
authorize Federails::Following
render :new
@followings = policy_scope(Federails::Following).all
end

# Incoming remote follow
Expand Down Expand Up @@ -48,14 +48,14 @@ def follow_remote_actor
current_user.follow(@actor)
# If the remote actor has a known Manyfold type, we can create a real object for it
find_or_create_entity(@actor)
redirect_to root_url, notice: t(".followed", actor: @actor.at_address)
redirect_back_or_to root_url, notice: t(".followed", actor: @actor.at_address)
end

def unfollow_remote_actor
authorize Federails::Following, :destroy?
@actor = Federails::Actor.find_param(params[:id])
current_user.unfollow(@actor)
redirect_to root_url, notice: t(".unfollowed", actor: @actor.at_address)
redirect_back_or_to root_url, notice: t(".unfollowed", actor: @actor.at_address)
end

def create
Expand Down
16 changes: 16 additions & 0 deletions app/views/follows/_actor_table.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<table class="table table-striped">
<tr>
<th><%= t(".name") %></th>
<th><%= t(".address") %></th>
<th><%= t(".info") %></th>
<th><%= t(".actions") %></th>
</tr>
<% actors.each do |actor| %>
<tr class="align-middle">
<td><%= actor.name %></td>
<td><%= actor.short_at_address %></td>
<td class="text-warning"><%= icon("exclamation-triangle-fill", translate(".non_manyfold_account")) if !actor.local? && actor.extensions&.dig("f3di:concreteType").nil? %></td>
<td><%= render FollowButtonComponent.new(follower: current_user, target: actor) %></td>
</tr>
<% end %>
</table>
8 changes: 8 additions & 0 deletions app/views/follows/_search_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="col-8">
<%= form_with url: new_follow_path, method: :get, class: "mt-3" do |f| %>
<div class="input-group mb-3">
<%= f.text_field :uri, class: "form-control", placeholder: translate(".placeholder"), aria_label: translate(".submit"), aria_describedby: "button-search", value: query %>
<%= f.submit translate(".submit"), class: "btn btn-primary", name: nil %>
</div>
<% end %>
</div>
3 changes: 3 additions & 0 deletions app/views/follows/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h2><%= t(".title") %></h2>

<%= render "actor_table", actors: @followings.map(&:target_actor) %>
24 changes: 2 additions & 22 deletions app/views/follows/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,13 @@
<%= t(".help") %>
</p>

<div class="col-8">
<%= form_with url: new_follow_path, method: :get, class: "mt-3" do |f| %>
<div class="input-group mb-3">
<%= f.text_field :uri, class: "form-control", placeholder: translate(".search.placeholder"), aria_label: translate(".search.submit"), aria_describedby: "button-search", value: @query %>
<%= f.submit translate(".search.submit"), class: "btn btn-primary", name: nil %>
</div>
<% end %>
</div>
<%= render "search_form", query: @query %>

<% if @query %>

<h3><%= t(".results") %></h3>
<% if @actor %>
<table class="table table-striped">
<tr>
<th><%= t(".name") %></th>
<th><%= t(".address") %></th>
<th><%= t(".info") %></th>
<th><%= t(".actions") %></th>
</tr>
<tr class="align-middle">
<td><%= @actor.name %></td>
<td><%= @actor.at_address %></td>
<td class="text-warning"><%= icon("exclamation-triangle-fill", translate(".non_manyfold_account")) if @actor.extensions["f3di:concreteType"].nil? %></td>
<td><%= render FollowButtonComponent.new(follower: current_user, target: @actor) %></td>
</tr>
</table>
<%= render "actor_table", actors: [@actor] %>
<% else %>
<div class="alert alert-info">
<%= icon "person-arms-up", "" %>
Expand Down
14 changes: 10 additions & 4 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,28 @@ de:
follow: Folge %{name}
unfollow: "%{name} nicht mehr Folgen"
follows:
actor_table:
actions: Aktionen
address: Fediverse Adresse
info: Info
name: Name
non_manyfold_account: Dies ist kein Manyfold-Konto; Du kannst ihm folgen, aber wahrscheinlich wird nichts Interessantes passieren, zumindest im Moment.
follow_remote_actor:
followed: Erfolgreich %{actor} gefolgt
new:
help: Du kannst öffentlichen Authoren, Sammlungen oder Modellen auf einem anderen Manyfold-Server folgen, und zwar jedem öffentlichen Konto im Fediverse! Gib einfach den Namen des Accounts in das Suchfeld ein!
no_results: Ich konnte leider nichts zu "%{query}" finden. Handelt es sich um ein gültiges ActivityPub-Konto oder eine URL?
results: Suchergebnisse
search:
placeholder: Gib ein Fediverse-Konto oder eine URL ein, z. B. admin@try.manyfold.app
submit: Suche
title: Folge dem Fediverse
remote_follow:
help: Du brauchst kein Konto auf diesem Server, um %{name} zu folgen; gib hier deinen eigenen Kontonamen ein, und wir schicken Sie nach Hause, um den Vorgang abzuschließen.
no_results_html: Wir konnten dein Privatkonto nicht finden; hast du es richtig angegeben?
placeholder: dein Fediverse-Benutzername, z. B. manyfold@3dp.chat
placeholder: dein Fediverse-Benutzername, z. B. @manyfold@3dp.chat
submit: Bring mich nach Hause
title: Folge %{name}
search_form:
placeholder: Gib ein Fediverse-Konto oder eine URL ein, z. B. @admin@try.manyfold.app
submit: Suche
general:
delete: Löschen
download: Herunterladen
Expand Down
21 changes: 12 additions & 9 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,27 +296,30 @@ en:
pending: Requested
unfollow: Unfollow %{name}
follows:
follow_remote_actor:
followed: Followed %{actor} successfully
new:
actor_table:
actions: Actions
address: Fediverse Address
help: You can follow public creators, collections or models on another Manyfold server, in fact any public account in the Fediverse! Just enter the account name in the search box!
info: Info
name: Name
no_results: Sorry, couldn't find anything for "%{query}". Is it a valid ActivityPub account or URL?
non_manyfold_account: This is not a Manyfold account; you can follow it, but probably nothing interesting will happen, at least for now.
follow_remote_actor:
followed: Followed %{actor} successfully
index:
title: Following
new:
help: You can follow public creators, collections or models on another Manyfold server, in fact any public account in the Fediverse! Just enter the account name in the search box!
no_results: Sorry, couldn't find anything for "%{query}". Is it a valid ActivityPub account or URL?
results: Search Results
search:
placeholder: Enter a Fediverse account or URL, e.g. admin@try.manyfold.app
submit: Search
title: Follow the Fediverse
remote_follow:
help: You don't need an account on this server to follow %{name}; enter your own account name here, and we'll send you home to complete the process.
no_results_html: We couldn't find your home account; did you enter it correctly?
placeholder: Your Fediverse username, e.g. manyfold@3dp.chat
placeholder: Your Fediverse username, e.g. @manyfold@3dp.chat
submit: Take me home
title: Follow %{name}
search_form:
placeholder: Enter a Fediverse account or URL, e.g. @admin@try.manyfold.app
submit: Search
unfollow_remote_actor:
unfollowed: Unfollowed %{actor}
general:
Expand Down
14 changes: 10 additions & 4 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,28 @@ es:
follow: Seguir %{name}
unfollow: Dejar de seguir %{name}
follows:
actor_table:
actions: Acciones
address: Dirección Fediverse
info: Información
name: Nombre
non_manyfold_account: Esta no es una cuenta Manyfold. Puedes seguirla, pero probablemente no ocurra nada interesante, al menos por ahora.
follow_remote_actor:
followed: Siguiendo a %{actor} correctamente.
new:
help: Puedes seguir creadores, colecciones o modelos públicos en otro servidor de Manyfold; ¡de hecho, cualquier cuenta pública en el Fediverse! Solo ingresa el nombre de la cuenta en el cuadro de búsqueda.
no_results: Lo siento, no encontré nada para "%{query}". ¿Es una cuenta o URL de ActivityPub válida?
results: Resultados de la búsqueda
search:
placeholder: Introduzca una cuenta Fediverse o URL, por ejemplo admin@try.manyfold.app
submit: Buscar
title: Sigue el Fediverse
remote_follow:
help: No es necesario tener una cuenta en este servidor para seguir a %{name}. Escribe tu nombre de usuario aquí y te llevaremos de vuelta para completar el proceso
no_results_html: No se pudo encontrar tu cuenta de inicio; ¿la escribiste correctamente?
placeholder: Tu nombre de usuario de Fediverse, por ejemplo manyfold@3dp.chat
placeholder: Tu nombre de usuario de Fediverse, por ejemplo @manyfold@3dp.chat
submit: Llévame a casa
title: Seguir %{name}
search_form:
placeholder: Introduzca una cuenta Fediverse o URL, por ejemplo @admin@try.manyfold.app
submit: Buscar
general:
delete: Borrar
download: Descargar
Expand Down
14 changes: 10 additions & 4 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,28 @@ fr:
follow: Suivre %{name}
unfollow: ne plus suivre %{name}
follows:
actor_table:
actions: Actions
address: Adresse Fediverse
info: Information
name: Nom
non_manyfold_account: Il ne s'agit pas d'un compte Manyfold ; vous pouvez le suivre, mais il ne se passera probablement rien d'intéressant, du moins pour l'instant.
follow_remote_actor:
followed: Suivi de %{actor} avec succès
new:
help: Vous pouvez suivre des créateurs publics, des collections ou des modèles sur un autre serveur Manyfold, en fait n'importe quel compte public dans Fediverse ! Il suffit d'entrer le nom du compte dans la boîte de recherche !
no_results: Désolé, rien n'a été trouvé pour "%{query}". S'agit-il d'un compte ou d'une URL ActivityPub valide ?
results: Résultats de la recherche
search:
placeholder: 'Entrez un compte Fediverse ou une URL, ex. : admin@try.manyfold.app'
submit: Recherche
title: Suivre le Fediverse
remote_follow:
help: Vous n'avez pas besoin d'un compte sur ce serveur pour suivre %{name} ; entrez votre propre nom de compte ici, et nous vous renverrons chez vous pour terminer la procédure.
no_results_html: Nous n'avons pas trouvé votre compte personnel ; l'avez-vous saisi correctement ?
placeholder: 'Votre nom d''utilisateur Fediverse, ex. : manyfold@3dp.chat'
placeholder: 'Votre nom d''utilisateur Fediverse, ex. : @manyfold@3dp.chat'
submit:
title: Suivre %{name}
search_form:
placeholder: 'Entrez un compte Fediverse ou une URL, ex. : @admin@try.manyfold.app'
submit: Recherche
general:
delete: Supprimer
download: Télécharger
Expand Down
14 changes: 10 additions & 4 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,22 +294,28 @@ nl:
follow: Volg %{name}
unfollow: Ontvolg %{name}
follows:
actor_table:
actions: Acties
address:
info: Info
name: Naam
non_manyfold_account:
follow_remote_actor:
followed: "%{actor} succesvol gevolgd"
new:
help: Je kunt openbare makers, collecties of modellen op een andere Manyfold-server volgen, eigenlijk elk openbaar account in het Fediverse! Voer gewoon de accountnaam in het zoekvak in!
no_results: Sorry, kon niets vinden voor "%{query}". Is het een geldig ActivityPub-account of URL?
results: Zoekresultaten
search:
placeholder: Voer een Fediverse-account of URL in, bijv. admin@try.manyfold.app
submit: Zoeken
title: Volg het Fediverse
remote_follow:
help: Je hebt geen account nodig op deze server om %{name} te volgen; voer hier je eigen accountnaam in, en we sturen je terug naar je eigen server om het proces te voltooien.
no_results_html: We konden je thuisaccount niet vinden; heb je het correct ingevoerd?
placeholder: Je Fediverse-gebruikersnaam, bijv. manyfold@3dp.chat
placeholder: Je Fediverse-gebruikersnaam, bijv. @manyfold@3dp.chat
submit: Breng me naar huis
title: Volg %{name}
search_form:
placeholder: Voer een Fediverse-account of URL in, bijv. @admin@try.manyfold.app
submit: Zoeken
general:
delete: Verwijderen
download: Downloaden
Expand Down
14 changes: 10 additions & 4 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,28 @@ pl:
follow: Obserwuj %{name}
unfollow: Przestań obserwować %{name}
follows:
actor_table:
actions: Akcje
address: Adres Fediverse
info: Informacja
name: Nazwa
non_manyfold_account: To nie jest konto Manyfold; możesz je zaobserwować, ale prawdopodobnie nic ciekawego się nie stanie, przynajmniej na razie.
follow_remote_actor:
followed: Pomyślnie zaczęto obserwować %{actor}
new:
help: Możesz obserwować publicznych twórców, kolekcje lub modele na innym serwerze Manyfold, a nawet każde publiczne konto w Fediverse! Wystarczy, że wpiszesz nazwę konta w polu wyszukiwania!
no_results: Przepraszamy, nie mogliśmy znaleźć niczego dla "%{query}". Czy jest to prawidłowe konto ActivityPub lub adres URL?
results: Wyniki wyszukiwania
search:
placeholder: Wprowadź konto Fediverse lub adres URL, np. admin@try.manyfold.app
submit: Wyszukaj
title: Śledź Fediverse
remote_follow:
help: Nie potrzebujesz konta na tym serwerze, aby obserwować %{name}; wprowadź tutaj nazwę swojego konta, a my odeślemy Cię do domu, aby zakończyć proces.
no_results_html: Nie mogliśmy znaleźć Twojego konta domowego; czy wprowadziłeś je poprawnie?
placeholder: Twoja nazwa użytkownika Fediverse, np. manyfold@3dp.chat
placeholder: Twoja nazwa użytkownika Fediverse, np. @manyfold@3dp.chat
submit: Zabierz mnie do domu
title: Obserwuj %{name}
search_form:
placeholder: Wprowadź konto Fediverse lub adres URL, np. @admin@try.manyfold.app
submit: Wyszukaj
general:
delete: Usuń
download: Pobierz
Expand Down
Loading
0