Class: OMF::Web::Theme::Page

Inherits:
AbstractPage show all
Defined in:
lib/omf-web/theme/bright/page.rb

Direct Known Subclasses

WidgetPage

Instance Attribute Summary

Attributes inherited from AbstractPage

#opts

Instance Method Summary collapse

Methods inherited from AbstractPage

#collect_data_sources, #data_source_widgets, #initialize, #render_additional_headers, #render_data_source, #render_data_sources, #render_flash, #to_html

Constructor Details

This class inherits a constructor from OMF::Web::Theme::AbstractPage

Instance Method Details

#contentObject

end



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/omf-web/theme/bright/page.rb', line 34

def content
  super
  div :id => 'doc3' do
    div :id => 'hd' do
      render_top_line
      h1 @page_title || 'Missing :page_title' 
    end
    div :id => 'bd' do
      render_body
    end
    div :id => 'ft' do
      render_footer
    end
  end
end

#render_bodyObject



76
77
78
79
# File 'lib/omf-web/theme/bright/page.rb', line 76

def render_body
  render_flash
  render_card_body
end

#render_card_bodyObject



81
82
83
84
85
# File 'lib/omf-web/theme/bright/page.rb', line 81

def render_card_body
  return unless @widget
  Thread.current["top_renderer"] = self
  rawtext @widget.content.to_html
end


87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/omf-web/theme/bright/page.rb', line 87

def render_footer
  if @footer_right.is_a? Proc
    widget(Erector.inline(&@footer_right))
  else
    span :style => 'float:right;margin-right:10pt' do
      text @footer_right || OMF::Web::VERSION
    end
  end
  if @footer_left.is_a? Proc
    widget(Erector.inline(&@footer_left))
  else
    text @footer_left || 'Brought to you by the TEMPO Team'
  end
    
end

#render_tab_menuObject



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/omf-web/theme/bright/page.rb', line 57

def render_tab_menu
  ol :id => :tab_menu do
    @tabs.each do |h|
      lopts = h[:id] == @tab ? {:class => :current} : {}
      li lopts do 
        a :href => "#{@prefix}/#{h[:id]}?sid=#{Thread.current["sessionID"]}" do
          span h[:name], :class => :tab_text
        end
      end
    end
  end
end

#render_tools_menuObject



70
71
72
73
74
# File 'lib/omf-web/theme/bright/page.rb', line 70

def render_tools_menu
  div :id => :tools_menu do
    a 'Log in', :href => '/login'
  end
end

#render_top_lineObject



50
51
52
53
54
55
# File 'lib/omf-web/theme/bright/page.rb', line 50

def render_top_line
  div :id => :top_line do
    render_tab_menu
    render_tools_menu
  end
end