Module: Ems::ApplicationHelper

Defined in:
app/helpers/ems/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#feature_table(headings) ⇒ Object

Tables



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'app/helpers/ems/application_helper.rb', line 64

def feature_table(headings)
  haml_tag :table do
    # Make the header
    haml_tag :thead do
      haml_tag :tr do
        headings.each do |h|
          haml_tag :th do
            haml_concat(h)
          end
        end
      end
    end
    # Make content
    haml_tag :tbody do
      yield
    end
  end
end

#index_table(headings) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'app/helpers/ems/application_helper.rb', line 83

def index_table(headings)
  haml_tag :table,  :class=>"index_table", :paginator=>"true" do
    # Make the header
    haml_tag :thead do
      haml_tag :tr do
        headings.each do |h|
          haml_tag :th do
            haml_concat(h)
          end
        end
      end
    end
    # Make content
    haml_tag :tbody do
      yield
    end
  end
end

#main_content(title) ⇒ Object

Content wrappers



33
34
35
36
37
38
39
# File 'app/helpers/ems/application_helper.rb', line 33

def main_content(title)
  haml_tag :div, :id => "main_content_wrapper" do
    haml_tag :div, :id=>"main_content" do
      yield
    end
  end
end

#panel(title) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
# File 'app/helpers/ems/application_helper.rb', line 50

def panel(title)
  haml_tag :div, :class => "panel" do
    haml_tag :h3, :class => "top" do
      haml_concat(title)
    end
    haml_tag :div, :class => "panel_contents" do
      haml_tag :div, :class => "attributes_table featured_content" do
        yield
      end
    end
  end
end

#side_contentObject



42
43
44
45
46
47
48
# File 'app/helpers/ems/application_helper.rb', line 42

def side_content
  haml_tag :div, :id => "sidebar" do
    haml_tag :div, :class=> "sidebar_section" do
      yield
    end
  end
end

#title_bar(pageTitle, links) ⇒ Object

Titles



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/helpers/ems/application_helper.rb', line 4

def title_bar(pageTitle, links)
  haml_tag :div, :id => "title_bar" do

    haml_tag :div, :id => "titlebar_left" do
      haml_tag :div, :class => "breadcrumb" do
        haml_concat(render_navigation  :context => :ems, :renderer => :breadcrumbs, :join_with => " > ")
      end
      haml_tag :h2, :id => "page_title" do
        haml_concat(pageTitle)
      end
    end

    if links
      haml_tag :div, :id => "titlebar_right" do
        haml_tag :div, :class => "action_items" do
          links.each do |link|
            haml_tag :span, :class => "action_item" do
              haml_tag :a, :href =>link["url"] do
                haml_concat(link["title"])
              end
            end
          end
        end
      end
    end
  end
end