Module: Card::Set::All::Comment::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod021-standard/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
Instance Method Details
#comment_author ⇒ Object
43 44 45 46 47 48 49 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 43 def if Auth.signed_in? "[[#{Auth.current.name}]]" else "#{card.} (Not signed in)" end end |
#comment_author_label ⇒ Object
78 79 80 81 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 78 def return if Auth.signed_in? %(<label>My Name is:</label> #{text_field :comment_author}) end |
#comment_box ⇒ Object
68 69 70 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 68 def comment_box text_area :comment, rows: 3 end |
#comment_buttons ⇒ Object
72 73 74 75 76 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 72 def wrap_with :div, class: "comment-buttons" do [, ] end end |
#comment_signature ⇒ Object
37 38 39 40 41 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 37 def comment_signature wrap_with :div, class: "w-comment-author" do "#{}.....#{Time.zone.now}" end end |
#comment_submit_button ⇒ Object
83 84 85 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 83 def text: "Comment", type: :submit, disable_with: "Commenting" end |
#comment_with_signature ⇒ Object
33 34 35 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 33 def comment_with_signature card.clean_comment + "\n" + comment_signature end |
#hidden_comment_fields ⇒ Object
60 61 62 63 64 65 66 |
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 60 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 |