Module: Card::Set::Type::Signup::Views::HtmlFormat
- Extended by:
- AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb
Instance Method Summary collapse
-
#account_lines ⇒ Object
-
#approval_link(text, with_or_without) ⇒ Object
-
#approve_with_token_link ⇒ Object
-
#approve_without_token_link ⇒ Object
-
#deny_link ⇒ Object
-
#invitation? ⇒ Boolean
-
#invite_button ⇒ Object
-
#invited? ⇒ Boolean
-
#self_signup? ⇒ Boolean
-
#signup_line ⇒ Object
TODO: localize.
-
#verification_lines ⇒ Object
-
#verification_link_line ⇒ Object
-
#verification_links ⇒ Object
-
#verification_sent_line ⇒ Object
-
#view: content_formgroups ⇒ Object
-
#view: core ⇒ Object
-
#view: new ⇒ Object
-
#view: new_buttons ⇒ Object
Instance Method Details
#account_lines ⇒ Object
54 55 56 57 58 59 60 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 54 def account_lines if card.account? verification_lines else [t(:account_missing_account)] end end |
#approval_link(text, with_or_without) ⇒ Object
93 94 95 96 97 98 99 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 93 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 |
#approve_with_token_link ⇒ Object
84 85 86 87 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 84 def approve_with_token_link action = card.account.status == "unverified" ? "Resend" : "Send" approval_link "#{action} verification email", :with end |
#approve_without_token_link ⇒ Object
89 90 91 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 89 def approve_without_token_link approval_link "Approve without verification", :without end |
#deny_link ⇒ Object
101 102 103 104 105 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 101 def deny_link return unless card.ok? :delete link_to_card card, "Deny and delete", path: { action: :delete } end |
#invitation? ⇒ Boolean
9 10 11 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 9 def invitation? Auth.signed_in? && card.can_approve? end |
#invite_button ⇒ Object
28 29 30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 28 def return unless invitation? "Send Invitation", situation: "primary" end |
#invited? ⇒ Boolean
46 47 48 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 46 def invited? !self_signup? end |
#self_signup? ⇒ Boolean
50 51 52 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 50 def self_signup? card.creator_id == AnonymousID end |
#signup_line ⇒ Object
TODO: localize
40 41 42 43 44 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 40 def signup_line ["<strong>#{safe_name}</strong>", ("was" if invited?), "signed up on #{format_date card.created_at}"].compact.join " " end |
#verification_lines ⇒ Object
62 63 64 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 62 def verification_lines [verification_sent_line, verification_link_line].compact end |
#verification_link_line ⇒ Object
73 74 75 76 77 78 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 73 def verification_link_line links = verification_links return if links.empty? links.join " " end |
#verification_links ⇒ Object
80 81 82 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 80 def verification_links [approve_with_token_link, approve_without_token_link, deny_link].compact end |
#verification_sent_line ⇒ Object
66 67 68 69 70 71 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 66 def verification_sent_line account = card.account return unless account.email_card.ok?(:read) "A verification email has been sent to #{account.email}" end |
#view: content_formgroups ⇒ Object
18 19 20 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 18 view :content_formgroups do [account_formgroups, (multi_card_editor? ? multi_card_edit(true) : "")].join end |
#view: core ⇒ Object
34 35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 34 view :core, template: :haml, cache: :never do @lines = [signup_line] + account_lines @body = process_content _render_raw end |
#view: new ⇒ Object
13 14 15 16 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 13 view :new, cache: :never do voo.title = invitation? ? t(:account_invite) : t(:account_sign_up) super() end |
#view: new_buttons ⇒ Object
22 23 24 25 26 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 22 view :new_buttons, cache: :never do do [, ].compact end end |