Sha256: 40055e9fa5a312805c52df455e7b25a6aec731585adf2856ca7c36fd870820b9

Contents?: true

Size: 632 Bytes

Versions: 6

Compression:

Stored size: 632 Bytes

Contents

module ExpressAdmin
  module Components
    module Layout

      class Pane < LayoutComponent

        has_option :title, 'The title of the pane', default: ''
        has_option :status, 'Status of the pane'

        prepends -> {
          heading if title || status
        }

        def heading
          h4(class: 'title') {
            current_arbre_element.add_child title
            if status
              span(class: 'status') { status }
            end
          }
        end

        def title
          config[:title]
        end

        def status
          config[:status]
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
express_admin-1.6.11 app/components/express_admin/layout_components/pane.rb
express_admin-1.6.10 app/components/express_admin/layout_components/pane.rb
express_admin-1.6.9 app/components/express_admin/layout_components/pane.rb
express_admin-1.6.8 app/components/express_admin/layout_components/pane.rb
express_admin-1.6.7 app/components/express_admin/layout_components/pane.rb
express_admin-1.6.4 app/components/express_admin/layout_components/pane.rb