Add trips

This commit is contained in:
2023-05-09 21:51:44 +10:00
parent ebdf051b82
commit 7988ffc76d
37 changed files with 651 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
module Admin
module Views
module Trips
class Index < Admin::View
include Deps["repos.trip_repo"]
expose :trips do
trip_repo.list
end
end
end
end
end

View File

@@ -0,0 +1,11 @@
module Admin
module Views
module Trips
class New < Admin::View
expose :errors do
nil
end
end
end
end
end

View File

@@ -0,0 +1,18 @@
module Admin
module Views
module Trips
class Show < Admin::View
include Deps["repos.trip_repo", "repos.post_repo"]
expose :trip do |id:|
trip_repo.fetch(id)
end
expose :posts do |trip|
post_repo.created_between(trip.start_date, trip.end_date)
end
end
end
end
end