<% route = fn p -> ~p"/galleries?#{p}" end pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @galleries, route: route, params: [gallery: @conn.params["gallery"]]) %>

Search Galleries

<%= form_for @conn, ~p"/galleries", [as: :gallery, method: "get", class: "hform"], fn f -> %>
<%= label(f, :title, "Title") %>
<%= text_input(f, :title, class: "input hform__text", placeholder: "Gallery title (* as wildcard)") %>
<%= label(f, :description, "Description") %>
<%= textarea(f, :description, class: "input hform__text", placeholder: "Gallery description") %>
<%= label(f, :creator, "Creator") %>
<%= text_input(f, :creator, class: "input hform__text", placeholder: "Gallery creator (exact match)") %>
<%= label(f, :include_image, "Include image") %>
<%= number_input(f, :include_image, class: "input hform__text", placeholder: "Image ID (e.g. 100)") %>
<%= label(f, :sf, "Sort by") %>
<%= select(f, :sf, ["Creation Date": "created_at", "Update Date": "updated_at", "Image Count": "image_count", Relevance: "_score"], class: "input") %> <%= select(f, :sd, [Descending: "desc", Ascending: "asc"], class: "input") %>
<%= submit("Search", class: "button button--state-primary") %> <% end %>
<%= if Enum.any?(@galleries) do %> <%= for gallery <- @galleries do %> <%= render(PhilomenaWeb.GalleryView, "_gallery.html", gallery: gallery, conn: @conn) %> <% end %> <% else %>
No galleries found!
<% end %>