Module: FlexaLib::Helpers::OtherHelpers

Included in:
FlexaLib::Helpers
Defined in:
lib/flexa_lib/helpers/other_helpers.rb

Instance Method Summary collapse

Instance Method Details

#flexa_column(size = "3", &block) ⇒ Object

OTHER_HELPERS



57
58
59
60
61
# File 'lib/flexa_lib/helpers/other_helpers.rb', line 57

def flexa_column(size="3",&block)
   :div, :class=>"span"+size.to_s do
    block.call
  end
end

#flexa_fixed_toolbar(title = "", path = "", &block) ⇒ Object

OTHER_HELPERS



45
46
47
48
49
50
51
52
53
54
# File 'lib/flexa_lib/helpers/other_helpers.rb', line 45

def flexa_fixed_toolbar(title="",path="",&block)
     :header,:class=>"jumbotron subhead" do
         :div,:class=>"subnav subnav-fixed" do
             :ul,:class=>"nav nav-pills", :id=>"overview" do
              concat(flexa_page_title(title, path))  
              block.call  
            end  
        end
    end
end

#flexa_flash_messageObject

OTHER_HELPERS



33
34
35
36
37
38
39
40
41
42
# File 'lib/flexa_lib/helpers/other_helpers.rb', line 33

def flexa_flash_message
  messages = ""
  css_class = {:notice => "success", :info => "info", :warning => "info", :error => "error"}
  [:notice, :info, :warning, :error].each {|type|
    if flash[type]
      messages += ('div',flash[type],:class=>'alert alert-'<<css_class[type.to_sym])
    end
  }
  raw messages
end

#flexa_icon_text(icon, text) ⇒ Object

OTHER_HELPERS



28
29
30
# File 'lib/flexa_lib/helpers/other_helpers.rb', line 28

def flexa_icon_text(icon,text)
  ("i", "",:class=>"icon-"+icon)<<text
end

#flexa_page_title(title, path) ⇒ Object

OTHER_HELPERS



21
22
23
24
25
# File 'lib/flexa_lib/helpers/other_helpers.rb', line 21

def flexa_page_title(title, path)
   :li do
    link_to(("b", title), path)
  end
end

#flexa_search_tool(class_ref) ⇒ Object

OTHER_HELPERS



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/flexa_lib/helpers/other_helpers.rb', line 7

def flexa_search_tool(class_ref)
  class_name = class_ref.name.to_s.underscore
   :li do
    form_tag(send("#{class_name.pluralize}_path"), :method=>"get", :id=>"formsearch", :style=>"padding-top:4px;padding-left:50px;",:class=>"form-search") do
      concat(hidden_field_tag :fill, params[:fill])
      concat(text_field_tag :search, params[:search], :class=>"input-medium search-query")
      concat(("button",:type=>"submit",:class=>"btn btn-info",:style=>"margin-left:4px;",:id=>"search") do
        ("i", "",:class=>"icon-search icon-white")
      end)
    end
  end
end