Module: Helpdesk::HelpdeskHelper

Defined in:
app/helpers/helpdesk/helpdesk_helper.rb

Instance Method Summary collapse

Instance Method Details

#badge(num, css = 'pull-right') ⇒ Object



32
33
34
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 32

def badge(num,css='pull-right')
  raw("<span class=\"badge #{css}\">#{num}</span> ")
end

#ico(name) ⇒ Object



36
37
38
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 36

def ico(name)
  raw("<i class=\"glyphicon glyphicon-#{name}\"></i> ")
end


5
6
7
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 5

def menu_left(title,&block)
  panel_menu(title,'default',&block)
end


20
21
22
23
24
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 20

def menu_li(lbl, path, *args)
  options = args.extract_options!
  (options[:class].nil? ? options.merge!(:class => "active") : options[:class] += " active" ) if url_for(path) == request.fullpath
  (:li, link_to(lbl, path), options)
end

#panel_menu(title, type, &block) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 9

def panel_menu(title,type,&block)
  (:div,class: "panel panel-#{type}") do
    (:div ,class: 'panel-heading') do
      (:h3 ,title,class:'panel-title')
    end +
    ( :ul, class: 'nav nav-pills nav-stacked ') do
      capture(&block)
    end
  end
end

#parent_layout(layout) ⇒ Object



40
41
42
43
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 40

def parent_layout(layout)
  @view_flow.set(:layout,output_buffer)
  self.output_buffer = render(:file => "layouts/#{layout}")
end

#status_label(lbl, cls) ⇒ Object



26
27
28
29
30
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 26

def status_label(lbl,cls)
  (:span, class: "label #{cls}") do
    lbl
  end
end