docbrown/app/views/articles/_sidebar.html.erb
Ridhwana 586703f9b7
[deploy] Cleanup some more dev.to generalisation (#7263)
* feat: rename ApplicationConfig[COMMUNITY_NAME] to just community_name

* refactor: use the method name defined in the file

* chore: use community name on the information template

* refactor: move the social media links into a partial

* chore: reuse the css

* chore: update the partners page

* chore: make the code-of conduct DEV related vars dynamic

* feat: update the code of conduct

* feat: first pass at the editor guide

* feat: update more templates (maybe this one should go?)

* feat: update the tags page

* feat: set configurable email

* feat: article urls updated to be dynamic

* feat: add comment

* feat: update rss guide to use local dev

* chore: revert hashtag as it will come from https://github.com/thepracticaldev/dev.to/issues/7254

* chore: string interpolation

* feat: add the code for the svg resizing on the information page.
2020-04-14 21:30:13 -04:00

58 lines
2.5 KiB
Text

<div id="sidebar-wrapper-left" class="sidebar-wrapper sidebar-wrapper-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: 5.days) do %>
<%= render "articles/sidebar_nav" %>
<div class="widget widget-sponsorship <%= "showing" unless user_signed_in? %>" id="sponsorship-widget">
<header>
<a href="/sponsors"><h4>Community sponsors</h4></a>
<span class="emoji">
<img src="<%= asset_path "emoji/emoji-one-heart.png" %>" alt="emoji heart" />
</span>
</header>
<% @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="widget-body">
<% @sponsorships.each do |sponsorship| %>
<%= render "articles/single_sponsor", sponsorship: sponsorship %>
<% end %>
<div class="sidebar-sponsor--footer">
We are grateful for wonderful sponsors who help sustain the <%= community_qualified_name %>.<br>
<a href="/sponsorship-info">Sponsorship Info/Policy</a>
</div>
</div>
<% end %>
</div>
<div class="widget">
<header>
<h4>Key links</h4>
</header>
<div class="widget-body social-icons">
<%= render partial: "layouts/social_media" %>
</div>
<div class="side-footer">
<a href="/about">About</a>
<a href="/sponsors">Sponsors</a>
<a href="https://shop.dev.to/"><%= community_name %> Shop</a>
<a href="/privacy">Privacy Policy</a>
<a href="/terms">Terms of Use</a>
<a href="/contact">Contact</a>
<a href="/faq">FAQ</a>
<a href="/code-of-conduct">Code of Conduct</a>
</div>
</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="widget" id="sponsorship-arbitrary-display-widget" data-id="<%= @left_sidebar_ad.id %>">
<div class="widget-body widget-body--sponsorship-arbitrary">
<%= @left_sidebar_ad.processed_html.html_safe %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>