diff options
author | Leif Johansson <leifj@sunet.se> | 2011-03-09 13:12:49 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-03-09 13:12:49 +0100 |
commit | 010e93b57637125a09c231b59d25c37f849af364 (patch) | |
tree | 3865841ca6848c0398662fb31694c6857e58c6c4 | |
parent | 76c8a67ee7bb0d43f772a81b2bec7461162d3ba3 (diff) |
better widgets
-rw-r--r-- | coip/apps/name/forms.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/coip/apps/name/forms.py b/coip/apps/name/forms.py index 549456f..d1fed90 100644 --- a/coip/apps/name/forms.py +++ b/coip/apps/name/forms.py @@ -18,30 +18,34 @@ class AttributeForm(forms.ModelForm): model = Attribute class NameEditForm(BetterModelForm): - description = forms.CharField(widget=forms.Textarea(attrs={'cols': 60, 'rows': 6})) error_css_class = 'error' required_css_class = 'required' class Meta: model = Name fields = ['short','description','format'] + widgets = {'description': forms.Textarea(attrs={'cols': 62, 'rows': 6}), + 'short': forms.TextInput(attrs={'size': 40})} fieldsets = [('step1', {'fields': ['short', 'description'], - 'legend': 'Describe your group', + 'legend': 'Step 1: Describe your group', 'classes': ['step'], 'description': 'Provide a short and (optionally) longer description of your group.'}), ('step2', {'fields': ['format'], - 'legend': 'Step 2 (optional): Advanced options', + 'legend': 'Step 2: (optional): Advanced options', 'classes': ['step','submit_step'], 'description': 'Only change these settings if you know what you are doing.'}) ] class NewNameForm(BetterModelForm): - description = forms.CharField(widget=forms.Textarea(attrs={'cols': 60, 'rows': 6})) + error_css_class = 'error' + required_css_class = 'required' value = forms.CharField(label="Name") #error_css_class = 'error' #required_css_class = 'required' class Meta: model = Name fields = ['value','short','description','type','format'] + widgets = {'description': forms.Textarea(attrs={'cols': 60, 'rows': 6}), + 'short': forms.TextInput(attrs={'size': 40})} fieldsets = [('step1', {'fields': ['value'], 'legend': 'Step 1: Name your group', 'classes': ['step'], |