2009-01-06 11:49:19 +01:00
|
|
|
module ArticlesHelper
|
|
|
|
# useful for highlighting attributes, when synchronizing articles
|
|
|
|
def highlight_new(unequal_attributes, attribute)
|
2014-05-21 21:24:03 +02:00
|
|
|
return unless unequal_attributes
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2015-01-18 02:04:57 +01:00
|
|
|
unequal_attributes.has_key?(attribute) ? "background-color: yellow" : ""
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|
2009-01-16 16:19:26 +01:00
|
|
|
|
|
|
|
def row_classes(article)
|
2012-10-28 18:03:50 +01:00
|
|
|
classes = []
|
|
|
|
classes << "unavailable" if !article.availability
|
|
|
|
classes << "just-updated" if article.recently_updated && article.availability
|
|
|
|
classes.join(" ")
|
2009-01-16 16:19:26 +01:00
|
|
|
end
|
2014-02-20 15:04:53 +01:00
|
|
|
end
|