Files
danbooru/app/views/posts/partials/index/_mode_menu.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

31 lines
1.2 KiB
Plaintext

<% if CurrentUser.is_gold? %>
<section id="mode-box">
<h1>Mode</h1>
<form action="/">
<select name="mode">
<option value="view">View</option>
<option value="edit">Edit</option>
<option value="tag-script">Tag script</option>
<option value="add-fav">Favorite</option>
<option value="remove-fav">Unfavorite</option>
<option value="rating-s">Rate safe</option>
<option value="rating-q">Rate questionable</option>
<option value="rating-e">Rate explicit</option>
<option value="vote-up">Vote up</option>
<option value="vote-down">Vote down</option>
<% if CurrentUser.is_builder? %>
<option value="lock-rating">Lock rating</option>
<option value="lock-note">Lock notes</option>
<% end %>
<% if CurrentUser.can_approve_posts? %>
<option value="approve">Approve</option>
<% end %>
<% if CurrentUser.is_admin? %>
<option value="ban">Ban</option>
<% end %>
</select>
</form>
<input id="tag-script-field" data-autocomplete="tag-edit" placeholder="Enter tag script" style="display: none; margin-top: 0.5em;"></input>
</section>
<% end %>