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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/app/helpers/fedipub/rails/server_helper.rb +3 -0
  4. data/app/models/concerns/fedipub/data_entity.rb +4 -2
  5. data/app/models/fedipub/activity.rb +12 -1
  6. data/app/models/fedipub/actor.rb +2 -0
  7. data/app/models/fedipub/approval_stamp.rb +5 -4
  8. data/app/models/fedipub/block.rb +14 -0
  9. data/app/models/fedipub/following.rb +5 -0
  10. data/app/views/fedipub/rails/server/activities/_activity.activitypub.jbuilder +3 -1
  11. data/app/views/fedipub/rails/server/web_finger/find.jrd.jbuilder +5 -3
  12. data/config/routes.rb +0 -26
  13. data/db/migrate/20261127141703_create_fedipub_blocks.rb +9 -0
  14. data/db/migrate/20261203000000_add_federated_url_to_fedipub_activities.rb +6 -0
  15. data/lib/fedipub/activity_handlers/block_handler.rb +18 -0
  16. data/lib/fedipub/activity_handlers/follow_handler.rb +1 -0
  17. data/lib/fedipub/activity_handlers/quote_request_handler.rb +11 -9
  18. data/lib/fedipub/concerns/blocker.rb +39 -0
  19. data/lib/fedipub/concerns/has_interaction_policy.rb +7 -2
  20. data/lib/fedipub/concerns/quote_request.rb +4 -1
  21. data/lib/fedipub/configuration.rb +26 -15
  22. data/lib/fedipub/version.rb +1 -1
  23. data/lib/fedipub.rb +2 -20
  24. data/lib/fediverse/inbox.rb +21 -6
  25. data/lib/generators/fedipub/install/templates/fedipub.yml +0 -3
  26. metadata +10 -39
  27. data/app/controllers/fedipub/rails/client/activities_controller.rb +0 -29
  28. data/app/controllers/fedipub/rails/client/actors_controller.rb +0 -56
  29. data/app/controllers/fedipub/rails/client/followings_controller.rb +0 -105
  30. data/app/controllers/fedipub/rails/client_controller.rb +0 -11
  31. data/app/policies/fedipub/client/activity_policy.rb +0 -9
  32. data/app/policies/fedipub/client/actor_policy.rb +0 -15
  33. data/app/policies/fedipub/client/following_policy.rb +0 -35
  34. data/app/views/fedipub/rails/client/activities/_activity.html.erb +0 -5
  35. data/app/views/fedipub/rails/client/activities/_activity.json.jbuilder +0 -1
  36. data/app/views/fedipub/rails/client/activities/_index.json.jbuilder +0 -1
  37. data/app/views/fedipub/rails/client/activities/feed.html.erb +0 -11
  38. data/app/views/fedipub/rails/client/activities/feed.json.jbuilder +0 -1
  39. data/app/views/fedipub/rails/client/activities/index.html.erb +0 -5
  40. data/app/views/fedipub/rails/client/activities/index.json.jbuilder +0 -1
  41. data/app/views/fedipub/rails/client/actors/_actor.json.jbuilder +0 -18
  42. data/app/views/fedipub/rails/client/actors/_lookup_form.html.erb +0 -5
  43. data/app/views/fedipub/rails/client/actors/gone.html.erb +0 -1
  44. data/app/views/fedipub/rails/client/actors/index.html.erb +0 -44
  45. data/app/views/fedipub/rails/client/actors/index.json.jbuilder +0 -1
  46. data/app/views/fedipub/rails/client/actors/show.html.erb +0 -117
  47. data/app/views/fedipub/rails/client/actors/show.json.jbuilder +0 -1
  48. data/app/views/fedipub/rails/client/common/_client_links.html.erb +0 -26
  49. data/app/views/fedipub/rails/client/followings/_follow.html.erb +0 -4
  50. data/app/views/fedipub/rails/client/followings/_follow_actions.html.erb +0 -36
  51. data/app/views/fedipub/rails/client/followings/_follower.html.erb +0 -7
  52. data/app/views/fedipub/rails/client/followings/_following.json.jbuilder +0 -1
  53. data/app/views/fedipub/rails/client/followings/_form.html.erb +0 -22
  54. data/app/views/fedipub/rails/client/followings/index.html.erb +0 -29
  55. data/app/views/fedipub/rails/client/followings/index.json.jbuilder +0 -1
  56. data/app/views/fedipub/rails/client/followings/show.html.erb +0 -21
  57. data/app/views/fedipub/rails/client/followings/show.json.jbuilder +0 -1
  58. data/lib/generators/fedipub/copy_client_policies/USAGE +0 -8
  59. data/lib/generators/fedipub/copy_client_policies/copy_client_policies_generator.rb +0 -9
  60. data/lib/generators/fedipub/copy_client_views/USAGE +0 -8
  61. data/lib/generators/fedipub/copy_client_views/copy_client_views_generator.rb +0 -9
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fedipub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Tancoigne
8
+ - James Smith
8
9
  bindir: bin
