zeus.ugent.be/lib/helpers/font_awesome.rb

14 lines
374 B
Ruby
Raw Normal View History

2016-08-04 19:17:45 +02:00
module FontAwesomeHelper
2016-12-12 14:34:43 +01:00
def fa(icon, opts = {})
2016-08-04 19:17:45 +02:00
classes = ['fa', "fa-#{icon}"]
2016-12-12 14:34:43 +01:00
classes << "fa-#{opts[:size]}" if opts[:size]
classes << 'fa-li' if opts[:li]
classes << "fa-stack-#{opts[:stack]}" if opts[:stack]
classes << 'fa-inverse' if opts[:inverse]
classes << opts[:class]
2016-08-04 19:17:45 +02:00
2016-12-12 14:34:43 +01:00
"<i class='#{classes.reject(&:nil?).join(' ')}'></i>"
2016-08-04 19:17:45 +02:00
end
end