Sha256: 0ec67823f14fa6193989829fef8620f125b76a64899158ef4e4c9cb922491e9c

Contents?: true

Size: 1 KB

Versions: 12

Compression:

Stored size: 1 KB

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
    with_frame slot do
      wrap_body { yield } 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={}
    form_opts ||= {}
    frame do
      card_form action, form_opts do
        yield
      end
    end
  end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
card-1.100.0 mod/standard/set/all/rich_html/frame.rb
card-1.99.6 mod/standard/set/all/rich_html/frame.rb
card-1.99.5 mod/standard/set/all/rich_html/frame.rb
card-1.99.4 mod/standard/set/all/rich_html/frame.rb
card-1.99.3 mod/standard/set/all/rich_html/frame.rb
card-1.99.2 mod/standard/set/all/rich_html/frame.rb
card-1.99.1 mod/standard/set/all/rich_html/frame.rb
card-1.99.0 mod/standard/set/all/rich_html/frame.rb
card-1.98.3 mod/standard/set/all/rich_html/frame.rb
card-1.98.2 mod/standard/set/all/rich_html/frame.rb
card-1.98.1 mod/standard/set/all/rich_html/frame.rb
card-1.98.0 mod/standard/set/all/rich_html/frame.rb