9
10
  cert_chain: []
10
11
  date: 1980-01-02 00:00:00.000000000 Z
@@ -165,7 +166,7 @@ dependencies:
165
166
  version: 7.2.0
166
167
  description: An ActivityPub engine for Ruby on Rails
167
168
  email:
168
- - manu@experimentslabs.com
169
+ - info@fedipub.dev
169
170
  executables: []
170
171
  extensions: []
171
172
  extra_rdoc_files: []
@@ -174,10 +175,6 @@ files:
174
175
  - README.md
175
176
  - Rakefile
176
177
  - app/controllers/concerns/fedipub/rails/server/render_collections.rb
177
- - app/controllers/fedipub/rails/client/activities_controller.rb
178
- - app/controllers/fedipub/rails/client/actors_controller.rb
179
- - app/controllers/fedipub/rails/client/followings_controller.rb
180
- - app/controllers/fedipub/rails/client_controller.rb
181
178
  - app/controllers/fedipub/rails/server/activities_controller.rb
182
179
  - app/controllers/fedipub/rails/server/actors_controller.rb
183
180
  - app/controllers/fedipub/rails/server/approval_stamps_controller.rb
@@ -197,41 +194,15 @@ files:
197
194
  - app/models/fedipub/actor.rb
198
195
  - app/models/fedipub/application_record.rb
199
196
  - app/models/fedipub/approval_stamp.rb
197
+ - app/models/fedipub/block.rb
200
198
  - app/models/fedipub/following.rb
201
199
  - app/models/fedipub/host.rb
202
- - app/policies/fedipub/client/activity_policy.rb
203
- - app/policies/fedipub/client/actor_policy.rb
204
- - app/policies/fedipub/client/following_policy.rb
205
200
  - app/policies/fedipub/fedipub_policy.rb
206
201
  - app/policies/fedipub/server/activity_policy.rb
207
202
  - app/policies/fedipub/server/actor_policy.rb
208
203
  - app/policies/fedipub/server/approval_stamp_policy.rb
209
204
  - app/policies/fedipub/server/following_policy.rb
210
205
  - app/policies/fedipub/server/publishable_policy.rb
211
- - app/views/fedipub/rails/client/activities/_activity.html.erb
212
- - app/views/fedipub/rails/client/activities/_activity.json.jbuilder
213
- - app/views/fedipub/rails/client/activities/_index.json.jbuilder
214
- - app/views/fedipub/rails/client/activities/feed.html.erb
215
- - app/views/fedipub/rails/client/activities/feed.json.jbuilder
216
- - app/views/fedipub/rails/client/activities/index.html.erb
217
- - app/views/fedipub/rails/client/activities/index.json.jbuilder
218
- - app/views/fedipub/rails/client/actors/_actor.json.jbuilder
219
- - app/views/fedipub/rails/client/actors/_lookup_form.html.erb
220
- - app/views/fedipub/rails/client/actors/gone.html.erb
221
- - app/views/fedipub/rails/client/actors/index.html.erb
222
- - app/views/fedipub/rails/client/actors/index.json.jbuilder
223
- - app/views/fedipub/rails/client/actors/show.html.erb
224
- - app/views/fedipub/rails/client/actors/show.json.jbuilder
225
- - app/views/fedipub/rails/client/common/_client_links.html.erb
226
- - app/views/fedipub/rails/client/followings/_follow.html.erb
227
- - app/views/fedipub/rails/client/followings/_follow_actions.html.erb
228
- - app/views/fedipub/rails/client/followings/_follower.html.erb
229
- - app/views/fedipub/rails/client/followings/_following.json.jbuilder
230
- - app/views/fedipub/rails/client/followings/_form.html.erb
231
- - app/views/fedipub/rails/client/followings/index.html.erb
232
- - app/views/fedipub/rails/client/followings/index.json.jbuilder
233
- - app/views/fedipub/rails/client/followings/show.html.erb
234
- - app/views/fedipub/rails/client/followings/show.json.jbuilder
235
206
  - app/views/fedipub/rails/server/activities/_activity.activitypub.jbuilder
