Class: BBMB::Html::View::CustomersList

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

Constant Summary collapse

BACKGROUND_ROW =
'bg'
BACKGROUND_SUFFIX =
''
COMPONENTS =
{
  [0,0] =>	:customer_id,
  [1,0]	=>	:organisation,
  [2,0] =>  :plz,
  [3,0]	=>	:city,
  [4,0]	=>	:email,
  [5,0]	=>	:communication,
  [6,0]	=>	:valid,
  [7,0]	=>	:last_login,
}
CSS_CLASS =
'list'
CSS_MAP =
{
  [1,0]		=>	'big',
}
SORT_DEFAULT =
nil
SYMBOL_MAP =
{
  :email  => HtmlGrid::MailLink,
}

Instance Method Summary collapse

Instance Method Details

#customer_id(model) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/bbmb/html/view/customers.rb', line 64

def customer_id(model)
  link = HtmlGrid::Link.new(:customer_id, model, @session, self)
  link.value = model.customer_id
  link.href = @lookandfeel._event_url(:customer, 
                                      {:customer_id => model.customer_id})
  link
end

#last_login(model) ⇒ Object

def email(model) if(mail = model.email) link = HtmlGrid::Link.new(:email, model, @session, self) link.value = mail link.href = sprintf("mailto:%s", mail) link end end def email(model) EmailValue.new(model, @session, self) end def last_login(model) DateTimeView.new(:last_login, model, @session, self) end def active(model) model.value(:active) end



97
98
99
# File 'lib/bbmb/html/view/customers.rb', line 97

def (model)
  @session.user.(model.email)
end

#organisation(model) ⇒ Object



71
72
73
74
75
76
77
# File 'lib/bbmb/html/view/customers.rb', line 71

def organisation(model)
  link = HtmlGrid::Link.new(:organisation, model, @session, self)
  link.value = model.organisation
  link.href = @lookandfeel._event_url(:customer, 
                                      {:customer_id => model.customer_id})
  link
end

#valid(model) ⇒ Object



100
101
102
# File 'lib/bbmb/html/view/customers.rb', line 100

def valid(model)
  @lookandfeel.lookup(@session.user.entity_valid?(model.email).to_s)
end