Skip to content

Commit

Permalink
added tenant logos using directory image to splash page
Browse files Browse the repository at this point in the history
  • Loading branch information
Christy Karpinski authored and Christy Karpinski committed Aug 3, 2023
1 parent d8df909 commit 6d7b74a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
12 changes: 11 additions & 1 deletion app/controllers/splash_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 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
27 changes: 10 additions & 17 deletions app/views/splash/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,18 @@
</div>

<div class="col-sm-6 right-side">

<h2>Browse our partner repositories:</h2>
<div class="row home-logo-grid">
<div class="col-xs-6 col-sm-4">
<%= link_to "//#{host_for('rim')}" do %>
<%= image_tag("home-logos/rim_atla.png", class: "tenant-logo", alt: "RIM") %>
<% end %>
</div>
<div class="col-xs-6 col-sm-4">
<%= link_to "//#{host_for('ctschicago')}" do %>
<%= image_tag("home-logos/ctschicago.png", class: "tenant-logo", alt: "CTS") %>
<% end %>
</div>
<div class="col-xs-6 col-sm-4">
<%= link_to "//#{host_for('ost')}" do %>
<%= image_tag("home-logos/ost.png", class: "tenant-logo", alt: "OST") %>
<div class="row home-logo-grid">
<% @accounts.each_with_index do |account, i| %>
<div class="col-xs-6 col-sm-4">
<% if @images[i].present? && !@images[i].match(/placeholder/) %>
<%= link_to "//#{account.cname}" do %>
<%= image_tag @images[i], class: 'logo-image' %>
<% end %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
<%= link_to "//#{host_for('shared-search')}/catalog" do %>
<button class="shared-search">Search All Repositories</button>
<% end %>
Expand Down
12 changes: 6 additions & 6 deletions app/views/themes/shared_repository/splash/_index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
<div class="splash-browse">
<h2>Browse our partner repositories:</h2>
<div class="row home-logo-grid">
<div class="col-xs-6 col-sm-4">
<%= link_to "//#{host_for('rim')}" do %>
<%= image_tag("home-logos/rim_atla.png", class: "tenant-logo", alt: "RIM") %>
<% end %>
</div>
<div class="col-xs-6 col-sm-4">
<%= 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 %>
</div>
<div class="col-xs-6 col-sm-4">
<%= link_to "//#{host_for('ost')}" do %>
<%= image_tag("home-logos/ost.png", class: "tenant-logo", alt: "OST") %>
<% end %>
</div>
<div class="col-xs-6 col-sm-4">
<%= link_to "//#{host_for('rim')}" do %>
<%= image_tag("home-logos/rim_atla.png", class: "tenant-logo", alt: "RIM") %>
<% end %>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 6d7b74a

Please sign in to comment.