236
207
  - app/views/fedipub/rails/server/activities/show.activitypub.jbuilder
237
208
  - app/views/fedipub/rails/server/actors/_actor.activitypub.jbuilder
@@ -269,8 +240,11 @@ files:
269
240
  - db/migrate/20260723113716_rename_federails_to_fedipub.rb
270
241
  - db/migrate/20260922155524_create_fedipub_approval_stamps.rb
271
242
  - db/migrate/20260924090802_add_shared_inbox_url_to_fedipub_actors.rb
243
+ - db/migrate/20261127141703_create_fedipub_blocks.rb
244
+ - db/migrate/20261203000000_add_federated_url_to_fedipub_activities.rb
272
245
  - lib/fedipub.rb
273
246
  - lib/fedipub/activity_handlers/accept_follow_handler.rb
247
+ - lib/fedipub/activity_handlers/block_handler.rb
274
248
  - lib/fedipub/activity_handlers/delete_handler.rb
275
249
  - lib/fedipub/activity_handlers/follow_handler.rb
276
250
  - lib/fedipub/activity_handlers/quote_request_handler.rb
@@ -278,6 +252,7 @@ files:
278
252
  - lib/fedipub/activity_handlers/undo_follow_handler.rb
279
253
  - lib/fedipub/concerns/announceable.rb
280
254
  - lib/fedipub/concerns/application_actor.rb
255
+ - lib/fedipub/concerns/blocker.rb
281
256
  - lib/fedipub/concerns/generic_actor_entity.rb
282
257
  - lib/fedipub/concerns/generic_data_entity.rb
283
258
  - lib/fedipub/concerns/handles_delete_requests.rb
@@ -309,10 +284,6 @@ files:
309
284
  - lib/fediverse/signature/draft_cavage12.rb
310
285
  - lib/fediverse/signature/rfc9421.rb
311
286
  - lib/fediverse/webfinger.rb
312
- - lib/generators/fedipub/copy_client_policies/USAGE
313
- - lib/generators/fedipub/copy_client_policies/copy_client_policies_generator.rb
314
- - lib/generators/fedipub/copy_client_views/USAGE
315
- - lib/generators/fedipub/copy_client_views/copy_client_views_generator.rb
316
287
  - lib/generators/fedipub/copy_factories/USAGE
317
288
  - lib/generators/fedipub/copy_factories/copy_factories_generator.rb
318
289
  - lib/generators/fedipub/install/USAGE
@@ -321,12 +292,12 @@ files:
321
292
  - lib/generators/fedipub/install/templates/fedipub.yml
322
293
  - lib/tasks/factory_bot.rake
323
294
  - lib/tasks/fedipub_tasks.rake
324
- homepage: https://experimentslabs.com
295
+ homepage: https://fedipub.dev
325
296
  licenses:
326
297
  - MIT
327
298
  metadata:
328
299
  rubygems_mfa_required: 'true'
329
- homepage_uri: https://experimentslabs.com
300
+ homepage_uri: https://fedipub.dev
330
301
  source_code_uri: https://gitlab.com/fedipub/fedipub/
331
302
  changelog_uri: https://gitlab.com/fedipub/fedipub/-/blob/main/CHANGELOG.md
332
303
  rdoc_options: []
