app/presenters/blacklight/document_presenter.rb in blacklight-6.0.0.pre3 vs app/presenters/blacklight/document_presenter.rb in blacklight-6.0.0.pre4
- old
+ new
@@ -97,33 +97,19 @@
# @return [String]
def render_values(values, field_config = nil)
options = {}
options = field_config.separator_options if field_config && field_config.separator_options
- if field_config && field_config.separator
- Deprecation.warn(self.class, 'The field configuration #separator is deprecated. Use #separator_options instead')
- options[:words_connector] ||= field_config.separator
- options[:two_words_connector] ||= field_config.separator
- options[:last_word_connector] ||= field_config.separator
- end
-
values.map { |x| html_escape(x) }.to_sentence(options).html_safe
end
##
# Render the document index heading
#
- # @param [Hash] opts (Deprecated)
- # @option opts [Symbol] :label Render the given field from the document
- # @option opts [Proc] :label Evaluate the given proc
- # @option opts [String] :label Render the given string
# @param [Symbol, Proc, String] field Render the given field or evaluate the proc or render the given string
- def render_document_index_label field, opts ={}
- if field.is_a? Hash
- Deprecation.warn DocumentPresenter, "Calling render_document_index_label with a hash is deprecated"
- field = field[:label]
- end
+ # @param [Hash] opts
+ def render_document_index_label(field, opts = {})
label = case field
when Symbol
@document[field]
when Proc
field.call(@document, opts)
@@ -209,10 +195,10 @@
end
# rendering values
case
when (field_config and field_config.helper_method)
- @controller.send(field_config.helper_method, options.merge(:document => @document, :field => field, :value => value))
+ @controller.send(field_config.helper_method, options.merge(document: @document, field: field, config: field_config, value: value))
when (field_config and field_config.link_to_search)
link_field = if field_config.link_to_search === true
field_config.key
else
field_config.link_to_search