Sha256: 359554e0a57484dc5a1ee08dc07726bb719833a4c3e87e279ecf040c0a0c577b

Contents?: true

Size: 905 Bytes

Versions: 2

Compression:

Stored size: 905 Bytes

Contents

module CgAppBase
  module ApplicationHelper
    def navigation_on?
      session[:menu_layout] == 'true' && !params[:no_menu_layout]
    end

    def el_attr_name_to_id(name)
      name.gsub(/\]/, '').gsub(/\[/, '_')
    end

    def icon(klass_ending, title='', style='', mode_tooltip=false)

      if mode_tooltip
        has_tooltip = 'has-tooltip'
        tooltip_original_title = "data-original-title='#{title}'"
        my_title = ''
      else
        has_tooltip = ''
        tooltip_original_title = ""
        my_title = title
      end

      "<i style='#{style}' class='#{has_tooltip} icon-#{klass_ending}' #{tooltip_original_title}></i> #{my_title}".html_safe
    end

    def blueicon(klass_ending, title='')
      icon("#{klass_ending} text-blue", title)
    end

    def customer_type_icon(customer_type)
      icon("#{customer_type == 'COMMERCIAL' ? 'group' : 'user'}")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cg_app_base-1.1.1 app/helpers/cg_app_base/application_helper.rb
cg_app_base-1.0.78 app/helpers/cg_app_base/application_helper.rb