@@ -1,29 +0,0 @@
1
- module Fedipub
2
- module Rails
3
- module Client
4
- class ActivitiesController < Fedipub::Rails::ClientController
5
- before_action :authenticate_user!, only: [:feed]
6
- before_action :authorize_action!
7
-
8
- # GET /app/activities
9
- # GET /app/activities.json
10
- def index
11
- @activities = policy_scope(Fedipub::Activity, policy_scope_class: Fedipub::Client::ActivityPolicy::Scope).all
12
- @activities = @activities.where actor: Actor.find_param(params[:actor_id]) if params[:actor_id]
13
- end
14
-
15
- # GET /app/feed
16
- # GET /app/feed.json
17
- def feed
18
- @activities = Activity.feed_for(current_user.fedipub_actor)
19
- end
20
-
21
- private
22
-
23
- def authorize_action!
24
- authorize(Fedipub::Activity, policy_class: Fedipub::Client::ActivityPolicy)
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,56 +0,0 @@
1
- module Fedipub
2
- module Rails
3
- module Client
4
- class ActorsController < Fedipub::Rails::ClientController
5
- before_action :set_actor, only: [:show]
6
-
7
- # GET /app/actors
8
- # GET /app/actors.json
9
- def index
10
- authorize Fedipub::Actor, policy_class: Fedipub::Client::ActorPolicy
11
-
12
- @actors = policy_scope(Fedipub::Actor, policy_scope_class: Fedipub::Client::ActorPolicy::Scope).all
13
- @actors = @actors.local if params[:local_only]
14
- end
15
-
16
- # GET /app/actors/1
17
- # GET /app/actors/1.json
18
- def show
19
- render_show
20
- end
21
-
22
- # GET /app/actors/lookup
23
- # GET /app/actors/lookup.json
24
- def lookup
25
- @actor = Fedipub::Actor.find_by_account account_param
26
- authorize @actor, policy_class: Fedipub::Client::ActorPolicy
27
- render_show
28
- end
29
-
30
- private
31
-
32
- # Use callbacks to share common setup or constraints between actions.
33
- def set_actor
34
- @actor = Fedipub::Actor.find_param(params[:id])
35
- authorize @actor, policy_class: Fedipub::Client::ActorPolicy
36
- end
37
-
38
- def account_param
39
- params.require('account').strip
40
- end
41
-
42
- def render_show
43
- respond_to do |format|
44
- if @actor.tombstoned?
45
- format.html { render :gone, status: :gone }
46
- format.json { render json: { error: I18n.t('controller.actors.gone') }, status: :gone }
47
- else
48
- format.html { render :show }
49
- format.json { render :show }
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,105 +0,0 @@
1
- module Fedipub
2
- module Rails
3
- module Client
4
- class FollowingsController < Fedipub::Rails::ClientController
5
- before_action :authenticate_user!
6
- before_action :skip_authorization, only: [:new, :create]
7
- before_action :set_following, only: [:accept, :destroy]
8
-
9
- # GET /app/followings/new?uri={uri}
10
- def new
11
- # Find actor (and fetch if necessary)
12
- actor = Actor.find_or_create_by_federation_url(params.require(:uri))
13
- # Redirect to local profile page which will have a follow button on it
14
- redirect_to fedipub.client_actor_url(actor)
15
- end
16
-
17
- # PUT /app/followings/:id/accept
18
- # PUT /app/followings/:id/accept.json
19
- def accept
20
- respond_to do |format|
21
- url = fedipub.client_actor_url @following.actor
22
- if @following.accept!
23
- format.html { redirect_to url, notice: I18n.t('controller.followings.accept.success') }
24
- format.json { render :show, status: :ok, location: @following }
25
- else
26
- format.html { redirect_to url, alert: I18n.t('controller.followings.accept.error') }
27
- format.json { render json: @following.errors, status: Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT }
28
- end
29
- end
30
- end
31
-
32
- # POST /app/followings
33
- # POST /app/followings.json
34
- def create
35
- @following = Following.new(following_params)
36
- @following.actor = current_user.fedipub_actor
37
- authorize @following, policy_class: Fedipub::Client::FollowingPolicy
38
-
39
- save_and_render
40
- end
41
-
42
- # POST /app/followings/follow
43
- # POST /app/followings/follow.json
44
- def follow
45
- authorize Fedipub::Following, policy_class: Fedipub::Client::FollowingPolicy
46
-
47
- begin
48
- @following = Following.new_from_account following_account_params, actor: current_user.fedipub_actor
49
- rescue ::ActiveRecord::RecordNotFound
50
- # Renders a 422 instead of a 404
51
- respond_to do |format|
52
- format.html { redirect_to fedipub.client_actors_url, alert: I18n.t('controller.followings.follow.error') }
53
- format.json { render json: { target_actor: ['does not exist'] }, status: Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT }
54
- end
55
-
56
- return
57
- end
58
-
59
- save_and_render
60
- end
61
-
62
- # DELETE /app/followings/1
63
- # DELETE /app/followings/1.json
64
- def destroy
65
- @following.destroy
66
- respond_to do |format|
67
- format.html { redirect_to fedipub.client_actor_url(@following.actor), notice: I18n.t('controller.followings.destroy.success') }
68
- format.json { head :no_content }
69
- end
70
- end
71
-
72
- private
73
-
74
- # Use callbacks to share common setup or constraints between actions.
75
- def set_following
76
- @following = Following.find_param(params[:id])
77
- authorize @following, policy_class: Fedipub::Client::FollowingPolicy
78
- end
79
-
80
- # Only allow a list of trusted parameters through.
81
- def following_params
82
- params.require(:following).permit(:target_actor_id)
83
- end
84
-
85
- def following_account_params
86
- params.require(:account)
87
- end
88
-
89
- def save_and_render # rubocop:disable Metrics/AbcSize
90
- url = fedipub.client_actor_url current_user.fedipub_actor
91
-
92
- respond_to do |format|
93
- if @following.save
94
- format.html { redirect_to url, notice: I18n.t('controller.followings.save_and_render.success') }
95
- format.json { render :show, status: :created, location: @following }
96
- else
97
- format.html { redirect_to url, alert: I18n.t('controller.followings.save_and_render.error') }
98
- format.json { render json: @following.errors, status: Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT }
99
- end
100
- end
101
- end
102
- end
103
- end
104
- end
105
- end
@@ -1,11 +0,0 @@
1
- module Fedipub
2
- module Rails
3
- class ClientController < Fedipub.configuration.base_client_controller.constantize
4
- include Pundit::Authorization
5
-
6
- after_action :verify_authorized
7
-
8
- layout Fedipub.configuration.app_layout if Fedipub.configuration.app_layout
9
- end
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- module Fedipub
2
- module Client
3
- class ActivityPolicy < Fedipub::FedipubPolicy
4
- def feed?
5
- user_with_actor?
6
- end
7
- end
8
- end
9
- end
@@ -1,15 +0,0 @@
1
- module Fedipub
2
- module Client
3
- class ActorPolicy < Fedipub::FedipubPolicy
4
- def lookup?
5
- true
6
- end
7
-
8
- class Scope < Scope
9
- def resolve
10
- scope
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,35 +0,0 @@
1
- module Fedipub
2
- module Client
3
- class FollowingPolicy < Fedipub::FedipubPolicy
4
- def show?
5
- in_following?
6
- end
7
-
8
- def destroy?
9
- in_following?
10
- end
11
-
12
- def accept?
13
- in_following? && @record.target_actor_id == @user.fedipub_actor.id
14
- end
15
-
16
- def follow?
17
- create?
18
- end
19
-
20
- class Scope < Scope
21
- def resolve
22
- scope.with_actor(@user.fedipub_actor)
23
- end
24
- end
25
-
26
- private
27
-
28
- def in_following?
29
- return false unless user_with_actor?
30
-
31
- @record.actor_id == @user.fedipub_actor&.id || @record.target_actor_id == @user.fedipub_actor&.id
32
- end
33
- end
34
- end
35
- end
@@ -1,5 +0,0 @@
1
- <div>
2
- <b><%= link_to activity.actor.name, fedipub.client_actor_url(activity.actor) %></b>
3
- <code><%= activity.action %></code>
4
- <!-- < %= link_to activity.entity_type, activity.entity %>-->
5
- </div>
@@ -1 +0,0 @@
1
- json.extract! activity, :id, :entity_id, :entity_type, :action, :actor_id, :created_at
@@ -1 +0,0 @@
1
- json.array! @activities, partial: 'fedipub/rails/client/activities/activity', as: :activity
@@ -1,11 +0,0 @@
1
- <h1>Your feed</h1>
2
- <p>
3
- This is the list of activities from actors you follow.
4
- </p>
5
-
6
- <% if @activities.size.zero? %>
7
- <p>There is nothing to display. Start following things!</p>
8
- <% end %>
9
- <% @activities.each do |activity| %>
10
- <%= render 'activity', activity: activity %>
11
- <% end %>
@@ -1 +0,0 @@
1
- json.partial! 'fedipub/rails/client/activities/index'
@@ -1,5 +0,0 @@
1
- <h1>Listing activities</h1>
2
-
3
- <% @activities.each do |activity| %>
4
- <%= render 'activity', activity: activity %>
5
- <% end %>
@@ -1 +0,0 @@
1
- json.partial! 'fedipub/rails/client/activities/index'
@@ -1,18 +0,0 @@
1
- json.extract! actor,
2
- :id,
3
- :name,
4
- :federated_url,
5
- :username,
6
- :inbox_url,
7
- :shared_inbox_url,
8
- :outbox_url,
9
- :followers_url,
10
- :followings_url,
11
- :profile_url,
12
- :at_address,
13
- :local,
14
- :entity_id,
15
- :entity_type,
16
- :tombstoned_at,
17
- :created_at,
18
- :updated_at
@@ -1,5 +0,0 @@
1
- <%= form_tag fedipub.lookup_client_actors_url, method: :get do %>
2
- <%= label_tag :account %>
3
- <%= text_field_tag :account, nil, placeholder: 'user@domain.tld or username', required: true %>
4
- <%= submit_tag 'Search' %>
5
- <% end %>
@@ -1 +0,0 @@
1
- <%= t('.gone') %>
@@ -1,44 +0,0 @@
1
- <h1>Listing actors</h1>
2
-
3
- <section>
4
- Filters:
5
- <% if params[:local_only] %>
6
- <%= link_to 'All actors', fedipub.client_actors_url %>
7
- <% else %>
8
- <%= link_to 'Only local actors', fedipub.client_actors_url(local_only: true) %>
9
- <% end %>
10
- </section>
11
-
12
- <table>
13
- <thead>
14
- <tr>
15
- <th>Name</th>
16
- <th>Username</th>
17
- <th>Federation address</th>
18
- <th>Local?</th>
19
- <th></th>
20
- </tr>
21
- </thead>
22
- <tbody>
23
- <% if @actors.size.zero? %>
24
- <tr>
25
- <td colspan="5">There are no actors to display</td>
26
- </tr>
27
- <% end %>
28
- <% @actors.each do |actor| %>
29
- <tr>
30
- <td>
31
- <% if actor.tombstoned? %>
32
- <del><%= actor.name %></del>
33
- <% else %>
34
- <%= actor.name %>
35
- <% end %>
36
- </td>
37
- <td><%= actor.username %></td>
38
- <td><%= actor.at_address %></td>
39
- <td><%= actor.local? %></td>
40
- <td><%= link_to 'Show', fedipub.client_actor_url(actor) %></td>
41
- </tr>
42
- <% end %>
43
- </tbody>
44
- </table>
@@ -1 +0,0 @@
1
- json.array! @actors, partial: 'fedipub/rails/client/actors/actor', as: :actor
@@ -1,117 +0,0 @@
1
- <h1><%= @actor.name %></h1>
2
-
3
- <section>
4
- <%= render 'fedipub/rails/client/followings/follow_actions', user: current_user, actor: @actor %>
5
- </section>
6
-
7
- <section>
8
- <% if @actor.local? %>
9
- <%= link_to 'All activities', fedipub.client_actor_activities_path(@actor) %>
10
- <% elsif @actor.profile_url %>
11
- <%= link_to 'Visit profile', @actor.profile_url %>
12
- <% end %>
13
- </section>
14
-
15
- <section>
16
- <h2>Actor details</h2>
17
-
18
- <p>
19
- <b>Federated url:</b>
20
- <%= @actor.federated_url %>
21
- </p>
22
-
23
- <p>
24
- <b>Username:</b>
25
- <%= @actor.username %>
26
- </p>
27
-
28
- <p>
29
- <b>Inbox URL:</b>
30
- <%= @actor.inbox_url %>
31
- </p>
32
-
33
- <p>
34
- <b>Outbox URL:</b>
35
- <%= @actor.outbox_url %>
36
- </p>
37
-
38
- <p>
39
- <b>Shared Inbox URL:</b>
40
- <%= @actor.shared_inbox_url %>
41
- </p>
42
-
43
- <p>
44
- <b>Followers URL:</b>
45
- <%= @actor.followers_url %>
46
- </p>
47
-
48
- <p>
49
- <b>Followings URL:</b>
50
- <%= @actor.followings_url %>
51
- </p>
52
-
53
- <p>
54
- <b>Profile url:</b>
55
- <% if @actor.profile_url %>
56
- <%= link_to 'Profile', @actor.profile_url %>
57
- <% end %>
58
- </p>
59
-
60
- <p>
61
- <b>Federation address:</b>
62
- <%= @actor.at_address %>
63
- </p>
64
-
65
- <p>
66
- <% if @actor.local? && @actor.entity_configuration[:profile_url_method] %>
67
- <b>Home page:</b>
68
- <%= link_to @actor.entity.send(@actor.entity_configuration[:username_field]),
69
- ::Rails.application.routes.url_helpers.send(@actor.entity_configuration[:profile_url_method], @actor.entity)
70
- %>
71
- <% elsif @actor.profile_url %>
72
- <b>Federation profile URL (JSON):</b>
73
- <%= link_to @actor.name, @actor.profile_url %>
74
- <% else %>
75
- (No homepage)
76
- <% end %>
77
- </p>
78
- </section>
79
-
80
- <hr>
81
-
82
- <section>
83
- <h2>Follows <small>(<em>Who is followed?</em>)</small></h2>
84
-
85
- <% if @actor.following_follows.size.zero? %>
86
- <p><%= @actor.username %> follows nothing</p>
87
- <% end %>
88
-
89
- <% @actor.following_follows.each do |following| %>
90
- <%= render 'fedipub/rails/client/followings/follow', following: following %>
91
- <% end %>
92
- </section>
93
-
94
- <section>
95
- <h2>Followers <small>(<em>Who follows?</em>)</small></h2>
96
-
97
- <% if @actor.following_followers.size.zero? %>
98
- <p>Nothing follows <%= @actor.username %></p>
99
- <% end %>
100
-
101
- <% @actor.following_followers.each do |following| %>
102
- <%= render 'fedipub/rails/client/followings/follower', following: following %>
103
- <% end %>
104
- </section>
105
-
106
- <section>
107
- <%# FIXME: Fetch distant content somehow %>
108
- <h2>10 last activities</h2>
109
-
110
- <% activities = @actor.activities.last(10) %>
111
- <% if activities.size.zero? %>
112
- <p>No activity to display</p>
113
- <% end %>
114
- <% activities.each do |activity| %>
115
- <%= render 'fedipub/rails/client/activities/activity', activity: activity %>
116
- <% end %>
117
- </section>
@@ -1 +0,0 @@
1
- json.partial! 'fedipub/rails/client/actors/actor', actor: @actor
@@ -1,26 +0,0 @@
1
- Federation:
2
-
3
- <ul>
4
- <%# Available publicly %>
5
- <li><%= link_to 'Actors', fedipub.client_actors_url %></li>
6
- <li><%= link_to 'Activities', fedipub.client_activities_url %></li>
7
-
8
- <%# Available when user has an associated actor %>
9
- <% if Fedipub::Client::ActivityPolicy.new(user, nil).feed? %>
10
- <li><%= link_to 'Feed', fedipub.client_feed_url %></li>
11
- <%end %>
12
-
13
- <%# Available when user has an associated actor. The actor must exist to create the link %>
14
- <% if Fedipub.actor_entity?(user) && user.fedipub_actor.present? %>
15
- <li><%= link_to "You (#{user.fedipub_actor.username})", fedipub.client_actor_path(user.fedipub_actor) %></li>
16
- <% end %>
17
- </ul>
18
-
19
- <%# Debug information%>
20
- <% if !user %>
21
- Register or login to view your actor's information
22
- <% elsif !Fedipub::actor_entity?(user) %>
23
- <p><%= user.class.name %> is not configured to have an associated actor; you won't be allowed to follow or be followed</p>
24
- <% elsif !user.fedipub_actor.present? %>
25
- <p>Your account does not have an associated actor; you won't be allowed to follow or be followed</p>
26
- <% end %>
@@ -1,4 +0,0 @@
1
- <div>
2
- <b><%= link_to following.target_actor.name, fedipub.client_actor_url(following.target_actor) %></b>
3
- (<%= following.target_actor.at_address %>) (<%= following.status %>)
4
- </div>