impress/app/views/wardrobe/_search_results.html.haml
Emi Matchu 7459037c8a [WV2] Simplify item search pagination
I'll want to do it smarter than this, but for now, just getting rid of the page links altogether seems best
2025-11-26 16:58:38 -08:00

28 lines
1.3 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.search-results
.search-results-header
= button_to wardrobe_v2_path, method: :get, class: "back-button" do
← Back to outfit
= outfit_state_params except: [:q]
- if @search_results.any?
= will_paginate @search_results, page_links: false, param_name: "q[page]", params: { q: params[:q], species: @outfit.species_id, color: @outfit.color_id, objects: params[:objects] }
%ul.search-results-list
- @search_results.each do |item|
%li.item-card
.item-thumbnail
= image_tag item.thumbnail_url, alt: item.name, loading: "lazy"
.item-info
.item-name= item.name
.item-badges
= render "items/badges/kind", item: item
= render "items/badges/first_seen", item: item
= button_to wardrobe_v2_path, method: :get, class: "item-add-button", title: "Add #{item.name}", "aria-label": "Add #{item.name}" do
= outfit_state_params @outfit.with_item(item)
= will_paginate @search_results, param_name: "q[page]", params: { q: params[:q], species: @outfit.species_id, color: @outfit.color_id, objects: params[:objects] }
- else
.empty-state
%p No matching items found. Try a different search term, or browse items on the main site.