tap/app/helpers/application_helper.rb

24 lines
456 B
Ruby
Raw Normal View History

2014-12-09 13:10:36 +01:00
require 'digest/md5'
2014-11-06 14:46:59 +01:00
module ApplicationHelper
2014-12-09 13:10:36 +01:00
def get_color(user)
@color = Digest::MD5.hexdigest(user.name)[0..5]
end
def get_inverted_color(user)
@inverted_color = Digest::MD5.hexdigest(user.name)[0..5].reverse
end
def get_color_style(user)
@style = "background-color: #"+ get_color(user) +"; color: #"+
get_inverted_color(user)+ ";"
end
2014-12-09 11:38:10 +01:00
#tijdelijk voor layout
def koelkast(status)
@koelkast ||= status
end
2014-12-09 13:10:36 +01:00
2014-11-06 14:46:59 +01:00
end