Sha256: 0066d757b46a5f0f31b53856aad945e3389de36be8382795d9369e1440e170d0

Contents?: true

Size: 1.74 KB

Versions: 6

Compression:

Stored size: 1.74 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; module All; module Comment; extend Card::Set
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/comment.rb ~~~~~~~~~~~
event :add_comment, after: :approve, on: :save, when: proc {|c| c.comment } do
  self.content = %{
    #{ content }
    #{ '<hr>' unless content.blank? }
    #{ comment.split(/\n/).map {|line| "<p>#{line.strip.empty? ? '&nbsp;' : line}</p>"} * "\n" }
    <div class="w-comment-author">--#{
      if Auth.signed_in?
        "[[#{Auth.current.name}]]"
      else
        Env.session[:comment_author] = comment_author if Env.session
        "#{ comment_author } (Not signed in)"
      end
    }.....#{Time.now}</div>
  }
end

view( :comment_box, denial: :blank, tags: :unknown_ok, perms: lambda { |r| r.card.ok? :comment } ) do |args|


  %{<div class="comment-box nodblclick"> #{
    card_form :update do
      %{
        #{ hidden_field_tag( 'card[name]', card.name ) if card.new_card?
        # FIXME wish we had more generalized solution for names.  without this, nonexistent cards will often take left's linkname.  (needs test)
        }
        #{ text_area :comment, rows: 3 }
        <div class="comment-buttons">
          #{
            unless Auth.signed_in?
              card.comment_author= (session[:comment_author] || params[:comment_author] || "Anonymous") #ENGLISH
              %{<label>My Name is:</label> #{ text_field :comment_author }}
            end
          }
          #{ button_tag 'Comment', type: :submit, disable_with: "Commenting" }
        </div>
      }
    end}
  </div>}
end


# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/comment.rb ~~~~~~~~~~~
end;end;end;end;

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
card-1.16.15 tmpsets/set/mod007-05_standard/all/comment.rb
card-1.16.14 tmpsets/set/mod007-05_standard/all/comment.rb
card-1.16.13 tmpsets/set/mod007-05_standard/all/comment.rb
card-1.16.12 tmpsets/set/mod007-05_standard/all/comment.rb
card-1.16.11 tmpsets/set/mod007-05_standard/all/comment.rb
card-1.16.10 tmpsets/set/mod007-05_standard/all/comment.rb