Sha256: 6700c84a12200c509fb999600d43936b6d523b82f88f5ad8ddd1044a5c555d39
Contents?: true
Size: 811 Bytes
Versions: 17
Compression:
Stored size: 811 Bytes
Contents
# frozen_string_literal: true module Blacklight class MetadataFieldLayoutComponent < Blacklight::Component with_collection_parameter :field renders_one :label renders_many :values, (lambda do |value: nil, &block| if @value_tag.nil? block&.call || value elsif block content_tag @value_tag, class: "#{@value_class} blacklight-#{@key}", &block else content_tag @value_tag, value, class: "#{@value_class} blacklight-#{@key}" end end) # @param field [Blacklight::FieldPresenter] def initialize(field:, value_tag: 'dd', label_class: 'col-md-3', value_class: 'col-md-9') @field = field @key = @field.key.parameterize @label_class = label_class @value_tag = value_tag @value_class = value_class end end end
Version data entries
17 entries across 17 versions & 2 rubygems