Module: Card::Set::All::Comment::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb
Instance Method Summary collapse
-
#comment_author ⇒ Object
-
#comment_author_label ⇒ Object
-
#comment_box ⇒ Object
-
#comment_buttons ⇒ Object
-
#comment_signature ⇒ Object
-
#comment_submit_button ⇒ Object
-
#comment_with_signature ⇒ Object
-
#hidden_comment_fields ⇒ Object
-
#view: comment_box ⇒ Object
Instance Method Details
#comment_author ⇒ Object
45 46 47 48 49 50 51 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 45 def if Auth.signed_in? "[[#{Auth.current.name}]]" else "#{card.} (Not signed in)" end end |
#comment_author_label ⇒ Object
81 82 83 84 85 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 81 def return if Auth.signed_in? %(<label>My Name is:</label> #{text_field :comment_author}) end |
#comment_box ⇒ Object
71 72 73 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 71 def comment_box text_area :comment, rows: 3 end |
#comment_buttons ⇒ Object
75 76 77 78 79 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 75 def wrap_with :div, class: "comment-buttons" do [, ] end end |
#comment_signature ⇒ Object
39 40 41 42 43 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 39 def comment_signature wrap_with :div, class: "w-comment-author" do "#{}.....#{Time.zone.now}" end end |
#comment_submit_button ⇒ Object
87 88 89 90 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 87 def text: "Comment", type: :submit, disable_with: "Commenting", situation: "outline-primary" end |
#comment_with_signature ⇒ Object
35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 35 def comment_with_signature "#{card.clean_comment}\n#{comment_signature}" end |
#hidden_comment_fields ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 62 def hidden_comment_fields return unless card.new_card? hidden_field_tag "card[name]", card.name # FIXME: wish we had more generalized solution for names. # without this, nonexistent cards will often take left's linkname. # (needs test) end |
#view: comment_box ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 53 view :comment_box, denial: :blank, unknown: true, perms: :update do wrap_with :div, class: "comment-box nodblclick" do action = card.new_card? ? :create : :update card_form action do [hidden_comment_fields, comment_box, ] end end end |