From a702fae66af2c933ebfd9d0a36853b4eaa79c21a Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Thu, 18 May 2017 19:02:21 +0200 Subject: [PATCH] highlight stories to their authors that have suggestions - merged with i18n --- app/assets/stylesheets/application.css | 3 +++ app/models/story.rb | 4 ++++ app/views/stories/_listdetail.html.erb | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 6fa27eb..6ae2772 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -607,6 +607,9 @@ span.user_is_author, a.user_is_author, li .byline a.user_is_author { color: #6081bd; } +li .byline a.story_has_suggestions { + color: #6081bd; +} li.story.hidden { opacity: 0.25; diff --git a/app/models/story.rb b/app/models/story.rb index 2d3879c..d08d64b 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -328,6 +328,10 @@ class Story < ActiveRecord::Base "hotness = '#{self.calculated_hotness}' WHERE id = #{self.id.to_i}") end + def has_suggestions? + self.suggested_taggings.any? || self.suggested_titles.any? + end + def hider_count @hider_count ||= HiddenStory.where(:story_id => self.id).count end diff --git a/app/views/stories/_listdetail.html.erb b/app/views/stories/_listdetail.html.erb index e62f0b0..4267d67 100644 --- a/app/views/stories/_listdetail.html.erb +++ b/app/views/stories/_listdetail.html.erb @@ -119,7 +119,8 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %> <% if story.is_editable_by_user?(@user) %> | - <%= t('.edit') %> + "><%= t('.edit') %> <% if story.is_gone? && story.is_undeletable_by_user?(@user) %> |