fedipub 0.11.2 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/app/helpers/fedipub/rails/server_helper.rb +3 -0
- data/app/models/concerns/fedipub/data_entity.rb +4 -2
- data/app/models/fedipub/activity.rb +12 -1
- data/app/models/fedipub/actor.rb +2 -0
- data/app/models/fedipub/approval_stamp.rb +5 -4
- data/app/models/fedipub/block.rb +14 -0
- data/app/models/fedipub/following.rb +5 -0
- data/app/views/fedipub/rails/server/activities/_activity.activitypub.jbuilder +3 -1
- data/app/views/fedipub/rails/server/web_finger/find.jrd.jbuilder +5 -3
- data/config/routes.rb +0 -26
- data/db/migrate/20261127141703_create_fedipub_blocks.rb +9 -0
- data/db/migrate/20261203000000_add_federated_url_to_fedipub_activities.rb +6 -0
- data/lib/fedipub/activity_handlers/block_handler.rb +18 -0
- data/lib/fedipub/activity_handlers/follow_handler.rb +1 -0
- data/lib/fedipub/activity_handlers/quote_request_handler.rb +11 -9
- data/lib/fedipub/concerns/blocker.rb +39 -0
- data/lib/fedipub/concerns/has_interaction_policy.rb +7 -2
- data/lib/fedipub/concerns/quote_request.rb +4 -1
- data/lib/fedipub/configuration.rb +26 -15
- data/lib/fedipub/version.rb +1 -1
- data/lib/fedipub.rb +2 -20
- data/lib/fediverse/inbox.rb +21 -6
- data/lib/generators/fedipub/install/templates/fedipub.yml +0 -3
- metadata +10 -39
- data/app/controllers/fedipub/rails/client/activities_controller.rb +0 -29
- data/app/controllers/fedipub/rails/client/actors_controller.rb +0 -56
- data/app/controllers/fedipub/rails/client/followings_controller.rb +0 -105
- data/app/controllers/fedipub/rails/client_controller.rb +0 -11
- data/app/policies/fedipub/client/activity_policy.rb +0 -9
- data/app/policies/fedipub/client/actor_policy.rb +0 -15
- data/app/policies/fedipub/client/following_policy.rb +0 -35
- data/app/views/fedipub/rails/client/activities/_activity.html.erb +0 -5
- data/app/views/fedipub/rails/client/activities/_activity.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/activities/_index.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/activities/feed.html.erb +0 -11
- data/app/views/fedipub/rails/client/activities/feed.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/activities/index.html.erb +0 -5
- data/app/views/fedipub/rails/client/activities/index.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/actors/_actor.json.jbuilder +0 -18
- data/app/views/fedipub/rails/client/actors/_lookup_form.html.erb +0 -5
- data/app/views/fedipub/rails/client/actors/gone.html.erb +0 -1
- data/app/views/fedipub/rails/client/actors/index.html.erb +0 -44
- data/app/views/fedipub/rails/client/actors/index.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/actors/show.html.erb +0 -117
- data/app/views/fedipub/rails/client/actors/show.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/common/_client_links.html.erb +0 -26
- data/app/views/fedipub/rails/client/followings/_follow.html.erb +0 -4
- data/app/views/fedipub/rails/client/followings/_follow_actions.html.erb +0 -36
- data/app/views/fedipub/rails/client/followings/_follower.html.erb +0 -7
- data/app/views/fedipub/rails/client/followings/_following.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/followings/_form.html.erb +0 -22
- data/app/views/fedipub/rails/client/followings/index.html.erb +0 -29
- data/app/views/fedipub/rails/client/followings/index.json.jbuilder +0 -1
- data/app/views/fedipub/rails/client/followings/show.html.erb +0 -21
- data/app/views/fedipub/rails/client/followings/show.json.jbuilder +0 -1
- data/lib/generators/fedipub/copy_client_policies/USAGE +0 -8
- data/lib/generators/fedipub/copy_client_policies/copy_client_policies_generator.rb +0 -9
- data/lib/generators/fedipub/copy_client_views/USAGE +0 -8
- data/lib/generators/fedipub/copy_client_views/copy_client_views_generator.rb +0 -9
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<%#
|
|
2
|
-
Displays buttons to follow/revoke following on a given actor.
|
|
3
|
-
Requires variables:
|
|
4
|
-
- user (usually user)
|
|
5
|
-
- actor (target actor)
|
|
6
|
-
%>
|
|
7
|
-
<p>
|
|
8
|
-
<% if Fedipub::Client::FollowingPolicy.new(user, Fedipub::Following).create? %>
|
|
9
|
-
<% follow = user.fedipub_actor.follows? actor %>
|
|
10
|
-
<% if actor.entity == user %>
|
|
11
|
-
<button type="button" role="button" disabled="disabled">That's you</button>
|
|
12
|
-
<% elsif follow %>
|
|
13
|
-
You are already following (<%= follow.status %>)
|
|
14
|
-
<%= button_to 'Cancel', fedipub.client_following_path(follow), method: :delete %>
|
|
15
|
-
<% else %>
|
|
16
|
-
<%= button_to "Follow #{actor.username}", fedipub.follow_client_followings_path, params: { account: actor.at_address }, method: :post %>
|
|
17
|
-
<% end %>
|
|
18
|
-
|
|
19
|
-
<% followed = actor.follows? user.fedipub_actor %>
|
|
20
|
-
<% if followed %>
|
|
21
|
-
<% if followed.pending? %>
|
|
22
|
-
<%= actor.username %> wants to follow you.
|
|
23
|
-
<%= button_to 'Accept request', fedipub.accept_client_following_path(followed), method: :put %>
|
|
24
|
-
<% else %>
|
|
25
|
-
<%= actor.username %> follows you.
|
|
26
|
-
<%= button_to 'Revoke', fedipub.client_following_path(followed), method: :delete %>
|
|
27
|
-
<% end %>
|
|
28
|
-
<% end %>
|
|
29
|
-
<% elsif !user %>
|
|
30
|
-
Register or login to be able to follow this actor. Alternatively, search for this address on Fediverse server where
|
|
31
|
-
you already have an account:
|
|
32
|
-
<input type="text" readonly="readonly" value="<%= actor.at_address(prefix: '') %>">
|
|
33
|
-
<% else %>
|
|
34
|
-
<%= user.class.name %> is not configured to follow/be followed, or has no associated actor.
|
|
35
|
-
<% end %>
|
|
36
|
-
</p>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<div>
|
|
2
|
-
<b><%= link_to following.actor.name, fedipub.client_actor_url(following.actor) %></b>
|
|
3
|
-
(<%= following.actor.at_address %>) (<%= following.status %>)
|
|
4
|
-
<% if following.pending? && following.target_actor == current_user&.fedipub_actor %>
|
|
5
|
-
<%= button_to 'Accept', fedipub.accept_client_following_path(following), method: :put %>
|
|
6
|
-
<% end %>
|
|
7
|
-
</div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
json.extract! following, :id, :actor_id, :target_actor_id, :status, :created_at, :updated_at
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<%= form_for following, url: fedipub.client_following_url do |f| %>
|
|
2
|
-
<h1>DELETE ME</h1>
|
|
3
|
-
<% if following.errors.any? %>
|
|
4
|
-
<div class="error_explanation">
|
|
5
|
-
<h2><%= pluralize(following.errors.count, 'error') %> prohibited this following from being saved:</h2>
|
|
6
|
-
<ul>
|
|
7
|
-
<% following.errors.full_messages.each do |message| %>
|
|
8
|
-
<li><%= message %></li>
|
|
9
|
-
<% end %>
|
|
10
|
-
</ul>
|
|
11
|
-
</div>
|
|
12
|
-
<% end %>
|
|
13
|
-
|
|
14
|
-
<div class="field">
|
|
15
|
-
<%= f.label :target_actor %>
|
|
16
|
-
<%= f.collection_select :target_actor_id, Fedipub::Actor.all, :id, :name %>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div class="actions">
|
|
20
|
-
<%= f.submit 'Save' %>
|
|
21
|
-
</div>
|
|
22
|
-
<% end %>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<h1>Listing followings</h1>
|
|
2
|
-
|
|
3
|
-
<table>
|
|
4
|
-
<thead>
|
|
5
|
-
<tr>
|
|
6
|
-
<th>Actor</th>
|
|
7
|
-
<th>Target actor</th>
|
|
8
|
-
<th>Status</th>
|
|
9
|
-
<th></th>
|
|
10
|
-
<th></th>
|
|
11
|
-
<th></th>
|
|
12
|
-
</tr>
|
|
13
|
-
</thead>
|
|
14
|
-
|
|
15
|
-
<tbody>
|
|
16
|
-
<% @followings.each do |following| %>
|
|
17
|
-
<tr>
|
|
18
|
-
<td><%= following.actor %></td>
|
|
19
|
-
<td><%= following.target_actor %></td>
|
|
20
|
-
<td><%= following.status %></td>
|
|
21
|
-
<td><%= link_to 'Show', following %></td>
|
|
22
|
-
<td><%= link_to 'Edit', edit_following_path(following) %></td>
|
|
23
|
-
<td><%= link_to 'Destroy', following, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
24
|
-
</tr>
|
|
25
|
-
<% end %>
|
|
26
|
-
</tbody>
|
|
27
|
-
</table>
|
|
28
|
-
|
|
29
|
-
<%= link_to 'New Following', new_following_path %>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
json.array! @followings, partial: 'fedipub/rails/client/followings/following', as: :following
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<p id="notice"><%= notice %></p>
|
|
2
|
-
|
|
3
|
-
<p>
|
|
4
|
-
<b>Actor:</b>
|
|
5
|
-
<%= @following.actor %>
|
|
6
|
-
</p>
|
|
7
|
-
|
|
8
|
-
<p>
|
|
9
|
-
<b>Target actor:</b>
|
|
10
|
-
<%= @following.target_actor %>
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-
<p>
|
|
14
|
-
<b>Status:</b>
|
|
15
|
-
<%= @following.status %>
|
|
16
|
-
</p>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<%= link_to 'Edit', edit_following_path(@following) %>
|
|
20
|
-
\|
|
|
21
|
-
<%= link_to 'Back', followings_path %>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
json.partial! 'fedipub/rails/client/followings/following', following: @following
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
class CopyClientPoliciesGenerator < ::Rails::Generators::Base
|
|
3
|
-
source_root File.expand_path('../../../../app/policies/fedipub', __dir__)
|
|
4
|
-
|
|
5
|
-
def copy_policies
|
|
6
|
-
directory 'client', ::Rails.root.join('app', 'policies', 'fedipub', 'client')
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
class CopyClientViewsGenerator < ::Rails::Generators::Base
|
|
3
|
-
source_root File.expand_path('../../../../app/views', __dir__)
|
|
4
|
-
|
|
5
|
-
def copy_views
|
|
6
|
-
directory 'fedipub/rails/client', ::Rails.root.join('app', 'views', 'fedipub', 'rails', 'client')
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|