only 4 rows for summary (bug 618976)

This commit is contained in:
Jeff Balogh 2010-12-13 21:36:01 -08:00
Родитель c250911a9c
Коммит fb5a340b97
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -41,7 +41,7 @@ class AddonFormBase(TranslationFormMixin, happyforms.ModelForm):
class AddonFormBasic(AddonFormBase):
name = TransField(max_length=50)
slug = forms.CharField(max_length=30)
summary = TransField(widget=TransTextarea, max_length=250)
summary = TransField(widget=TransTextarea(attrs={'rows': 4}), max_length=250)
tags = forms.CharField(required=False)
categories = forms.ModelMultipleChoiceField(queryset=False,
widget=forms.CheckboxSelectMultiple)

Просмотреть файл

@ -40,10 +40,10 @@ class TransMulti(forms.widgets.MultiWidget):
wrapped in div.trans and javascript handles the rest of the UI.
"""
def __init__(self):
def __init__(self, attrs=None):
# We set up the widgets in render since every Translation needs a
# different number of widgets.
super(TransMulti, self).__init__(widgets=[])
super(TransMulti, self).__init__(widgets=[], attrs=attrs)
def render(self, name, value, attrs=None):
self.name = name
@ -99,7 +99,7 @@ class _TransWidget(object):
"""
def render(self, name, value, attrs=None):
attrs = attrs or {}
attrs = self.build_attrs(attrs)
lang = to_language(value.locale)
attrs.update(lang=lang)
# Use rsplit to drop django's name_idx numbering. (name_0 => name)