<% title "#{community_name} Sponsors" %>

<%= content_for :page_meta do %>
  <link rel="canonical" href="<%= app_url("/sponsors") %>" />
  <meta name="description" content="<%= community_name %> | Sponsors">
  <meta name="keywords" content="software development,engineering,rails,javascript,ruby">
<% end %>

<div class="blank-space"></div>

<style>
  .container .body h4 img {
    top: 10px;
    display: inline;
    left: 0;
  }
  .sponsor-level-headline {
    padding:5px 18px;
    border-radius: 3px;
  }
</style>

<div class="container article">
  <div class="title" style="height:20px;">
  </div>
  <div class="body" style="text-align:center;">
    <h1 style="font-size:3em;font-weight:600;margin-bottom:5px;">
      THANK YOU
    </h1>
    <p style="margin:5px 5px;"><em>for supporting our community</em></p>

    <h4>
      <img src="<%= cloudinary("https://thepracticaldev.s3.amazonaws.com/i/2zmukvll98je8qsdyewq.png", 30) %>" alt="golden badge">
      <span class="sponsor-level-headline" style="background-color: #fefa87;">Gold Sponsors</span>
      <img src="<%= cloudinary("https://thepracticaldev.s3.amazonaws.com/i/2zmukvll98je8qsdyewq.png", 30) %>" alt="golden badge">
    </h4>
    <div id="gold-sponsors">
      <% Sponsorship.gold.live.includes(:organization).order(featured_number: :asc).each do |sponsorship| %>
        <a href="<%= sponsorship.url %>"><%= render "sponsor_image", sponsorship: sponsorship %></a>
        <p>
          <%= sponsorship.blurb_html&.html_safe %>
        </p>
        <hr />
      <% end %>
    </div>

    <h4>
      <img src="<%= cloudinary("https://thepracticaldev.s3.amazonaws.com/i/2zmukvll98je8qsdyewq.png", 30) %>" alt="silver badge">
      <span class="sponsor-level-headline" style="background-color: #d8e1f0;">Silver Sponsors</span>
      <img src="<%= cloudinary("https://thepracticaldev.s3.amazonaws.com/i/2zmukvll98je8qsdyewq.png", 30) %>" alt="silver badge">
    </h4>
    <div id="silver-sponsors">
      <% Sponsorship.where(status: "live", level: "silver").where("expires_at > ?", Time.current).includes(:organization).order(featured_number: :asc).each do |sponsorship| %>
        <a href="<%= sponsorship.url %>"><%= render "sponsor_image", sponsorship: sponsorship %></a>
        <p>
          <%= sponsorship.blurb_html&.html_safe %>
        </p>
        <hr />
      <% end %>
    </div>

    <h4>
      <img src="<%= cloudinary("https://thepracticaldev.s3.amazonaws.com/i/2zmukvll98je8qsdyewq.png", 30) %>" alt="bronze badge">
      <span class="sponsor-level-headline" style="background-color: #fcd6bb;">Bronze Sponsors</span>
      <img src="<%= cloudinary("https://thepracticaldev.s3.amazonaws.com/i/2zmukvll98je8qsdyewq.png", 30) %>" alt="bronze badge">
    </h4>
    <div id="bronze-sponsors">
      <% Sponsorship.bronze.live.where("expires_at > ?", Time.current).includes(:organization).order(featured_number: :asc).find_each do |sponsorship| %>
        <a href="<%= sponsorship.url %>"><%= render "sponsor_image", sponsorship: sponsorship %></a>
        <hr />
      <% end %>
    </div>

    <h5>Interested in sponsoring <%= community_name %>? Check out our <a href="<%= app_url("/partnerships") %>">partnerships</a> page.</h5>
  </div>
</div>
