<% unless user_signed_in? %>

DEV.TO(GETHER)

<%= ApplicationConfig["APP_DOMAIN"] %>/users/auth/twitter/callback" class="cta cta-button login-cta-button" data-no-instant> SIGN IN VIA TWITTER SIGN IN VIA GITHUB
<% end %> <% cache("main-article-right-sidebar-discussions", :expires_in => 90.seconds) do %> <% @sidebar_ad = DisplayAd.where(approved: true, published: true, placement_area: "sidebar").first %> <% if @sidebar_ad %>
<%= @sidebar_ad.processed_html.html_safe %>
<% end %> <% ApplicationConfig["TRENDING_TAGS"].split(",").each do |tag| %>

#<%= tag %>

<% Article.active_threads([tag], Timeframer.new(params[:timeframe]).datetime, 5). each do |plucked_article| %> <%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %> <% end %>
MAKE A #<%= tag.upcase %> POST
<% end %> <% if Article.active_help.any? %>

#help

<% 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 %>
ASK FOR HELP
<% end %> <% if Article.active_threads(["ama"], Timeframer.new(params[:timeframe]).datetime).any? %>

#ama

<% 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 %>
START AN "ASK ME ANYTHING"
<% end %> <% if Article.active_threads(["challenge"], Timeframer.new(params[:timeframe]).datetime).any? %>

#challenge

<% 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 %>
CREATE A CHALLENGE
<% end %>

#discuss

<% 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 %>
START A DISCUSSION

#explainlikeimfive

<% 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 %>
ASK FOR AN EXPLANATION

#healthydebate

<% 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 %>
START A DEBATE

#meta

<% 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 %>
START A META DISCUSSION
<% end %> <% if user_signed_in? %> <% cache("featured-homepage-podcasts", :expires_in => 15.minutes) do %>

latest podcasts

<% @podcast_episodes.each do |ep| %>
<%= ep.title %>
<%= ep.podcast.title %>
<% end %> VIEW ALL
<% end %> <% else %> <% cache("seo-boostable-posts-homepage", :expires_in => 18.hours) do %> <% @boostable_posts = Article.seo_boostable %> <% if @boostable_posts.any? %>

trending guides/resources

<% @boostable_posts.first(12). each do |plucked_article| %> <%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: false %> <% end %>
<% end %> <% end %> <% end %>