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



78
79
80
81
82
83
84
# File 'lib/bbmb/html/view/customers.rb', line 78

def (model)
  if model.respond_to?(:last_login)
    model.
  else
    @session.auth_session.(model.email)
  end
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



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/bbmb/html/view/customers.rb', line 85

def valid(model)
  if model.respond_to?(:valid)
    @lookandfeel.lookup(model.valid)
  elsif @session.auth_session && defined?(@session.auth_session.entity_valid?)
    @session.auth_session.entity_valid?(model.email)
  else
    @lookandfeel.lookup(@session.user.entity_valid?(model.email).to_s)
  end
rescue => error
  puts error
end