Module: Helpdesk::HelpdeskHelper
- Defined in:
- app/helpers/helpdesk/helpdesk_helper.rb
Instance Method Summary collapse
- #badge(num, css = 'pull-right') ⇒ Object
- #ico(name) ⇒ Object
- #menu_left(title, &block) ⇒ Object
- #menu_li(lbl, path, *args) ⇒ Object
- #panel_menu(title, type, &block) ⇒ Object
- #parent_layout(layout) ⇒ Object
- #status_label(lbl, cls) ⇒ Object
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 |
#menu_left(title, &block) ⇒ Object
5 6 7 |
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 5 def (title,&block) (title,'default',&block) end |
#menu_li(lbl, path, *args) ⇒ Object
20 21 22 23 24 |
# File 'app/helpers/helpdesk/helpdesk_helper.rb', line 20 def (lbl, path, *args) = args. ([:class].nil? ? .merge!(:class => "active") : [:class] += " active" ) if url_for(path) == request.fullpath content_tag(:li, link_to(lbl, path), ) 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 (title,type,&block) content_tag(:div,class: "panel panel-#{type}") do content_tag(:div ,class: 'panel-heading') do content_tag(:h3 ,title,class:'panel-title') end + content_tag( :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) content_tag(:span, class: "label #{cls}") do lbl end end |