Skip to content

Commit

Permalink
Fix catalog partial path lookup to include the view root too
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 25, 2014
1 parent 1334888 commit c6e0b74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/blacklight/blacklight_helper_behavior.rb
Expand Up @@ -412,7 +412,7 @@ def render_document_index_with_view view, documents, locals = {}
document_index_path_templates.each do |str|
partial = str % { index_view_type: view }
logger.debug "Looking for document index partial #{partial}"
template = lookup_context.find_all(partial, lookup_context.prefixes, true, locals.keys + [:documents], {}).first
template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:documents], {}).first
return template.render(self, locals.merge(documents: documents)) if template
end

Expand Down Expand Up @@ -501,7 +501,7 @@ def render_document_partial(doc, base_name, locals = {})
document_partial_path_templates.each do |str|
partial = str % { action_name: base_name, format: format, index_view_type: document_index_view_type }
logger.debug "Looking for document partial #{partial}"
template = lookup_context.find_all(partial, lookup_context.prefixes, true, locals.keys + [:document], {}).first
template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:document], {}).first
return template.render(self, locals.merge(document: doc)) if template
end

Expand Down

0 comments on commit c6e0b74

Please sign in to comment.