191 lines
7.9 KiB
Text
191 lines
7.9 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">
|
|
<% if @user && @user.class.name == "User" %>
|
|
<% @user.github_repos.where(featured: true).order({stargazers_count: :desc}, {name: :asc}).each do |repo| %>
|
|
<a class="widget" href="<%= repo.url %>" target="_blank">
|
|
<header>
|
|
<span class="emoji"><img src="<%= asset_path("github-logo.svg") %>" /></span><%= repo.name %>
|
|
</header>
|
|
<div class="widget-body">
|
|
<%= repo.description %>
|
|
<div class="widget-footer">
|
|
<% if repo.fork %>
|
|
<span class="widget-accent">fork</span>
|
|
<% end %>
|
|
<%= repo.language %>
|
|
<% if repo.stargazers_count > 0 %>
|
|
<img src="<%= asset_path("star.svg") %>" /> <%= repo.stargazers_count %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
<% end %>
|
|
<% if @user.badge_achievements_count > 0 %>
|
|
<%= render "articles/badges_area" %>
|
|
<% end %>
|
|
<% elsif @user && @user.class.name == "Organization" %>
|
|
<% elsif @tag %>
|
|
<% if Article.active_threads([@tag,"discuss"], Timeframer.new(params[:timeframe]).datetime).any? %>
|
|
<div class="widget">
|
|
<header>
|
|
#discuss
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.active_threads([@tag,"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>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if user_signed_in? %>
|
|
<%= javascript_pack_tag "sidebarWidget", defer: true %>
|
|
<div id="sidebarWidget__pack" data-tag-info="<%= @tag_model.attributes.slice("id", "text_color_hex", "bg_color_hex", "name").to_json %>">
|
|
</div>
|
|
<% end %>
|
|
<% elsif @query %>
|
|
<% elsif @podcast_index %>
|
|
<% else %>
|
|
<% unless user_signed_in? %>
|
|
<div class="widget signin-cta-widget">
|
|
<header>
|
|
DEV.TO(GETHER)
|
|
</header>
|
|
<div class="widget-body">
|
|
<center style="margin-bottom: 2px;">
|
|
<a href="/users/auth/twitter?state=navbar_basic" class="cta cta-button login-cta-button" data-no-instant>
|
|
SIGN IN VIA TWITTER
|
|
</a>
|
|
<a href="/users/auth/github?state=navbar_basic" class="cta cta-button login-cta-button" data-no-instant>
|
|
SIGN IN VIA GITHUB
|
|
</a>
|
|
</center>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if @sidebar_ad %>
|
|
<div class="widget">
|
|
<div class="widget-body" style="margin-top:-6px">
|
|
<%= @sidebar_ad.processed_html.html_safe %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if Flipflop.she_coded? %>
|
|
<div class="widget">
|
|
<header>
|
|
<#SHECODED>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% Article.
|
|
where(published: true, approved: true).
|
|
tagged_with(["shecoded", "theycoded"], any: true).
|
|
order("published_at DESC").
|
|
limit(100).
|
|
pluck(:path, :title, :comments_count, :created_at).
|
|
each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: false %>
|
|
<% end %>
|
|
</div>
|
|
<p><center><a class="cta cta-button" href="/t/shecoded" style="color: white; background: #8a62b4;">VIEW ALL #SHECODED</a></center></p>
|
|
<p><center><a class="cta cta-button" href="/new/shecoded" style="color: white; background: #8a62b4;">SUBMIT YOUR STORY</a></center></p>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% if Article.active_help.any? %>
|
|
<div class="widget">
|
|
<header>
|
|
<a href="/t/help">#help</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">#ama</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">#challenge</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">#discuss</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">#explainlikeimfive</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" id="podcast-widget">
|
|
<header>
|
|
<a href="/pod">latest podcasts</pod>
|
|
</header>
|
|
<div class="widget-body">
|
|
<% @podcast_episodes.each do |ep| %>
|
|
<div class="widget-podcast-ep">
|
|
<a href="<%= ep.path %>"><%= ep.title %>
|
|
<div class="widget-podcast-title">
|
|
<a href="<%= ep.podcast.path %>"><%= ep.podcast.title %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<a class="cta cta-button" href="/pod">VIEW ALL</a>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|