Refactor app in to its own slice

This commit is contained in:
2024-02-17 10:40:36 +11:00
parent b809b132d3
commit a6078f882e
161 changed files with 16176 additions and 193 deletions

View File

@@ -0,0 +1,19 @@
module Main
module Views
module Bookmarks
class Index< Main::View
include Deps["repos.post_repo"]
expose :bookmarks do |query:|
post_repo.bookmark_listing(query: query).map do |bookmark|
Decorators::Bookmarks::Decorator.new bookmark
end
end
expose :q do |query:|
query
end
end
end
end
end

View File

@@ -0,0 +1,30 @@
require "ogpr"
module Main
module Views
module Bookmarks
class Metadata< Main::View
include Deps["repos.post_repo"]
config.layout = nil
expose :description do |og_data|
og_data.description
end
expose :title do |og_data|
og_data.title
end
expose :image do |og_data|
og_data.image
end
private_expose :og_data do |id:|
url = post_repo.find!(id).url
Ogpr.fetch(url)
end
end
end
end
end

View File

@@ -0,0 +1,13 @@
module Main
module Views
module Bookmarks
class Show< Main::View
include Deps["repos.post_repo"]
expose :bookmark do |slug:|
Decorators::Bookmarks::Decorator.new(post_repo.fetch!(slug))
end
end
end
end
end