diff options
Diffstat (limited to 'app/views/shared/_recaptcha_form.html.haml')
-rw-r--r-- | app/views/shared/_recaptcha_form.html.haml | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/app/views/shared/_recaptcha_form.html.haml b/app/views/shared/_recaptcha_form.html.haml deleted file mode 100644 index ae0a22fd255..00000000000 --- a/app/views/shared/_recaptcha_form.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -- resource_name = spammable.class.model_name.singular -- humanized_resource_name = spammable.class.model_name.human.downcase -- script = local_assigns.fetch(:script, true) -- method = params[:action] == 'create' ? :post : :put -- has_submit = local_assigns.fetch(:has_submit, true) - -= form_for resource_name, method: method, html: { class: 'recaptcha-form js-recaptcha-form' } do |f| - .recaptcha - - params[resource_name].each do |field, value| - = hidden_field(resource_name, field, value: value) - = hidden_field_tag(:spam_log_id, spammable.spam_log.id) - -# The reCAPTCHA response value will be returned in the 'g-recaptcha-response' field - = recaptcha_tags script: script, callback: 'recaptchaDialogCallback', nonce: content_security_policy_nonce unless Rails.env.test? - -# Fake the 'g-recaptcha-response' field in the test environment, so that the feature spec - -# can get to the (mocked) SpamVerdictService check. - = hidden_field_tag('g-recaptcha-response', 'abc123') if Rails.env.test? - - -# Yields a block with given extra params. - = yield - - - if has_submit - .row-content-block.footer-block - = f.submit _("Create %{humanized_resource_name}") % { humanized_resource_name: humanized_resource_name }, class: 'gl-button btn btn-confirm' |