add command to clean social accounts from unnecessary data
[wolnelektury.git] / src / ajaxable / utils.py
index c2c3688..80d398f 100755 (executable)
@@ -48,7 +48,7 @@ def require_login(request):
 
 def placeholdized(form):
     for field in form.fields.values():
 
 def placeholdized(form):
     for field in form.fields.values():
-        field.widget.attrs['placeholder'] = field.label
+        field.widget.attrs['placeholder'] = field.label + ('*' if field.required else '')
     return form
 
 
     return form
 
 
@@ -63,6 +63,7 @@ class AjaxableFormView(object):
     # override to customize form look
     template = "ajaxable/form.html"
     submit = _('Send')
     # override to customize form look
     template = "ajaxable/form.html"
     submit = _('Send')
+    action = ''
 
     title = ''
     success_message = ''
 
     title = ''
     success_message = ''
@@ -140,6 +141,7 @@ class AjaxableFormView(object):
                 "honeypot": self.honeypot,
                 "placeholdize": self.placeholdize,
                 "submit": self.submit,
                 "honeypot": self.honeypot,
                 "placeholdize": self.placeholdize,
                 "submit": self.submit,
+                "action": self.action,
                 "response_data": response_data,
                 "ajax_template": self.template,
                 "view_args": args,
                 "response_data": response_data,
                 "ajax_template": self.template,
                 "view_args": args,