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.
20 lines
804 B
Plaintext
20 lines
804 B
Plaintext
<div id="c-artist-commentaries">
|
|
<div id="a-search">
|
|
<h1>Search Artist Commentary</h1>
|
|
|
|
<%= simple_form_for(:search, url: artist_commentaries_path, method: :get, defaults: { required: false }) do |f| %>
|
|
<%= f.input :text_matches, label: "Text" %>
|
|
<%= f.input :post_tags_match, label: "Tags", input_html: { data: { autocomplete: "tag-query" } } %>
|
|
<%= f.input :original_present, label: "Original present?", collection: ["yes", "no"], include_blank: true %>
|
|
<%= f.input :translated_present, label: "Translation present?", collection: ["yes", "no"], include_blank: true %>
|
|
<%= f.submit "Search" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<%= render "secondary_links" %>
|
|
|
|
<% content_for(:page_title) do %>
|
|
Search Artist Commentary - <%= Danbooru.config.app_name %>
|
|
<% end %>
|