]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/settings/forms.py
Merge commit '9bea91a' into merge_small_prs
[osqa.git] / forum / settings / forms.py
index 0c123011cbc99976a71a9107eba0f50a858fd850..3e3cc5afbf92833045346342b74d5b5c090df4aa 100644 (file)
@@ -4,6 +4,7 @@ from django import forms
 from forum.settings.base import Setting
 from django.utils.translation import ugettext as _
 from django.core.files.storage import FileSystemStorage
 from forum.settings.base import Setting
 from django.utils.translation import ugettext as _
 from django.core.files.storage import FileSystemStorage
+from django.core.urlresolvers import reverse
 
 class DummySetting:
     pass
 
 class DummySetting:
     pass
@@ -120,7 +121,20 @@ class CommaStringListWidget(forms.Textarea):
         else:
             return ', '.join(data[name])    
 
         else:
             return ', '.join(data[name])    
 
+class TestEmailSettingsWidget(forms.TextInput):
+    def render(self, name, value, attrs=None):
+        if not value:
+            value = ''
 
 
-
-
-
+        return """
+            <div id="test_email_settings">
+                <a href="%s" onclick="return false;" class="button test_button" href="/">Test</a>
+
+                <div style="margin-top: 7px">
+                <div style="display: none" class="ajax_indicator">
+                    Testing your current e-mail settings. Please, wait.
+                </div>
+                <div class="test_status"></div>
+                </div>
+            </div>
+            """ % reverse("test_email_settings")
\ No newline at end of file