Sha256: 5efae4d56ab78ea166df77751fa3c6a714b9adf0827728f2013ebd756ee2c19b
Contents?: true
Size: 1.22 KB
Versions: 3
Compression:
Stored size: 1.22 KB
Contents
module AbAdmin module Views module Helpers def as_html(text) return ''.html_safe if text.nil? Nokogiri::HTML.fragment(text).to_html.html_safe end def full_locale case I18n.locale when :en 'en_US' when :ru 'ru_RU' when :it 'it_IT' when :uk 'uk_UA' else 'ru_RU' end end def locale_path I18n.locale == I18n.default_locale ? '' : "/#{I18n.locale}" end def skype_link(skype, options={}) return '' if skype.blank? link_to skype, "skype:#{skype.strip}?chat", options end def init_js(js, delayed: false) if delayed @delayed_js ||= [] @delayed_js << js nil else %Q[<script type='text/javascript'>$(function(){#{js}})</script>].html_safe end end def render_delayed_js return if @delayed_js.blank? %Q[<script type='text/javascript'>$(function(){#{@delayed_js.join(';')}})</script>].html_safe end def image_tag_if(image, options={}) return unless image image_tag image, options end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ab_admin-0.11.0 | lib/ab_admin/views/helpers.rb |
ab_admin-0.10.0 | lib/ab_admin/views/helpers.rb |
ab_admin-0.9.0 | lib/ab_admin/views/helpers.rb |