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 @@
-

Browse our partner repositories:

-
-
- <%= link_to "//#{host_for('rim')}" do %> - <%= image_tag("home-logos/rim_atla.png", class: "tenant-logo", alt: "RIM") %> - <% end %> -
-
- <%= link_to "//#{host_for('ctschicago')}" do %> - <%= image_tag("home-logos/ctschicago.png", class: "tenant-logo", alt: "CTS") %> - <% end %> -
-
- <%= link_to "//#{host_for('ost')}" do %> - <%= image_tag("home-logos/ost.png", class: "tenant-logo", alt: "OST") %> +
+ <% @accounts.each_with_index do |account, i| %> +
+ <% if @images[i].present? && !@images[i].match(/placeholder/) %> + <%= link_to "//#{account.cname}" do %> + <%= image_tag @images[i], class: 'logo-image' %> + <% end %> + <% end %> +
<% end %> -
-
+
<%= link_to "//#{host_for('shared-search')}/catalog" do %> <% end %> diff --git a/app/views/themes/shared_repository/splash/_index.html.erb b/app/views/themes/shared_repository/splash/_index.html.erb index c8e011d5..8434e489 100644 --- a/app/views/themes/shared_repository/splash/_index.html.erb +++ b/app/views/themes/shared_repository/splash/_index.html.erb @@ -13,14 +13,9 @@

Browse our partner repositories:

-
- <%= link_to "//#{host_for('rim')}" do %> - <%= image_tag("home-logos/rim_atla.png", class: "tenant-logo", alt: "RIM") %> - <% end %> -
<%= link_to "//#{host_for('ctschicago')}" do %> - <%= image_tag("home-logos/ctschicago.png", class: "tenant-logo", alt: "CTS") %> + <%= image_tag("home-logos/ctschicago.png", class: "tenant-logo", alt: "CTSChicago") %> <% end %>
@@ -28,6 +23,11 @@ <%= image_tag("home-logos/ost.png", class: "tenant-logo", alt: "OST") %> <% end %>
+
+ <%= link_to "//#{host_for('rim')}" do %> + <%= image_tag("home-logos/rim_atla.png", class: "tenant-logo", alt: "RIM") %> + <% end %> +