2017-12-08 07:26:39 -05:00
|
|
|
- resource_name = spammable.class.model_name.singular
|
|
|
|
- humanized_resource_name = spammable.class.model_name.human.downcase
|
|
|
|
- script = local_assigns.fetch(:script, true)
|
2017-12-30 09:00:18 -05:00
|
|
|
- method = params[:action] == 'create' ? :post : :put
|
2017-12-08 07:26:39 -05:00
|
|
|
- has_submit = local_assigns.fetch(:has_submit, true)
|
|
|
|
|
2017-12-30 09:00:18 -05:00
|
|
|
= form_for resource_name, method: method, html: { class: 'recaptcha-form js-recaptcha-form' } do |f|
|
2017-12-08 07:26:39 -05:00
|
|
|
.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)
|
|
|
|
= hidden_field_tag(:recaptcha_verification, true)
|
2018-04-06 17:25:08 -04:00
|
|
|
= recaptcha_tags script: script, callback: 'recaptchaDialogCallback' unless Rails.env.test?
|
2017-12-08 07:26:39 -05:00
|
|
|
|
|
|
|
-# Yields a block with given extra params.
|
|
|
|
= yield
|
|
|
|
|
|
|
|
- if has_submit
|
|
|
|
.row-content-block.footer-block
|
2018-09-18 05:58:22 -04:00
|
|
|
= f.submit "Submit #{humanized_resource_name}", class: 'btn btn-success'
|