Module: Card::Set::Type::User::HtmlFormat

Extended by:
AbstractFormat
Defined in:
tmpsets/set/mod025-account/type/user.rb

Instance Method Summary collapse

Instance Method Details

#account_formgroupObject



38
39
40
41
# File 'tmpsets/set/mod025-account/type/user.rb', line 38

def 
   = card.fetch trait: :account, new: {}
  subformat()._render :content_formgroup, structure: true
end

#help_textObject



55
56
57
58
59
60
61
62
63
64
# File 'tmpsets/set/mod025-account/type/user.rb', line 55

def help_text
  text = "<h3>To get started, set up an account.</h3>"
  if Card.config.action_mailer.perform_deliveries == false
    text += <<-HTML
      <br>WARNING: Email delivery is turned off.
      Change settings in config/application.rb to send sign up notifications.
    HTML
  end
  text
end

#setup_buttonObject



43
44
45
# File 'tmpsets/set/mod025-account/type/user.rb', line 43

def setup_button
  submit_button text: "Set up", disable_with: "Setting up"
end

#setup_formObject



23
24
25
26
27
28
29
30
31
32
# File 'tmpsets/set/mod025-account/type/user.rb', line 23

def setup_form
  frame_and_form :create do
    [
      setup_hidden_fields,
      _render_name_formgroup(help: "usually first and last name"),
      ,
      setup_form_buttons
    ]
  end
end

#setup_form_buttonsObject



34
35
36
# File 'tmpsets/set/mod025-account/type/user.rb', line 34

def setup_form_buttons
  button_formgroup { setup_button }
end

#setup_hidden_fieldsObject



47
48
49
50
51
52
53
# File 'tmpsets/set/mod025-account/type/user.rb', line 47

def setup_hidden_fields
  hidden_tags(
    setup: true,
    success: "REDIRECT: #{path mark: ''}",
    "card[type_id]" => Card.default_accounted_type_id
  )
end