167 lines
7.2 KiB
Text
167 lines
7.2 KiB
Text
<div id="sidebar-wrapper-right" class="sidebar-wrapper sidebar-wrapper-right">
|
|
<div class="sidebar-bg" id="sidebar-bg-right"></div>
|
|
<div class="side-bar sidebar-additional showing" id="sidebar-additional">
|
|
<% unless user_signed_in? %>
|
|
<div class="widget signin-cta-widget">
|
|
<header class="signin-cta-widget-header">
|
|
Join <%= ApplicationConfig["COMMUNITY_NAME"] %>
|
|
</header>
|
|
<div class="widget-body">
|
|
<center style="margin-bottom: 2px;">
|
|
<a href="/users/auth/twitter?callback_url=<%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %>/users/auth/twitter/callback" class="cta cta-button login-cta-button" data-no-instant>
|
|
Sign In With Twitter
|
|
</a>
|
|
<a href="/users/auth/github?state=navbar_basic" class="cta cta-button login-cta-button" data-no-instant>
|
|
Sign In With GitHub
|
|
</a>
|
|
</center>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% cache("main-article-right-sidebar-discussions-#{params[:timeframe]}", expires_in: (params[:timeframe].blank? ? 120 : 360).seconds) do %>
|
|
<% @sidebar_ad = DisplayAd.where(approved: true, published: true, placement_area: "sidebar_right").order(Arel.sql("RANDOM()")).first %>
|
|
<% if @sidebar_ad %>
|
|
<div class="widget">
|
|
<div class="widget-body" style="margin-top:-6px">
|
|
<%= @sidebar_ad.processed_html.html_safe %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if Article.active_help.any? %>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/help"><h4>#help</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_help.limit(8).pluck(:path, :title, :comments_count, :created_at).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
</div>
|
|
<a class="cta cta-button" href="/new/help">ASK FOR HELP</a>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if Article.active_threads(["ama"], Timeframer.new(params[:timeframe]).datetime).any? %>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/ama"><h4>#ama</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_threads(["ama"], Timeframer.new(params[:timeframe]).datetime, 5).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
</div>
|
|
<a class="cta cta-button" href="/new/ama">START AN "ASK ME ANYTHING"</a>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if Article.active_threads(["challenge"], Timeframer.new(params[:timeframe]).datetime).any? %>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/challenge"><h4>#challenge</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_threads(["challenge"], Timeframer.new(params[:timeframe]).datetime, 5).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
</div>
|
|
<a class="cta cta-button" href="/new/challenge">CREATE A CHALLENGE</a>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/discuss"><h4>#discuss</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_threads(["discuss"], Timeframer.new(params[:timeframe]).datetime).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
</div>
|
|
<a class="cta cta-button" href="/new/discuss">START A DISCUSSION</a>
|
|
</div>
|
|
</div>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/explainlikeimfive"><h4>#explainlikeimfive</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_eli5(Timeframer.new(params[:timeframe]).datetime).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
</div>
|
|
<a class="cta cta-button" href="/new/explainlikeimfive">ASK FOR AN EXPLANATION</a>
|
|
</div>
|
|
</div>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/healthydebate"><h4>#healthydebate</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_threads(["healthydebate"], Timeframer.new(params[:timeframe]).datetime).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
</div>
|
|
<a class="cta cta-button" href="/new/healthydebate">START A DEBATE</a>
|
|
</div>
|
|
</div>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/meta"><h4>#meta</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_threads(["meta"], Timeframer.new(params[:timeframe]).datetime).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
</div>
|
|
<a class="cta cta-button" href="/new/meta">START A META DISCUSSION</a>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if user_signed_in? %>
|
|
<% cache("featured-homepage-podcasts", expires_in: 15.minutes) do %>
|
|
<div class="widget" id="podcast-widget">
|
|
<header>
|
|
<a href="/pod"><h4>latest podcasts</h4></a>
|
|
</header>
|
|
<div class="widget-body">
|
|
<% @podcast_episodes.each do |ep| %>
|
|
<div class="widget-podcast-ep">
|
|
<a href="<%= ep.path %>"><%= ep.title %></a>
|
|
<div class="widget-podcast-title">
|
|
<a href="<%= ep.podcast.path %>"><%= ep.podcast.title %></a>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<a class="cta cta-button" href="/pod">VIEW ALL</a>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% else %>
|
|
<% cache("seo-boostable-posts-homepage-xoxoxo", expires_in: 18.hours) do %>
|
|
<% @boostable_posts = Article.seo_boostable %>
|
|
<% if @boostable_posts.any? %>
|
|
<div class="widget">
|
|
<header>
|
|
<h4>trending guides/resources</h4>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% @boostable_posts.each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: false %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|