Skip to content

Commit

Permalink
Fix backwards show_order logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fbacall committed Oct 25, 2024
1 parent e08f87a commit 6eed8ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/views/learning_paths/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@

<ul style="padding-left: 0; overflow: auto;">
<% lpt.topic.material_items.each do |object| %>
<%= render partial: object.to_partial_path, locals: { learning_path_topic_item: object,
<%= render partial: object.to_partial_path, locals: { show_order: false,
learning_path_topic_item: object,
topic_link: lpt } %>
<% end %>
</ul>
Expand Down
6 changes: 5 additions & 1 deletion app/views/materials/_material.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<% learning_path_topic_item ||= nil %>
<% collection_item ||= learning_path_topic_item %>
<% link_params = (defined? topic_link) ? learning_path_breadcrumb_param(topic_link, collection_item) : {} %>
<% show_order = false unless defined? show_order %>
<%
unless defined? show_order
show_order = true
end
%>
<li class="masonry-brick media-item long">
<%= link_to material_path(material, **link_params), class: 'link-overlay' do %>
<%= item_order_badge(collection_item) if show_order && collection_item %>
Expand Down

0 comments on commit 6eed8ca

Please sign in to comment.