docbrown/app/views/articles/_sidebar.html.erb
ludwiczakpawel 39295c0bea
Layout updates (#8107)
* flare tag line height

* .

* init

* widgets

* widgets lists

* new tabs on home

* instantclick

* .

* rethinking css

* .

* .

* empty space

* campaign widget

* .

* merge

* .

* update layout

* fix sidebars on home page

* .

* fix onboarding x

* spec

* test

* test

* better handling ads

* .

* spec

* card styling

* .

* i dont know what have i broken
2020-06-04 16:12:17 +02:00

32 lines
1.7 KiB
Text

<div id="sidebar-wrapper-left" class="sidebar-wrapper sidebar-wrapper-left crayons-layout__sidebar-left">
<div class="sidebar-bg" id="sidebar-bg-left"></div>
<div class="side-bar">
<% cache(cache_key_heroku_slug("main-sidebar-nav--#{user_signed_in?}"), expires_in: 15.minutes) do %>
<%= render "articles/sidebar_nav" %>
<div class="<%= "hidden" if user_signed_in? %> px-1" id="sponsorship-widget">
<h4 class="flex align-center fs-s ff-accent fw-bold tt-uppercase mb-4">
Community Sponsors
<%= inline_svg_tag("twemoji/heart.svg", aria: true, class: "crayons-icon crayons-icon--default ml-1", title: "Love") %>
</h4>
<% @sponsorships = Sponsorship.gold.live.includes(:organization).order(featured_number: :asc) %>
<%# the pattern .present?/.each has the advantage of issuing only a single SQL query to load objects in memory %>
<% if @sponsorships.present? %>
<div class="grid grid-cols-1 gap-6">
<% @sponsorships.each do |sponsorship| %>
<%= render "articles/single_sponsor", sponsorship: sponsorship %>
<% end %>
<a href="/sponsorships" class="crayons-btn crayons-btn--secondary fs-s">Become a sponsor</a>
</div>
<% end %>
</div>
<% end %>
<% cache("display-area-left-#{rand(5)}", expires_in: 5.minutes) do %>
<% @left_sidebar_ad = DisplayAd.for_display("sidebar_left") %>
<% if @left_sidebar_ad %>
<div class="crayons-sponsorship-widget" id="sponsorship-arbitrary-display-widget" data-id="<%= @left_sidebar_ad.id %>">
<%= @left_sidebar_ad.processed_html.html_safe %>
</div>
<% end %>
<% end %>
</div>
</div>