Adds an option to renew the code (fixes #43)

This commit is contained in:
Gregwar
2012-12-25 20:07:00 +01:00
parent 6b340eb258
commit 35405aca2e
6 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1 @@
Renew: Renouveler

View File

@ -3,7 +3,16 @@
-
{% else %}
{% spaceless %}
<img src="{{ captcha_code }}" alt="" title="captcha" width="{{ captcha_width }}" height="{{ captcha_height }}" />
<img id="{{ id }}" src="{{ captcha_code }}" alt="" title="captcha" width="{{ captcha_width }}" height="{{ captcha_height }}" />
{% if reload %}
<script type="text/javascript">
function reload_{{ id }}() {
var img = document.getElementById('{{ id }}');
img.src = '{{ captcha_code }}?n=' + (new Date()).getTime();
}
</script>
<a class="captcha_reload" href="javascript:reload_{{ id }}();">{{ 'Renew'|trans({}, 'gregwar_captcha') }}</a>
{% endif %}
{{ form_widget(form) }}
{% endspaceless %}
{% endif %}