2009-01-06 11:49:19 +01:00
|
|
|
module ArticlesHelper
|
|
|
|
|
|
|
|
# useful for highlighting attributes, when synchronizing articles
|
|
|
|
def highlight_new(unequal_attributes, attribute)
|
|
|
|
unequal_attributes.detect {|a| a == attribute} ? "background-color: yellow" : ""
|
|
|
|
end
|
2009-01-16 16:19:26 +01:00
|
|
|
|
|
|
|
def row_classes(article)
|
2011-05-19 19:49:37 +02:00
|
|
|
classes = " "
|
2009-02-10 13:26:10 +01:00
|
|
|
classes += " unavailable" if !article.availability
|
2011-05-19 19:49:37 +02:00
|
|
|
classes += " just_updated" if article.recently_updated && article.availability
|
2009-01-16 16:19:26 +01:00
|
|
|
classes
|
|
|
|
end
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|