Add photos

This commit is contained in:
2023-02-25 14:11:34 +11:00
parent a5e2cf28c8
commit e8220805a3
5 changed files with 39 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
module Adamantium
module Actions
module Photos
class Index < Action
include Deps["views.photos.index"]
def handle(req, res)
res.render index
end
end
end
end
end

View File

@@ -1,2 +1,4 @@
Hi! 👋 I'm Daniel, a software engineer living in Canberra, Australia.
Welcome to my personal site! This is where I post the things I have [written](/posts), the [photos](/photos) I have taken, the [bookmarks](/bookmarks) I have saved, and the [places](/places) I have been.

View File

@@ -64,7 +64,7 @@ module Adamantium
def photo_listing(limit: nil)
posts
.where(post_type: "post")
.where(post_type: ["post", "checkin"])
.where(Sequel[:photos].pg_json.array_length > 0)
.published
.combine(:tags)

View File

@@ -0,0 +1,8 @@
div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200"
h1 Photos
div class="grid grid-cols-3 gap-4 mb-4 max-w-prose mx-auto"
- photos.each do |post|
== render :photo_post, post: post
div class="max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600"

15
app/views/photos/index.rb Normal file
View File

@@ -0,0 +1,15 @@
module Adamantium
module Views
module Photos
class Index < Adamantium::View
include Deps["repos.post_repo"]
expose :photos do
post_repo.photo_listing.map do |post|
Decorators::Posts::Decorator.new(post)
end
end
end
end
end
end