Class: ODDB::View::Drugs::RegisterDownloadForm

Inherits:
Form
  • Object
show all
Includes:
HtmlGrid::ErrorMessage, User::AutoFill
Defined in:
src/view/drugs/register_download.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :email,
  [0,1] =>  :salutation,
  [0,2] =>  :name_last,
  [0,3] =>  :name_first,
  [1,4] =>  :submit,
}
CSS_CLASS =
'component'
HTML_ATTRIBUTES =
{
  'style' =>  'width:30%',
}
EVENT =
:checkout
LABELS =
true
CSS_MAP =
{
  [0,0,4,5] =>  'list',
}
COMPONENT_CSS_MAP =
{
  [1,0,3,4] =>  'standard',
}
SYMBOL_MAP =
{
  :pass           => HtmlGrid::Pass,
  :set_pass_2     =>  HtmlGrid::Pass,
  :salutation     =>  HtmlGrid::Select,
}

Constants included from FormMethods

ACCEPT_CHARSET, DEFAULT_CLASS, EVENT

Instance Method Summary (collapse)

Methods included from User::AutoFill

#email

Methods included from FormMethods

#delete_item, #delete_item_warn, #get_event_button, #post_event_button

Instance Method Details

- (Object) hidden_fields(context)



55
56
57
58
59
60
61
# File 'src/view/drugs/register_download.rb', line 55

def hidden_fields(context)
   = super
  [:search_query, :search_type].each { |key|
     << context.(key.to_s, @session.state.send(key))
  } 
  
end

- (Object) init



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'src/view/drugs/register_download.rb', line 42

def init
  unless(@session.logged_in?)
    hash_insert_row(components, [0,1], :pass)
    components.store([3,1], :set_pass_2)
    css_map.store([0,11,4], 'list')
    component_css_map.store([1,10], 'standard')
  end
  super
  if(@session.error?)
    error = RuntimeError.new('e_need_all_input')
    __message(error, 'processingerror')
  end
end

- (Object) submit(model, session = @session)



62
63
64
# File 'src/view/drugs/register_download.rb', line 62

def submit(model, session=@session)
  super(model, session, :checkout_paypal)
end