Class: ODDB::Html::View::Head

Inherits:
HtmlGrid::DivComposite
  • Object
show all
Defined in:
lib/oddb/html/view/head.rb

Direct Known Subclasses

WelcomeHead

Constant Summary collapse

COMPONENTS =
{
  [0,0] => :user,
  [0,1] => :google_ads,
  [0,2] => :logo,
}
CSS_ID_MAP =
["user", "google-ads"]

Instance Method Summary collapse

Instance Method Details



20
21
22
23
24
# File 'lib/oddb/html/view/head.rb', line 20

def google_ads(model)
  if(@lookandfeel.enabled?(:google_ads) && !@session.logged_in?)
    GoogleAds.new :width => 468, :height => 60, :channel => '6336403681'
  end
end

#logo(model) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/oddb/html/view/head.rb', line 25

def (model)
  return if @lookandfeel.disabled? :logo
  target = :home
   = HtmlGrid::Image.new(:logo, model, @session, self)
  if(@session.direct_event == target)
    
  else
    link = HtmlGrid::Link.new(target, model, @session, self)
    link.value = 
    link.href = @lookandfeel._event_url(target)
    link
  end
end

#user(model) ⇒ Object



38
39
40
41
42
43
# File 'lib/oddb/html/view/head.rb', line 38

def user(model)
  user = @session.user
  if(user.is_a? Util::KnownUser)
    @lookandfeel.lookup(:welcome_user, user.name)
  end
end