diff --git a/app/assets/stylesheets/articles.scss b/app/assets/stylesheets/articles.scss index d939be889..7acdf63ab 100644 --- a/app/assets/stylesheets/articles.scss +++ b/app/assets/stylesheets/articles.scss @@ -860,7 +860,7 @@ } .widget{ width:calc(100% - 30px); - padding:14px 12px; + padding:10px 12px; margin-bottom:15px; position:relative; overflow:hidden; @@ -934,12 +934,17 @@ header{ width:100%; margin:auto; - padding-bottom:5px; font-weight:800; - font-size: 1.3em; + font-size: 1.2em; padding-bottom:10px; font-family: $helvetica-condensed; font-stretch:condensed; + a{ + color: $black; + &:hover{ + text-decoration: underline; + } + } .emoji{ margin-right:3px; margin-left:5px; @@ -1130,11 +1135,19 @@ } } .cta-button{ - padding:5px 18px; - border-radius:3px; - margin-top:12px; - font-weight: bold; - display:inline-block; + margin-top:8px; + padding:17px 5px 8px; + margin-left: 3px; + font-size:0.93em; + color: $sky-blue; + background: white; + display:block; + width:92%; + border-top: 3px solid $light-gray; + &:hover{ + text-decoration: underline; + opacity:1; + } } } .widget-link-list__item { diff --git a/app/models/article.rb b/app/models/article.rb index f977eb82c..2ef2da3d8 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -153,9 +153,9 @@ class Article < ApplicationRecord end end - def self.active_discuss_threads(tag=nil, time_ago=nil) + def self.active_threads(tags=["discuss"], time_ago=nil, number=10) stories = where(published:true). - limit(8) + limit(number) if time_ago == "latest" stories = stories.order("published_at DESC") elsif time_ago @@ -166,8 +166,7 @@ class Article < ApplicationRecord where("published_at > ?", (tag.present? ? 5 : 2).days.ago) end - stories = stories.tagged_with(["discuss", tag]) if tag - stories = stories.tagged_with("discuss") unless tag + stories = stories.tagged_with(tags) stories.pluck(:path, :title, :comments_count, :created_at) end diff --git a/app/views/articles/_sidebar_additional.html.erb b/app/views/articles/_sidebar_additional.html.erb index 8dc074278..ad03535b1 100644 --- a/app/views/articles/_sidebar_additional.html.erb +++ b/app/views/articles/_sidebar_additional.html.erb @@ -42,14 +42,14 @@ <% end %> <% elsif @user && @user.class.name == "Organization" %> <% elsif @tag %> - <% if Article.active_discuss_threads(@tag, Timeframer.new(params[:timeframe]).datetime).any? %> + <% if Article.active_threads([@tag,"discuss"], Timeframer.new(params[:timeframe]).datetime).any? %>