My Uploads

<%= search_form_for(current_page_path) do |f| %> <%= f.input :ai_tags_match, label: "Tags", input_html: { value: params.dig(:search, :ai_tags_match), data: { autocomplete: "tag-query" } } %> <%= f.input :status, collection: %w[pending completed error], include_blank: true, selected: params.dig(:search, :status) %> <%= f.input :is_posted, as: :hidden, input_html: { value: params.dig(:search, :is_posted) } %> <%= f.input :min_score, as: :hidden, input_html: { value: params.dig(:search, :min_score) } %> <%= f.input :order, collection: [%w[Newest id], %w[Oldest id_asc]], include_blank: true, selected: params[:search][:order] %> <%= f.submit "Search" %> <% end %>
<%= link_to "All", current_page_path(search: search_params.to_h.without("is_posted")), class: ["inline-block p-1 pb-2", (search_params[:is_posted].nil? ? "border-current border-b-2 -mb-px" : "inactive-link")] %> <%= link_to "Posted", current_page_path(search: search_params.merge(is_posted: true)), class: ["inline-block p-1 pb-2", (search_params[:is_posted].to_s.truthy? ? "border-current border-b-2 -mb-px" : "inactive-link")] %> <%= link_to "Unposted", current_page_path(search: search_params.merge(is_posted: false)), class: ["inline-block p-1 pb-2", (search_params[:is_posted].to_s.falsy? ? "border-current border-b-2 -mb-px" : "inactive-link")] %> <%= render PreviewSizeMenuComponent.new(current_size: @preview_size) %> <% if @mode == "table" %> <%= link_to grid_icon, current_page_path(mode: nil), title: "Gallery", class: "inline-block p-1 pb-2 rounded inactive-link" %> <% else %> <%= link_to list_icon, current_page_path(mode: "table"), title: "Table", class: "inline-block p-1 pb-2 rounded inactive-link" %> <% end %>
<% if @mode == "gallery" %> <%= render "uploads/gallery", uploads: @uploads, size: @preview_size %> <% elsif @mode == "table" %> <%= render "uploads/table", uploads: @uploads %> <% end %>
<%= render "uploads/secondary_links" %>