.block
  .block__header
    span Search
  .block__content
    = form_for @conn, ~p"/commissions", [as: :commission, method: "get", class: "hform"], fn f ->
      .field = label f, :categories, "Art Categories:"

      = for {name, value} <- categories() do
        - checked = @conn.params["commission"]["category"] && Atom.to_string(name) in @conn.params["commission"]["category"]
        .field
          => checkbox f, value, checked_value: name, checked: checked, name: "commission[category][]", class: "checkbox spacing-right", hidden_input: false
          => label f, value, name

      br

      .field = label f, :item_type, "Commission Type:"
      .field = select f, :item_type, types(), class: "input"

      br

      .field = label f, :price_min, "Price:"
      .field = number_input f, :price_min, class: "input input--short", placeholder: "At Least", step: "any", min: 0
      .field = number_input f, :price_max, class: "input input--short", placeholder: "At Most", step: "any", min: 0

      br

      .field = label f, :keywords, "Search:"
      .field = text_input f, :keywords, class: "input input--short", placeholder: "Keywords"

      = submit "Search", class: "button"
