Class: BBMB::Html::View::Template

Inherits:
HtmlGrid::DivTemplate
  • Object
show all
Defined in:
lib/bbmb/html/view/template.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0]    =>  :head,
  [0,1]    =>  :content,
  [0,2]    =>  :foot,
}
CSS_ID_MAP =
['head', 'content', 'foot']
CSS_FILES =
['bbmb.css']
HEAD =
Head
HTTP_HEADERS =
{
  "Content-Type"  =>  "text/html; charset=utf-8",
  "Cache-Control" =>  "private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
  "Pragma"        =>  "no-cache",
  "Expires"       =>  Time.now.httpdate,
  "P3P"           =>  "CP='OTI NID CUR OUR STP ONL UNI PRE'",
}
FOOT =
Foot
META_TAGS =
[
  {
    "http-equiv"  =>  "robots",
    "content"     =>  "nofollow, noindex",
  },
]

Instance Method Summary collapse

Instance Method Details



40
41
42
43
44
45
46
# File 'lib/bbmb/html/view/template.rb', line 40

def css_links(context)
  if(@lookandfeel.enabled?(:external_css, false))
    css_link(context, @lookandfeel.resource_external(:external_css))
  else
    super
  end
end

#http_headers(*args) ⇒ Object



47
48
49
50
51
52
# File 'lib/bbmb/html/view/template.rb', line 47

def http_headers(*args)
  headers = super
  headers.store('Refresh', 
    "#{BBMB.config.session_timeout}; URL=#{@lookandfeel._event_url(:logout)}")
  headers
end

#title(context) ⇒ Object



53
54
55
56
57
# File 'lib/bbmb/html/view/template.rb', line 53

def title(context)
  parts = [:html_title, *@session.state.direct_event].collect { |key| 
    @lookandfeel.lookup(key) }.compact
  context.title { parts.join(' | ') }
end