Fix #4162: Remove browser autocomplete from most inputs.
This commit is contained in:
@@ -197,6 +197,11 @@ module ApplicationHelper
|
||||
simple_form_for(:search, method: method, url: url, defaults: defaults, html: html_options, &block)
|
||||
end
|
||||
|
||||
def edit_form_for(model, **options, &block)
|
||||
options[:html] = { autocomplete: "off", **options[:html].to_h }
|
||||
simple_form_for(model, **options, &block)
|
||||
end
|
||||
|
||||
def table_for(*options, &block)
|
||||
table = TableBuilder.new(*options, &block)
|
||||
render "table_builder/table", table: table
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Edit User: <%= @user.name %></h1>
|
||||
|
||||
<%= simple_form_for(@user, url: admin_user_path(@user), method: :put) do |f| %>
|
||||
<%= edit_form_for(@user, url: admin_user_path(@user)) do |f| %>
|
||||
<%= f.input :level, collection: User.level_hash.to_a, selected: @user.level %>
|
||||
<%= f.input :can_upload_free, label: "Unrestricted Uploads", as: :boolean, selected: @user.can_upload_free %>
|
||||
<%= f.input :can_approve_posts, label: "Approve Posts", as: :boolean, selected: @user.can_approve_posts %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= simple_form_for(@artist) do |f| %>
|
||||
<%= edit_form_for(@artist) do |f| %>
|
||||
<% if @artist.new_record? %>
|
||||
<%= f.input :name, as: :string, input_html: { data: { autocomplete: "tag" } } %>
|
||||
<% else %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= simple_form_for(ban) do |f| %>
|
||||
<%= edit_form_for(ban) do |f| %>
|
||||
<%= error_messages_for("ban") %>
|
||||
|
||||
<%= f.input :user_name, :as => :string, :input_html => { data: { autocomplete: "user" } } %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Edit Ban</h1>
|
||||
|
||||
<%= simple_form_for(@ban) do |f| %>
|
||||
<%= edit_form_for(@ban) do |f| %>
|
||||
<%= error_messages_for("ban") %>
|
||||
|
||||
<%= f.input :duration, :hint => "in days" %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= simple_form_for(@bulk_update_request) do |f| %>
|
||||
<%= edit_form_for(@bulk_update_request) do |f| %>
|
||||
<%= error_messages_for("bulk_update_request") %>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= error_messages_for :comment %>
|
||||
|
||||
<%= simple_form_for(comment, :html => {:style => ("display: none;" if local_assigns[:hidden]), :class => "edit_comment"}) do |f| %>
|
||||
<%= edit_form_for(comment, html: { style: ("display: none;" if local_assigns[:hidden]), class: "edit_comment" }) do |f| %>
|
||||
<%= f.hidden_field :post_id %>
|
||||
<%= dtext_field "comment", "body", :classes => "autocomplete-mentions", :value => comment.body, :input_id => "comment_body_for_#{comment.id}", :preview_id => "dtext-preview-for-#{comment.id}" %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= simple_form_for(dmail) do |f| %>
|
||||
<%= edit_form_for(dmail) do |f| %>
|
||||
<%= f.input :to_name, :label => "To", :input_html => { value: dmail.to.try(:name), data: { autocomplete: "user" } } %>
|
||||
<%= f.input :title, :as => :string %>
|
||||
<%= dtext_field "dmail", "body" %>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<%= simple_form_for(@favorite_group, :format => :js, :html => {:id => "ordering-form"}) do |f| %>
|
||||
<%= edit_form_for(@favorite_group, :format => :js, :html => {:id => "ordering-form"}) do |f| %>
|
||||
<%= submit_tag "Save" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<%= error_messages_for "favorite_group" %>
|
||||
|
||||
<%= simple_form_for(@favorite_group) do |f| %>
|
||||
<%= edit_form_for(@favorite_group) do |f| %>
|
||||
<%= f.input :name, :as => :string, :input_html => { :value => @favorite_group.pretty_name } %>
|
||||
<%= f.input :post_ids, :label => "Posts" %>
|
||||
<%= f.input :is_public %>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<%= error_messages_for "favorite_group" %>
|
||||
|
||||
<%= simple_form_for(@favorite_group) do |f| %>
|
||||
<%= edit_form_for(@favorite_group) do |f| %>
|
||||
<%= f.input :name, :as => :string, :required => true %>
|
||||
<%= f.input :post_ids, :label => "Posts" %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= error_messages_for("forum_post") %>
|
||||
|
||||
<%= simple_form_for(forum_post) do |f| %>
|
||||
<%= edit_form_for(forum_post) do |f| %>
|
||||
<%= dtext_field "forum_post", "body", :value => forum_post.body, :classes => "autocomplete-mentions", :input_id => "forum_post_body_for_#{forum_post.id}", :preview_id => "dtext-preview-for-#{forum_post.id}" %>
|
||||
|
||||
<%= f.button :submit, "Submit" %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= error_messages_for("forum_post") %>
|
||||
|
||||
<%= simple_form_for(forum_post) do |f| %>
|
||||
<%= edit_form_for(forum_post) do |f| %>
|
||||
<% if @forum_topic %>
|
||||
<%= f.input :topic_id, :as => :hidden %>
|
||||
<% else %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%= error_messages_for("forum_topic") %>
|
||||
|
||||
<div id="form-content">
|
||||
<%= simple_form_for(forum_topic) do |f| %>
|
||||
<%= edit_form_for(forum_topic) do |f| %>
|
||||
<%= f.input :title %>
|
||||
|
||||
<div class="input">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<%= error_messages_for "ip_ban" %>
|
||||
|
||||
<%= simple_form_for(@ip_ban) do |f| %>
|
||||
<%= edit_form_for(@ip_ban) do |f| %>
|
||||
<%= f.input :ip_addr, label: "IP Address", as: :string, hint: "Add /24 to ban a subnet. Example: 1.2.3.4/24" %>
|
||||
<%= f.input :reason %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<h1>API Key</h1>
|
||||
<p>You must re-enter your password to view or change your API key.</p>
|
||||
|
||||
<%= simple_form_for CurrentUser.user, url: view_user_api_key_path(CurrentUser.user), method: :post do |f| %>
|
||||
<%= edit_form_for CurrentUser.user, url: view_user_api_key_path(CurrentUser.user), method: :post do |f| %>
|
||||
<%= f.input :password, :as => :password, :input_html => {:autocomplete => "off"} %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<% end %>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= simple_form_for @dmail_filter, :url => maintenance_user_dmail_filter_path(:dmail_id => @dmail.id), :method => :put do |f| %>
|
||||
<%= edit_form_for @dmail_filter, :url => maintenance_user_dmail_filter_path(:dmail_id => @dmail.id) do |f| %>
|
||||
<div class="input text optional field_with_hint">
|
||||
<label class="text" for="dmail_filter_words">Banned Words</label>
|
||||
<%= text_area_tag "dmail_filter[words]", @dmail_filter.words, :id => "dmail_filter_words", :class => "text", :style => "height: 10em;" %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Change Password</h1>
|
||||
|
||||
<%= simple_form_for @user do |f| %>
|
||||
<%= edit_form_for @user do |f| %>
|
||||
<%= f.input :old_password, :as => :password, :input_html => {:autocomplete => "off"} %>
|
||||
<%= f.input :password, :label => "New password", :input_html => {:autocomplete => "off"} %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Mass Edit</h1>
|
||||
|
||||
<%= simple_form_for(:tag, url: moderator_tag_path, method: :put) do |f| %>
|
||||
<%= edit_form_for(:tag, url: moderator_tag_path, method: :put) do |f| %>
|
||||
<%= f.input :antecedent, input_html: { value: params[:antecedent], "data-autocomplete": "tag-query" } %>
|
||||
<%= f.input :consequent, input_html: { value: params[:consequent], "data-autocomplete": "tag-edit" } %>
|
||||
<%= f.submit "Submit" %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Edit Update</h1>
|
||||
|
||||
<%= simple_form_for(@news_update) do |f| %>
|
||||
<%= edit_form_for(@news_update) do |f| %>
|
||||
<%= f.input :message, :hint => "Use HTML for formatting", :input_html => {:size => "30x5"} %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<% end %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-new">
|
||||
<h1>New Update</h1>
|
||||
|
||||
<%= simple_form_for(@news_update) do |f| %>
|
||||
<%= edit_form_for(@news_update) do |f| %>
|
||||
<%= f.input :message, :hint => "Use HTML for formatting", :input_html => {:size => "30x5"} %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<% end %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Order Pool: <%= @pool.pretty_name %></h1>
|
||||
|
||||
<%= simple_form_for(@pool, format: :js, html: { id: "ordering-form" }) do |f| %>
|
||||
<%= edit_form_for(@pool, format: :js, html: { id: "ordering-form" }) do |f| %>
|
||||
<% if @pool.post_count <= Pool::POOL_ORDER_LIMIT %>
|
||||
<p>Drag and drop the list below to determine ordering.</p>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="c-pools">
|
||||
<div id="a-edit">
|
||||
<%= simple_form_for(@pool) do |f| %>
|
||||
<%= edit_form_for(@pool) do |f| %>
|
||||
<h1>Edit Pool: <%= @pool.pretty_name %></h1>
|
||||
|
||||
<%= error_messages_for "pool" %>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<p style="font-weight: bold;">Before creating a pool, read the <%= link_to "pool guidelines", wiki_page_path(:id => "howto:pools") %>.</p>
|
||||
|
||||
<%= simple_form_for(@pool) do |f| %>
|
||||
<%= edit_form_for(@pool) do |f| %>
|
||||
<%= f.input :name, :as => :string, :required => true %>
|
||||
<%= dtext_field "pool", "description" %>
|
||||
<%= f.input :post_ids_string, as: :text, label: "Posts" %>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<%# XXX dtext_field expects there to be a `post_appeal` instance variable. %>
|
||||
<% @post_appeal = post_appeal %>
|
||||
<%= simple_form_for(@post_appeal, format: :js, remote: true) do |f| %>
|
||||
<%= edit_form_for(@post_appeal, format: :js, remote: true) do |f| %>
|
||||
<%= f.hidden_field :post_id %>
|
||||
<%= dtext_field "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal", type: "string" %>
|
||||
<%= dtext_preview_button "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal" %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div id="detailed-rejection-dialog" title="Detailed Rejection" style="display: none;">
|
||||
<p>You can supply a short message to the uploader explaining why you rejected this upload.</p>
|
||||
|
||||
<%= simple_form_for(PostDisapproval.new, url: moderator_post_disapprovals_path, remote: true, id: "detailed-rejection-form") do |f| %>
|
||||
<%= edit_form_for(PostDisapproval.new, url: moderator_post_disapprovals_path, remote: true, html: { id: "detailed-rejection-form" }) do |f| %>
|
||||
<%= f.hidden_field :post_id, value: "x" %>
|
||||
<%= f.input :reason, collection: [["Breaks Rules", "breaks_rules"], ["Poor Quality", "poor_quality"], ["No interest", "disinterest"]] %>
|
||||
<%= f.input :message, as: :string %>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<%# XXX dtext_field expects there to be a `post_flag` instance variable. %>
|
||||
<% @post_flag = post_flag %>
|
||||
<%= simple_form_for(@post_flag, format: :js, remote: true) do |f| %>
|
||||
<%= edit_form_for(@post_flag, format: :js, remote: true) do |f| %>
|
||||
<%= f.hidden_field :post_id %>
|
||||
<%= dtext_field "post_flag", "reason", preview_id: "dtext-preview-for-post-flag", type: "string" %>
|
||||
<%= dtext_preview_button "post_flag", "reason", preview_id: "dtext-preview-for-post-flag" %>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<%= format_text(WikiPage.titled(Danbooru.config.replacement_notice_wiki_page).first.try(&:body)) %>
|
||||
</div>
|
||||
|
||||
<%= simple_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post) do |f| %>
|
||||
<%= edit_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post) do |f| %>
|
||||
<%= f.input :replacement_file, label: "File", as: :file %>
|
||||
<%= f.input :replacement_url, label: "Replacement URL", hint: "The source URL to download the replacement from.", as: :string, input_html: { value: post_replacement.post.normalized_source } %>
|
||||
<%= f.input :final_source, label: "Final Source", hint: "If present, the source field will be changed to this after replacement.", as: :string, input_html: { value: post_replacement.post.source } %>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<%= render "sources/info" %>
|
||||
|
||||
<%= simple_form_for(post, html: { id: "form", autocomplete: "off" }) do |f| %>
|
||||
<%= edit_form_for(post, html: { id: "form" }) do |f| %>
|
||||
<%= hidden_field_tag :tags_query, params[:q] %>
|
||||
<%= hidden_field_tag :pool_id, params[:pool_id] %>
|
||||
<%= hidden_field_tag :favgroup_id, params[:favgroup_id] %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="save-search-dialog" title="Save Search" style="display: none;">
|
||||
|
||||
<%= simple_form_for(SavedSearch.new, remote: true) do |f| %>
|
||||
<%= edit_form_for(SavedSearch.new, remote: true) do |f| %>
|
||||
<%= f.input :query, as: :string, input_html: { value: params[:tags], data: { autocomplete: "tag-query" } } %>
|
||||
<%= f.input :label_string, label: "Labels", hint: "A list of tags to help categorize this search. Space delimited.", input_html: { "data-autocomplete": "saved-search-label" } %>
|
||||
<%= f.input :disable_labels, label: "Don't show this dialog again", as: :boolean %>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<%= error_messages_for :saved_search %>
|
||||
|
||||
<%= simple_form_for(@saved_search) do |f| %>
|
||||
<%= edit_form_for(@saved_search) do |f| %>
|
||||
<%= f.input :query, :as => :string %>
|
||||
<%= f.input :label_string, label: "Labels", hint: "A list of tags to help categorize this search. Space delimited.", input_html: { "data-autocomplete": "saved-search-label" } %>
|
||||
<%= f.button :submit, :value => "Submit" %>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<%= error_messages_for :tag_alias %>
|
||||
|
||||
<%= simple_form_for(@tag_alias) do |f| %>
|
||||
<%= edit_form_for(@tag_alias) do |f| %>
|
||||
<%= f.input :antecedent_name, :as => :string, :label => "From" %>
|
||||
<%= f.input :consequent_name, :label => "To" %>
|
||||
<%= f.input :forum_topic_id, :label => "Forum" %>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<%= error_messages_for :tag_implication %>
|
||||
|
||||
<%= simple_form_for(@tag_implication) do |f| %>
|
||||
<%= edit_form_for(@tag_implication) do |f| %>
|
||||
<%= f.input :antecedent_name, :label => "From" %>
|
||||
<%= f.input :consequent_name, :label => "To" %>
|
||||
<%= f.input :forum_topic_id, :label => "Forum" %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Tag: <%= @tag.name %></h1>
|
||||
|
||||
<%= simple_form_for(@tag) do |f| %>
|
||||
<%= edit_form_for(@tag) do |f| %>
|
||||
<% if @tag.is_locked? %>
|
||||
<p>This tag is category locked</p>
|
||||
<% else %>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="client-errors" class="error-messages ui-state-error ui-corner-all" style="display:none"></div>
|
||||
|
||||
<%= simple_form_for(@upload, html: { id: "form" }) do |f| %>
|
||||
<%= edit_form_for(@upload, html: { id: "form" }) do |f| %>
|
||||
<%= f.input :md5_confirmation, as: :hidden %>
|
||||
<%= f.input :referer_url, as: :hidden, input_html: { value: params[:ref] } %>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<%= error_messages_for "user_feedback" %>
|
||||
|
||||
<%= simple_form_for(@user_feedback) do |f| %>
|
||||
<%= edit_form_for(@user_feedback) do |f| %>
|
||||
<%= f.input :category, :collection => ["positive", "neutral", "negative"], :include_blank => false %>
|
||||
<%= dtext_field "user_feedback", "body" %>
|
||||
<% if @user_feedback.deletable_by?(CurrentUser.user) %>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<%= error_messages_for "user_feedback" %>
|
||||
|
||||
<%= simple_form_for(@user_feedback) do |f| %>
|
||||
<%= edit_form_for(@user_feedback) do |f| %>
|
||||
<%= f.input :user_name, :label => "User", :input_html => { value: @user_feedback.user.try(:name), data: { autocomplete: "user" } } %>
|
||||
<%= f.input :category, :collection => ["positive", "neutral", "negative"], :include_blank => false %>
|
||||
<%= dtext_field "user_feedback", "body" %>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<%= error_messages_for "change_request" %>
|
||||
|
||||
<%= simple_form_for(@change_request) do |f| %>
|
||||
<%= edit_form_for(@change_request) do |f| %>
|
||||
<%= f.input :desired_name, label: "Name" %>
|
||||
<%= f.input :desired_name_confirmation, label: "Confirm name" %>
|
||||
<%= f.submit "Submit" %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Settings</h1>
|
||||
|
||||
<%= simple_form_for @user do |f| %>
|
||||
<%= edit_form_for @user do |f| %>
|
||||
<h2 id="edit-options">
|
||||
<%= link_to "Basic", "#basic-settings", :class => "active" %>
|
||||
| <%= link_to "Advanced", "#advanced-settings" %>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</p>
|
||||
|
||||
<div id="p3">
|
||||
<%= simple_form_for(@user, html: {id: "signup-form"}) do |f| %>
|
||||
<%= edit_form_for(@user, html: { id: "signup-form" }) do |f| %>
|
||||
<%= f.input :name, as: :string %>
|
||||
<%= f.input :email, required: false, as: :email, hint: "Optional" %>
|
||||
<%= f.input :password %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div id="form-content">
|
||||
<%= error_messages_for("wiki_page") %>
|
||||
|
||||
<%= simple_form_for(@wiki_page, url: wiki_page_path(@wiki_page.id)) do |f| %>
|
||||
<%= edit_form_for(@wiki_page, url: wiki_page_path(@wiki_page.id)) do |f| %>
|
||||
<%= f.input :title, error: false, input_html: { data: { autocomplete: "tag" } }, hint: "Change to rename this wiki page. Update any wikis linking to this page first." %>
|
||||
<%= f.input :other_names_string, as: :text, input_html: { size: "30x1" }, label: "Other names (#{link_to_wiki "help", "help:translated_tags"})".html_safe, hint: "Names used for this tag on other sites such as Pixiv. Separate with spaces." %>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<%= error_messages_for("wiki_page") %>
|
||||
|
||||
<%= simple_form_for(@wiki_page) do |f| %>
|
||||
<%= edit_form_for(@wiki_page) do |f| %>
|
||||
<%= f.input :title, error: false, input_html: { data: { autocomplete: "tag" } } %>
|
||||
<%= f.input :other_names_string, as: :text, input_html: { size: "30x1" }, label: "Other names (#{link_to_wiki "help", "help:translated_tags"})".html_safe, hint: "Names used for this tag on other sites such as Pixiv. Separate with spaces." %>
|
||||
<%= dtext_field "wiki_page", "body" %>
|
||||
|
||||
Reference in New Issue
Block a user