|
@@ -6,12 +6,12 @@ class BanForm(Form):
|
|
|
"""
|
|
|
New/Edit Ban form
|
|
|
"""
|
|
|
- type = forms.ChoiceField(choices=(
|
|
|
- (0, _('Ban Username and e-mail')),
|
|
|
- (1, _('Ban Username')),
|
|
|
- (2, _('Ban E-mail address')),
|
|
|
- (3, _('Ban IP Address'))
|
|
|
- ))
|
|
|
+ test = forms.TypedChoiceField(choices=(
|
|
|
+ (0, _('Ban Username and e-mail')),
|
|
|
+ (1, _('Ban Username')),
|
|
|
+ (2, _('Ban E-mail address')),
|
|
|
+ (3, _('Ban IP Address'))
|
|
|
+ ), coerce=int)
|
|
|
reason_user = forms.CharField(widget=forms.Textarea, required=False)
|
|
|
reason_admin = forms.CharField(widget=forms.Textarea, required=False)
|
|
|
ban = forms.CharField(max_length=255)
|
|
@@ -20,7 +20,7 @@ class BanForm(Form):
|
|
|
(
|
|
|
_("Ban Details"),
|
|
|
(
|
|
|
- ('nested', (('type', {'label': _("Ban Rule"), 'help_text': _("Select ban type from list and define rule by entering it in text field. If you want to ban specific user, enter here either his Username or E-mail address. If you want to define blanket ban, you can use wildcard (\"*\"). For example to forbid all members from using name suggesting that member is an admin, you can set ban that forbids \"Admin*\" as username."), 'width': 25}),
|
|
|
+ ('nested', (('test', {'label': _("Ban Rule"), 'help_text': _("Select ban type from list and define rule by entering it in text field. If you want to ban specific user, enter here either his Username or E-mail address. If you want to define blanket ban, you can use wildcard (\"*\"). For example to forbid all members from using name suggesting that member is an admin, you can set ban that forbids \"Admin*\" as username."), 'width': 25}),
|
|
|
('ban', {'width': 75}))),
|
|
|
('expires', {'label': _("Ban Expiration"), 'help_text': _("If you want to, you can set this ban's expiration date by entering it here using YYYY-MM-DD format. Otherwhise you can leave this field empty making this ban permanent.")}),
|
|
|
),
|
|
@@ -38,19 +38,19 @@ class BanForm(Form):
|
|
|
class SearchBansForm(Form):
|
|
|
ban = forms.CharField(required=False)
|
|
|
reason = forms.CharField(required=False)
|
|
|
- type = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=(
|
|
|
- ("0", _('Username and e-mail')),
|
|
|
- ("1", _('Username')),
|
|
|
- ("2", _('E-mail address')),
|
|
|
- ("3", _('IP Address'))
|
|
|
- ), required=False)
|
|
|
+ test = forms.TypedMultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=(
|
|
|
+ (0, _('Username and e-mail')),
|
|
|
+ (1, _('Username')),
|
|
|
+ (2, _('E-mail address')),
|
|
|
+ (3, _('IP Address'))
|
|
|
+ ), coerce=int, required=False)
|
|
|
layout = (
|
|
|
(
|
|
|
_("Search Bans"),
|
|
|
(
|
|
|
('ban', {'label': _("Ban"), 'attrs': {'placeholder': _("Ban contains...")}}),
|
|
|
('reason', {'label': _("Messages"), 'attrs': {'placeholder': _("User or Team message contains...")}}),
|
|
|
- ('type', {'label': _("Type")}),
|
|
|
+ ('test', {'label': _("Type")}),
|
|
|
),
|
|
|
),
|
|
|
)
|