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
-
#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
53 54 55 56 57 58 59 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 53 def account_lines if card.account verification_lines else [t(:account_missing_account)] end end |
#approval_link(text, with_or_without) ⇒ Object
92 93 94 95 96 97 98 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 92 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
83 84 85 86 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 83 def approve_with_token_link action = card.account.status == "unverified" ? "Resend" : "Send" approval_link "#{action} verification email", :with end |
#approve_without_token_link ⇒ Object
88 89 90 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 88 def approve_without_token_link approval_link "Approve without verification", :without end |
#deny_link ⇒ Object
100 101 102 103 104 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 100 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
45 46 47 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 45 def invited? !self_signup? end |
#self_signup? ⇒ Boolean
49 50 51 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 49 def self_signup? card.creator_id == AnonymousID end |
#signup_line ⇒ Object
39 40 41 42 43 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 39 def signup_line ["<strong>#{safe_name}</strong>", ("was" if invited?), "signed up on #{format_date card.created_at}"].compact.join " " end |
#verification_lines ⇒ Object
61 62 63 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 61 def verification_lines [verification_sent_line, verification_link_line].compact end |
#verification_link_line ⇒ Object
72 73 74 75 76 77 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 72 def verification_link_line links = verification_links return if links.empty? links.join " " end |
#verification_links ⇒ Object
79 80 81 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 79 def verification_links [approve_with_token_link, approve_without_token_link, deny_link].compact end |
#verification_sent_line ⇒ Object
65 66 67 68 69 70 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb', line 65 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, (card.structure ? edit_slot : "")].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 |