debian-mirror-gitlab/app/views/shared/_recaptcha_form.html.haml

21 lines
905 B
Text
Raw Normal View History

2018-03-17 18:26:18 +05:30
- 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)
= hidden_field_tag(:recaptcha_verification, true)
2018-05-01 15:08:00 +05:30
= recaptcha_tags script: script, callback: 'recaptchaDialogCallback' unless Rails.env.test?
2018-03-17 18:26:18 +05:30
-# Yields a block with given extra params.
= yield
- if has_submit
.row-content-block.footer-block
2018-12-05 23:21:45 +05:30
= f.submit "Submit #{humanized_resource_name}", class: 'btn btn-success'