<%= search_form_for(@q, enforce_utf8: false, url: request.path, class: 'form form-inline search-form d-flex justify-content-center mx-2 my-3') do |f| %>
<%= f.collection_select :rule_id_eq, Rule.all.sort_by(&:name), :id, :name, { include_blank: 'Filter by Rule' },
class: 'form-control form-control-sm'%>
<%= f.grouped_collection_select :npc_id_eq, Location.all.includes(:alphabetical_npcs), :alphabetical_npcs,
:name, :id, :name, { include_blank: 'Filter by NPC' }, class: 'form-control form-control-sm' %>
<%= check_box_tag :general, 1, params[:general], class: 'form-check-input checkbox' %>
<%= label_tag :general, 'General Use', class: 'form-check-label' %>
<%= check_box_tag :updated, 1, params[:updated], class: 'form-check-input checkbox' %>
<%= label_tag :updated, 'Only Updated', class: 'form-check-label' %>
<%= f.submit 'Search', name: nil, class: 'btn btn-secondary btn-sm' %>
<% end %>
| Purpose |
Rating |
Created by |
Cards |
<% if user_signed_in? %>
Usable |
<% end %>
Updated |
|
<% @decks.each do |deck| %>
| <%= purpose(deck) %> |
<%= deck.rating %> |
<%= deck.user.username.truncate(20) %> |
<% deck.cards.each do |card| %>
<%= link_to(card_path(card), data: { toggle: 'tooltip', title: "#{card.name}" },
class: ('card-missing' if @user_cards.present? && !@user_cards.include?(card.id))) do %>
<%= small_image(card) %>
<% end %>
<% end %>
|
<% if user_signed_in? %>
<%= usable?(deck, @user_cards) %>
|
<% end %>
<%= deck_patch(deck) %> |
<% if deck.user_id == current_user&.id %>
<%= link_to fa_icon('pencil', class: 'btn btn-secondary btn-sm'), edit_deck_path(deck) %>
<% end %>
<%= link_to fa_icon('list', class: 'btn btn-secondary btn-sm'), deck_path(deck) %>
|
<% end %>