Skip to content

Commit

Permalink
Refactoring to use new component
Browse files Browse the repository at this point in the history
  • Loading branch information
eddierubeiz committed Dec 10, 2024
1 parent 99984c8 commit 6c2fc92
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/components/search_result/base_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<% end %>

<% if model.work? %>
<div class="scihist-results-list-item-box-and-folder"><%= display_box_and_folder %></div>
<div class="scihist-results-list-item-box-and-folder"><%= render WorkPhysicalContainerComponent.new(model) %></div>
<% end %>

<% if display_dates.present? %>
Expand Down
8 changes: 0 additions & 8 deletions app/components/search_result/work_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ def link_to_href
url_to_work(model)
end

def display_box_and_folder
return nil if model&.physical_container.nil?
container = model.physical_container
box = "Box #{container.box}" if container.box.present?
folder = "Folder #{container.folder}" if container.folder.present?
[box, folder].compact.join (", ")
end

# Returns a hash of lables and values for display on the tabular metadata field, for
# subjects and creators.
#
Expand Down
2 changes: 1 addition & 1 deletion app/components/work_show_info_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<td>
<ul>
<li class="attribute">
<%= physical_container.display_as %>
<%= render WorkPhysicalContainerComponent.new(@work) %>
</li>
</ul>
</td>
Expand Down

0 comments on commit 6c2fc92

Please sign in to comment.