diff --git a/dpaste/forms.py b/dpaste/forms.py index 426a13b..04f9704 100644 --- a/dpaste/forms.py +++ b/dpaste/forms.py @@ -19,6 +19,11 @@ EXPIRE_DEFAULT = 3600 * 24 * 30 class SnippetForm(forms.ModelForm): + content = forms.CharField( + label=_('Content'), + widget=forms.Textarea(attrs={'placeholder': _('Awesome code goes here...')}), + ) + lexer = forms.ChoiceField( label=_(u'Lexer'), initial=LEXER_DEFAULT, diff --git a/dpaste/templates/dpaste/base.html b/dpaste/templates/dpaste/base.html index 0d8037a..c85fd74 100644 --- a/dpaste/templates/dpaste/base.html +++ b/dpaste/templates/dpaste/base.html @@ -44,6 +44,8 @@ $(document).ready(function(){ } }); }); + + $('.autofocus input:text, .autofocus textarea').first().focus(); }); {% endblock %} diff --git a/dpaste/templates/dpaste/snippet_form.html b/dpaste/templates/dpaste/snippet_form.html index 4702367..0670f26 100644 --- a/dpaste/templates/dpaste/snippet_form.html +++ b/dpaste/templates/dpaste/snippet_form.html @@ -5,7 +5,7 @@ {{ snippet_form.non_field_errors }}
-