Sha256: 7dfb4458c23f3ba2be29d62f01aefd0e3f3b222961edbbc5f278f5f5fbeb1962

Contents?: true

Size: 1014 Bytes

Versions: 21

Compression:

Stored size: 1014 Bytes

Contents

format :html do
  view :flash, cache: :never, unknown: true, perms: :none do
    flash_notice = params[:flash] || Env.success.flash
    return "" unless flash_notice.present? && focal?

    Array(flash_notice).join "\n"
  end

  def frame &block
    standard_frame(&block)
  end

  def standard_frame slot=true, &block
    with_frame slot do
      wrap_body(&block) if block_given?
    end
  end

  def with_frame slot=true, header=frame_header, slot_opts={}
    voo.hide :help
    add_name_context
    wrap slot, slot_opts do
      panel do
        [header, frame_help, render_flash, (yield if block_given?)]
      end
    end
  end

  def frame_header
    _render_header
  end

  def frame_help
    with_class_up "help-text", "alert alert-info" do
      _render :help
    end
  end

  def frame_and_form action, form_opts={}, &block
    form_opts ||= {}
    frame do
      card_form action, form_opts, &block
    end
  end

  def panel &block
    wrap_with :div, class: classy("d0-card-frame"), &block
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
card-mod-format-0.16.0 set/all/html/frame.rb
card-mod-format-0.15.6 set/all/html/frame.rb
card-mod-format-0.15.5 set/all/html/frame.rb
card-mod-format-0.15.4 set/all/html/frame.rb
card-mod-format-0.15.3 set/all/html/frame.rb
card-mod-format-0.15.2.pre1 set/all/html/frame.rb
card-mod-format-0.15.1.1 set/all/html/frame.rb
card-mod-format-0.15.1 set/all/html/frame.rb
card-mod-format-0.15.0 set/all/html/frame.rb
card-mod-format-0.14.2 set/all/html/frame.rb
card-mod-format-0.14.1 set/all/html/frame.rb
card-mod-format-0.14.0 set/all/html/frame.rb
card-mod-format-0.13.4 set/all/frame.rb
card-mod-format-0.13.3 set/all/frame.rb
card-mod-format-0.13.2 set/all/frame.rb
card-mod-format-0.13.1 set/all/frame.rb
card-mod-format-0.13.0 set/all/frame.rb
card-mod-format-0.11.7 set/all/frame.rb
card-mod-format-0.12.0 set/all/frame.rb
card-mod-format-0.11.6 set/all/frame.rb