Sha256: 9f26efd76f8e531109d5aa2b7a9868fd1589000912d1352277827cd77e4e4a7f

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

# frozen_string_literal: true

module Effective
  module TableRows
    class Boolean < Effective::TableRow

      def to_html(&block)
        content_tag(:tr, class: "effective-table-summary-#{label_content.parameterize}") do
          content_tag(:td, colspan: 2) do
            content_tag(:span, content.presence || '-') + label_content
          end
        end
      end

      def content
        if value
          template.badge('Yes', class: 'badge badge-primary mr-2')
        else
          template.badge('No', class: 'badge badge-secondary mr-2')
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
effective_bootstrap-1.14.16 app/models/effective/table_rows/boolean.rb