Skip to content

Commit

Permalink
sponsor logo links now display on welcome page
Browse files Browse the repository at this point in the history
  • Loading branch information
cnandes committed Oct 31, 2023
1 parent 107d991 commit 0168b78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ class PagesController < ApplicationController

expose(:complex_view?) { COMPLEX_VIEWS.include? params[:id] }

expose(:sponsors) do
YAML.load_file Rails.root.join('config/data/sponsors.yml')
end

rescue_from ActionView::MissingTemplate do |exception|
if exception.message.match?(/Missing template pages#{request.path}/)
raise ActionController::RoutingError, "No such page: #{params[:id]}"
Expand Down
19 changes: 17 additions & 2 deletions app/views/pages/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<a href="#about" class="cta">About Us</a>
</article>

<div class="divider-2" style="background-image: url(<%= asset_url('roro-pattern.png') %>)">&nbsp;</div>
<div class="divider-1" style="background-image: url(<%= asset_url('roro-pattern.png') %>)">&nbsp;</div>

<article id="in-person" class="welcome md:ml-10">
<h2>Meeting in Person</h2>
Expand All @@ -62,7 +62,7 @@
</ul>
</article>

<div class="divider-3" style="background-image: url(<%= asset_url('roro-pattern.png') %>)">&nbsp;</div>
<div class="divider-2" style="background-image: url(<%= asset_url('roro-pattern.png') %>)">&nbsp;</div>

<article id="online" class="welcome md:ml-10">
<h2>Connecting Online</h2>
Expand All @@ -76,6 +76,21 @@
</p>
</article>

<div class="divider-3" style="background-image: url(<%= asset_url('roro-pattern.png') %>)">&nbsp;</div>

<article id="sponsors" class="welcome md:ml-10">
<h2>Sponsors</h2>
<div class="flex flex-wrap">
<% sponsors.each do |sponsor| %>
<div class="m-6">
<%= link_to "/sponsors/#{sponsor['key']}" do %>
<%= image_tag "sponsors/#{sponsor['images'].first}", alt: sponsor['name'], style: "width: 150px" %>
<% end %>
</div>
<% end %>
</div>
</article>

<div class="divider-4" style="background-image: url(<%= asset_url('roro-pattern.png') %>)">&nbsp;</div>

<article id="about" class="welcome md:ml-10">
Expand Down

0 comments on commit 0168b78

Please sign in to comment.