205 lines
8.6 KiB
Text
205 lines
8.6 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" style="font-size:0.85em;">
|
|
<%= 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 Reaction.for_display(@user).size > 0 %>
|
|
<div class="widget">
|
|
<header>
|
|
<RECENT REACTIONS>
|
|
</header>
|
|
<div class="widget-body">
|
|
<% Reaction.for_display(@user).each do |reaction| %>
|
|
<div class="row">
|
|
<div class="key">
|
|
<%= image_tag(ReactionImage.new(reaction.category).path, style:"height:22px;width:22px;border:0px;vertical-align:5px;") %>
|
|
</div>
|
|
<div class="value" style="padding:5px 2px 0px 10px;">
|
|
<a href="<%= reaction.reactable.path %>"><%= reaction.reactable.title %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% 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 %>
|
|
<%= javascript_pack_tag "sidebarWidget", defer: true %>
|
|
<div class="widget" id="sidebarWidget__pack" data-tag-info="<%= @tag_model.attributes.slice("id", "text_color_hex", "bg_color_hex", "name").to_json %>" />
|
|
<% 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">
|
|
<p style="margin-bottom: 12px;">Join thousands of software developers leveling up their code and careers.</p>
|
|
<center style="margin-bottom: 12px;">
|
|
<a href="/users/auth/twitter?state=navbar_basic" class="cta cta-button login-cta-button" data-no-instant>
|
|
LOG IN WITH TWITTER
|
|
</a>
|
|
<a href="/users/auth/github?state=navbar_basic" class="cta cta-button login-cta-button" data-no-instant>
|
|
LOG IN WITH 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>
|