%
helper = Scrapbook::HelperForView.new(self)
listing = Scrapbook::FolderListingViewModel.new(self, scrapbook, pathname)
pathname_without_handler_exts = helper.remove_handler_exts_from(pathname)
%>
<% unless listing.root? %><%= link_to "‹ #{listing.parent_display_name}", helper.short_path_to(listing.pathname.parent), class: 'back-to-parent block w-100' %><% end %>
<% if listing.pathname == pathname %><%= listing.header_name %><% else %><%= link_to(listing.header_name, helper.short_path_to(listing.pathname), class: 'block w-100') %><% end %>
<% listing.folders.each do |folder| %>- <%= link_to "#{folder.basename}/", helper.short_path_to(folder, scrapbook), class: 'block w-100' %>
<% end %>
<% listing.files.each do |file| %><% next if listing.folders.include?(file) %>- <% if file == pathname_without_handler_exts %><%= file.basename %><% else %><%= link_to file.basename, helper.short_path_to(file, scrapbook), class: 'block w-100' %><% end %>
<% end %>