Module: Card::Set::Type::Signup::Views::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb,
card/tmpsets/set/mod010-card-mod-account/type/signup/views.rb

Instance Method Summary collapse

Instance Method Details

#account_linesObject



52
53
54
55
56
57
58
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 52

def 
  if card.
    verification_lines
  else
    [tr(:missing_account)]
  end
end


89
90
91
92
93
94
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 89

def approval_link text, with_or_without
  return unless card.can_approve?
  link_to_card card, text,
               path: { action: :update,
                       card: { trigger: "approve_#{with_or_without}_verification" } }
end


80
81
82
83
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 80

def approve_with_token_link
  action = card..status == "unverified" ? "Resend" : "Send"
  approval_link "#{action} verification email", :with
end


85
86
87
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 85

def approve_without_token_link
  approval_link "Approve without verification", :without
end


96
97
98
99
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 96

def deny_link
  return unless card.ok? :delete
  link_to_card card, "Deny and delete", path: { action: :delete }
end

#invitation?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 9

def invitation?
  Auth.signed_in? && card.can_approve?
end

#invite_buttonObject



28
29
30
31
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 28

def invite_button
  return unless invitation?
  button_tag "Send Invitation", situation: "primary"
end

#invited?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 44

def invited?
  !self_signup?
end

#self_signup?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 48

def self_signup?
  card.creator_id == AnonymousID
end

#signup_lineObject



38
39
40
41
42
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 38

def 
  ["<strong>#{safe_name}</strong>",
   ("was" if invited?),
   "signed up on #{format_date card.created_at}"].compact.join " "
end

#verification_linesObject



60
61
62
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 60

def verification_lines
  [verification_sent_line, verification_link_line].compact
end


70
71
72
73
74
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 70

def verification_link_line
  links = verification_links
  return if links.empty?
  links.join " "
end


76
77
78
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 76

def verification_links
  [approve_with_token_link, approve_without_token_link, deny_link].compact
end

#verification_sent_lineObject



64
65
66
67
68
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 64

def verification_sent_line
   = card.
  return unless .email_card.ok?(:read)
  "A verification email has been sent to #{.email}"
end

#view: content_formgroupsObject



18
19
20
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 18

view :content_formgroups do
  [, (card.structure ? edit_slot : "")].join
end

#view: coreObject



33
34
35
36
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 33

view :core, template: :haml do
  @lines = [] + 
  @body = process_content _render_raw
end

#view: newObject



13
14
15
16
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 13

view :new do
  voo.title = invitation? ? tr(:invite) : tr(:sign_up)
  super()
end

#view: new_buttonsObject



22
23
24
25
26
# File 'card/tmpsets/set/mod011-card-mod-account/type/signup/views.rb', line 22

view :new_buttons do
  button_formgroup do
    [standard_create_button, invite_button].compact
  end
end