Add media management

This commit is contained in:
2023-05-07 20:47:42 +10:00
parent 067eb3f848
commit 31beb9cbc6
7 changed files with 60 additions and 7 deletions

View File

@@ -0,0 +1,16 @@
module Admin
module Views
module Photos
class Index < Admin::View
MEDIA_DIR = "public/media/".freeze
expose :photos_buckets do
Dir["#{MEDIA_DIR}*"].each_with_object({}) do |root, memo|
memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"]
end
end
end
end
end
end