diff --git a/Resources/config/assetic_injector.json b/Resources/config/assetic_injector.json index be21d19..9ca4b33 100644 --- a/Resources/config/assetic_injector.json +++ b/Resources/config/assetic_injector.json @@ -4,13 +4,12 @@ "javascripts": { "foot": [ - "@VictoireWidgetFormBundle/Resources/public/js/validator.js", - "https://www.google.com/recaptcha/api.js" + "@VictoireWidgetFormBundle/Resources/public/js/validator.js" ] }, "stylesheets": { - "head": "@VictoireWidgetFormBundle/Resources/public/css/recaptcha.css" + "victoire_widget_form_recaptcha": "@VictoireWidgetFormBundle/Resources/public/css/recaptcha.css" } } } \ No newline at end of file diff --git a/Resources/views/macros/form_elements.html.twig b/Resources/views/macros/form_elements.html.twig index 1950847..3db3bfe 100644 --- a/Resources/views/macros/form_elements.html.twig +++ b/Resources/views/macros/form_elements.html.twig @@ -1,15 +1,3 @@ {% macro recaptcha(siteKey)%} - - {% stylesheets injector="head" - '@VictoireWidgetFormBundle/Resources/public/css/recaptcha.css' - %} - {% endstylesheets %} -
- - {% javascripts injector="foot" - 'http://www.google.com/recaptcha/api.js' - %} - {% endjavascripts %} - -{% endmacro %} \ No newline at end of file +{% endmacro %} diff --git a/Resources/views/show.html.twig b/Resources/views/show.html.twig index 37e0095..7a9b782 100644 --- a/Resources/views/show.html.twig +++ b/Resources/views/show.html.twig @@ -135,9 +135,24 @@ {% if recaptcha_public_key is defined %} + {% stylesheets injector="victoire_widget_form_recaptcha" + %} + + {% endstylesheets %}
{{formElements.recaptcha(recaptcha_public_key)}} +
{% endif %}