diff --git a/app/controllers/splash_controller.rb b/app/controllers/splash_controller.rb index 0759fb7a..dcf3be8c 100644 --- a/app/controllers/splash_controller.rb +++ b/app/controllers/splash_controller.rb @@ -1,5 +1,16 @@ # frozen_string_literal: true class SplashController < ProprietorController - def index; end + def index + @accounts = Account.where('is_public = ?', true).order(cname: :asc) + @images = [] + @alt_text = [] + @accounts.map do |account| + Apartment::Tenant.switch(account.tenant) do + @images << Site.instance&.directory_image&.url(:medium) || + "https://via.placeholder.com/400?text=#{account.cname}" + @alt_text << Site.instance || account.cname + end + end + end end diff --git a/app/views/splash/index.html.erb b/app/views/splash/index.html.erb index 6c8088d4..39c43b6d 100644 --- a/app/views/splash/index.html.erb +++ b/app/views/splash/index.html.erb @@ -10,25 +10,18 @@