Files
danbooru/app/views/post_flags/_search.html.erb
evazion 4631262374 Fix broken tag autocomplete on multiple pages.
Mark all tag <input>s with a `data-autocomplete` attribute, instead of
hardcoding a list of html IDs to autocomplete in javascript.

This way should be less error prone. It fixes autocomplete in several places:

* Autocomplete for the search box on /posts didn't work in the
  responsive layout. This was because /posts has two search boxes that
  both have the id `tags`: one in the normal sidebar, and one in the
  responsive tag list. $("#tags") only initialized autocomplete on the
  first one.

* Autocomplete didn't work on the aliases or implications pages. This
  was due to selecting the wrong html ids.
2017-04-22 15:24:03 -05:00

12 lines
1.0 KiB
Plaintext

<%= simple_form_for(:search, url: post_flags_path, method: :get, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :reason_matches, label: "Reason", hint: "Use * for wildcard searches", input_html: { value: params[:search][:reason_matches] } %>
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], data: { autocomplete: "tag-query" } } %>
<%= f.input :post_id, label: "Post ID", input_html: { value: params[:search][:post_id] } %>
<% if CurrentUser.is_moderator? %>
<%= f.input :creator_name, label: "Creator", input_html: { value: params[:search][:creator_name] } %>
<% end %>
<%= f.input :is_resolved, label: "Resolved?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:is_resolved] %>
<%= f.input :category, label: "Category", collection: ["normal", "unapproved", "rejected", "deleted", "banned"], include_blank: true, selected: params[:search][:category] %>
<%= f.submit "Search" %>
<% end %>