Sha256: 42d293ba7fc441edd6ba955f798beb07b2e84e29b3670ebc7068b16d03b3cd81

Contents?: true

Size: 1005 Bytes

Versions: 1

Compression:

Stored size: 1005 Bytes

Contents

format :html do
  view :flash, cache: :never, tags: :unknown_ok 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
    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
        output yield
      end
    end
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
card-1.97.0 mod/standard/set/all/rich_html/frame.rb