Remove some hardcoded shecoded stuff (#2011)

This commit is contained in:
Ben Halpern 2019-03-08 18:08:48 -08:00 committed by GitHub
parent 1ceda51e88
commit ecb9f6da3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 27 deletions

View file

@ -1388,7 +1388,7 @@
}
&::before {
content: '';
color: #dfd4fc;
color: $green;
font-size: 2em;
vertical-align: -6px;
margin-left: -20px;

View file

@ -123,12 +123,10 @@ class StoriesController < ApplicationController
where("score > ? OR featured = ?", 9, true).
order("hotness_score DESC")
if user_signed_in?
offset = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4].sample # random offset, weighted more towards zero
offset = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9].sample # random offset, weighted more towards zero
@stories = @stories.offset(offset)
end
@featured_story = @stories.cached_tagged_with("shecoded").where.not(main_image: nil).first&.decorate ||
@stories.where.not(main_image: nil).first&.decorate ||
Article.new
@featured_story = @stories.where.not(main_image: nil).first&.decorate || Article.new
end
@stories = @stories.decorate
assign_podcasts

View file

@ -29,23 +29,8 @@
<% end %>
<div class="widget shecoded-widget">
<img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nBBZ2m5n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ls565bghkq9uv8icae8d.png" />
<h3 style="color: #422799; line-height: 1.34em;">Today is our community's third annual #SheCoded event to celebrate International Women's Day</h3>
<a href="/shecoded" style="display: block; border: 2px solid #422799; color: #422799; padding: 8px 0px; border-radius: 100px; text-align: center; font-weight: bold;" data-no-instant>Get Started</a>
</div>
<div class="widget">
<header>
<a href="/t/shecoded"><h4>Nevertheless, #SheCoded</h4></a>
</header>
<div class="widget-body">
<div class="widget-link-list">
<% Article.tagged_with(["shecoded", "shecodedally", "theycoded"], any: true).
where("published_at > ?", 2.weeks.ago).where(approved: true).
order("hotness_score DESC").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>
</div>
<h3 style="color: #422799; line-height: 1.25em;font-size: 1.15em;">Friday was #SheCoded day on DEV, where we highlight stories from the amazing women in our community.</h3>
<a href="/shecoded" style="display: block; border: 2px solid #422799; color: #422799; padding: 8px 0px; border-radius: 100px; text-align: center; font-weight: bold;" data-no-instant>See All the Posts</a>
</div>
<% if Article.active_help.any? %>
<div class="widget">

View file

@ -23,11 +23,6 @@
<meta name="twitter:card" content="summary_large_image">
<%= auto_discovery_link_tag(:rss, "https://dev.to/feed", title: "The Practical Dev RSS Feed") %>
<% end %>
<% if @home_page %>
<style>
body { background: #f0eaff !important; }
</style>
<% end %>
<div class="home" id="index-container"
data-params="<%= params.to_json(only: %i[tag username q]) %>" data-which="<%= @list_of %>"
data-algolia-tag=""