from django.utils.safestring import mark_safe
from django.utils import simplejson as json
from django.utils.translation import ugettext as _
+from django.template.loader import render_to_string
from astakos.im.settings import RECAPTCHA_PUBLIC_KEY, RECAPTCHA_OPTIONS, \
RECAPTCHA_USE_SSL
recaptcha_conf = ('<script type="text/javascript">'
'var RecaptchaOptions = %s'
'</script>') % json.dumps(conf)
+ custom_widget_html = render_to_string("im/captcha.html",
+ {'conf': 'Bob'})
return mark_safe(recaptcha_conf + \
+ custom_widget_html + \
captcha.displayhtml(RECAPTCHA_PUBLIC_KEY,
use_ssl=RECAPTCHA_USE_SSL))
is_hidden=True
def render(self, *args, **kwargs):
return ''
-
-class ApprovalTermsWidget(forms.CheckboxInput):
- """
- A CheckboxInput class with a link to the approval terms.
- """
- def __init__(self, attrs=None, check_test=bool, terms_uri='', terms_label=_('Read the terms')):
- super(ApprovalTermsWidget, self).__init__(attrs, check_test)
- self.uri = terms_uri
- self.label = terms_label
-
- def render(self, name, value, attrs=None):
- html = super(ApprovalTermsWidget, self).render(name, value, attrs)
- return html