Sha256: ae0131813d3847766eaca332aa6208b59264bc540f2a9f0f23396f777c1424aa

Contents?: true

Size: 1.81 KB

Versions: 18

Compression:

Stored size: 1.81 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; module Right; module Following; extend Card::Set
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/right/following.rb ~~~~~~~~~~~

def virtual?; !real? end


format :html do

  view :core do |args|
    if card.left && Auth.signed_in?
      render_rule_editor args
    else
      fname = "#{card.cardname.left}+#{Card[:followers].name}"
      fcard = Card.fetch fname
      nest fcard, view: :titled, item: :link
    end
  end

  view :status do |args|
    if (rcard = current_follow_rule_card)
      rcard.item_cards.map do |item|
        %{<div class="alert alert-success" role="alert">
          <strong>#{rcard.rule_set.follow_label}</strong>: #{item.title}
         </div>}
      end.join
    else
      'No following preference'
    end
  end

  view :closed_content do |args|
    ''
  end

=begin
   view :editor do |args|
     hidden_field( :content, class: 'card-content', 'no-autosave'=>true) +
        (args.delete(:select_list) ? raw(render_rule_editor(args)) : super(args) )
   end
=end

  view :rule_editor do |args|
    preference_name = [
      card.left.default_follow_set_card.name,
      Auth.current.name,
      Card[:follow].name
    ]*'+'
    rule_context = Card.fetch preference_name, new: { type_id: PointerID }

    wrap_with :div, class: 'edit-rule' do
      follow_context = current_follow_rule_card || rule_context
      subformat(follow_context).render_edit_rule(
        rule_context: rule_context,
        success: { view: 'status', id: card.name }
      )
    end
  end

  def current_follow_rule_card
    card.left.rule_card :follow, user: Auth.current
  end

end


# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/right/following.rb ~~~~~~~~~~~
end;end;end;end;

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
card-1.18.6 tmpsets/set/mod006-05_email/right/following.rb
card-1.18.5 tmpsets/set/mod006-05_email/right/following.rb
card-1.18.4 tmpsets/set/mod006-05_email/right/following.rb
card-1.18.3 tmpsets/set/mod006-05_email/right/following.rb
card-1.18.2 tmpsets/set/mod006-05_email/right/following.rb
card-1.18.1 tmpsets/set/mod006-05_email/right/following.rb
card-1.18.0 tmpsets/set/mod006-05_email/right/following.rb
card-1.17.4 tmpsets/set/mod006-05_email/right/following.rb
card-1.17.3 tmpsets/set/mod006-05_email/right/following.rb
card-1.17.2 tmpsets/set/mod006-05_email/right/following.rb
card-1.17.1 tmpsets/set/mod006-05_email/right/following.rb
card-1.17.0 tmpsets/set/mod006-05_email/right/following.rb
card-1.16.15 tmpsets/set/mod006-05_email/right/following.rb
card-1.16.14 tmpsets/set/mod006-05_email/right/following.rb
card-1.16.13 tmpsets/set/mod006-05_email/right/following.rb
card-1.16.12 tmpsets/set/mod006-05_email/right/following.rb
card-1.16.11 tmpsets/set/mod006-05_email/right/following.rb
card-1.16.10 tmpsets/set/mod006-05_email/right/following.rb