Add replies to posts

This commit is contained in:
2024-03-22 08:48:21 +11:00
parent 6a5ff26948
commit a2c11de10f
12 changed files with 55 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ module Main
module Views
module Posts
class Show < Main::View
include Deps["repos.post_repo", "repos.movie_repo"]
include Deps["repos.post_repo", "repos.movie_repo", "settings"]
expose :post do |slug:|
Decorators::Posts::Decorator.new(post_repo.fetch!(slug))
@@ -35,6 +35,13 @@ module Main
expose :trip do |post|
post.trips.first
end
expose :reply_in_context do |post|
if post.in_reply_to&.match settings.micropub_site_url
slug = post.in_reply_to.split("/").last
Decorators::Posts::Decorator.new(post_repo.fetch(slug))
end
end
end
end
end