Sha256: c2ea321de2a230e8e7a258a62790c88dfc8b990c63775e4148dd98fea3c263f7

Contents?: true

Size: 681 Bytes

Versions: 13

Compression:

Stored size: 681 Bytes

Contents

format :html do
  def show view, args
    content = send show_method, view, args
    Env.ajax? ? content : wrap_with_html_page(content)
  end

  wrapper :html_page do
    <<-HTML.strip_heredoc
      <!DOCTYPE HTML>
      <html class="h-100">
        <head>
          #{nest card.rule_card(:head), view: :head_content}
        </head>
        #{interior}
      </html>
    HTML
  end

  private

  def show_without_page_layout view, args
    @main = true if params[:is_main] || args[:main]
    args.delete(:layout)
    view ||= args[:home_view] || default_page_view
    render! view, args
  end

  def show_method
    "show_#{show_layout? ? :with : :without}_page_layout"
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
card-mod-format-0.17.0 set/all/html/show.rb
card-mod-format-0.16.0 set/all/html/show.rb
card-mod-format-0.15.6 set/all/html/show.rb
card-mod-format-0.15.5 set/all/html/show.rb
card-mod-format-0.15.4 set/all/html/show.rb
card-mod-format-0.15.3 set/all/html/show.rb
card-mod-format-0.15.2.pre1 set/all/html/show.rb
card-mod-format-0.15.1.1 set/all/html/show.rb
card-mod-format-0.15.1 set/all/html/show.rb
card-mod-format-0.15.0 set/all/html/show.rb
card-mod-format-0.14.2 set/all/html/show.rb
card-mod-format-0.14.1 set/all/html/show.rb
card-mod-format-0.14.0 set/all/html/show.rb