Merge branch 'pretty' of github.com:fnp/wolnelektury into pretty
[wolnelektury.git] / apps / search / forms.py
index e7051b8..9e0a078 100755 (executable)
@@ -9,13 +9,13 @@ from search.fields import JQueryAutoCompleteSearchField
 
 
 class SearchForm(forms.Form):
 
 
 class SearchForm(forms.Form):
-    q = JQueryAutoCompleteSearchField()  # {'minChars': 2, 'selectFirst': True, 'cacheLength': 50, 'matchContains': "word"})
+    q = JQueryAutoCompleteSearchField(label=_('Search'))  # {'minChars': 2, 'selectFirst': True, 'cacheLength': 50, 'matchContains': "word"})
 
     def __init__(self, source, *args, **kwargs):
         kwargs['auto_id'] = False
         super(SearchForm, self).__init__(*args, **kwargs)
 
     def __init__(self, source, *args, **kwargs):
         kwargs['auto_id'] = False
         super(SearchForm, self).__init__(*args, **kwargs)
-        self.fields['q'].widget.attrs['id'] = _('search')
-        self.fields['q'].widget.attrs['autocomplete'] = _('off')
-        self.fields['q'].widget.attrs['data-source'] = _(source)
+        self.fields['q'].widget.attrs['id'] = 'search'
+        self.fields['q'].widget.attrs['autocomplete'] = 'off'
+        self.fields['q'].widget.attrs['data-source'] = source
         if not 'q' in self.data:
         if not 'q' in self.data:
-            self.fields['q'].widget.attrs['title'] = _('title, author, theme/topic, epoch, kind, genre, phrase')
+            self.fields['q'].widget.attrs['placeholder'] = _('title, author, theme/topic, epoch, kind, genre, phrase')