Sha256: a2842c407f143b52ec7941d85bcdfefac0c4a29b45e083852cac6bf2498def2a

Contents?: true

Size: 822 Bytes

Versions: 10

Compression:

Stored size: 822 Bytes

Contents

module ExpressAdmin
  class ErrorMessage < ExpressTemplates::Components::Configurable

    has_option :display, 'Display the error message, by default it is hidden', type: :boolean, default: false
    has_option :title, 'Title of the error message component', type: :string
    has_option :messages, 'List of error messages', type: :array
    has_option :status, type: :string

    contains -> {
      if config[:display]
        div(class: "card #{config[:status]}") {
          div(class: 'card-divider') {
            strong {
              text_node config[:title]
            }
          }

          div(class: 'card-section') {
            ul {
              config[:messages].each do |message|
                li { text_node message }
              end
            }
          }
        }
      end
    }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
express_admin-2.0.0.b app/components/express_admin/error_message.rb
express_admin-2.0.0.a app/components/express_admin/error_message.rb
express_admin-1.8.1 app/components/express_admin/error_message.rb
express_admin-1.8.0 app/components/express_admin/error_message.rb
express_admin-1.7.32 app/components/express_admin/error_message.rb
express_admin-1.7.31 app/components/express_admin/error_message.rb
express_admin-1.7.30 app/components/express_admin/error_message.rb
express_admin-1.7.29 app/components/express_admin/error_message.rb
express_admin-1.7.28 app/components/express_admin/error_message.rb
express_admin-1.7.27 app/components/express_admin/error_message.rb