module Spyro::ActionViewExtension::HeadersHelper

Public Instance Methods

box_header(name, &block) click to toggle source
# File lib/spyro/helpers/action_view_extension.rb, line 104
def box_header name, &block
  @has_group = false

  capture_haml do
    haml_tag :div, :class => ["panel-heading"] do
      haml_tag :div, :class => "row" do
        haml_tag :div, :class => "col-lg-12" do
          haml_tag :h2, :class => ["panel-title", 'col-sm-8'], :style => "padding: 8px 0px;" do
            haml_concat name
          end
          if block_given?
            haml_tag :div, :class => ['controls', 'col-sm-4', 'text-right'] do
              content = capture(&block)
              haml_concat (@has_group ? content : group { content })
            end
            haml_tag :div, :class => ['clear']
          end
        end
      end
    end
  end
end
header(name = "", &block) click to toggle source
# File lib/spyro/helpers/action_view_extension.rb, line 75
def header name = "", &block
  if @inside_box
    box_header name, &block
  else
    page_header name, &block
  end
end
page_header(name, &block) click to toggle source
# File lib/spyro/helpers/action_view_extension.rb, line 83
def page_header name, &block
  @has_group = false

  content_for :title do
    name
  end

  capture_haml do
    haml_tag :h1, :class => ['page-header'] do
      haml_concat name
      if block_given?
        haml_tag :div, :class => ['pull-right'] do
          content = capture(&block)
          haml_concat (@has_group ? content : group { content })
        end
        haml_tag :div, :class => ['clear']
      end
    end
  end
end