|
@@ -1,13 +1,15 @@
|
|
from django.utils.translation import ugettext_lazy as _
|
|
from django.utils.translation import ugettext_lazy as _
|
|
from django import forms
|
|
from django import forms
|
|
from mptt.forms import TreeNodeChoiceField
|
|
from mptt.forms import TreeNodeChoiceField
|
|
-from misago.forms import Form
|
|
|
|
|
|
+from misago.forms import Form, YesNoSwitch
|
|
from misago.forums.models import Forum
|
|
from misago.forums.models import Forum
|
|
|
|
|
|
class CategoryForm(Form):
|
|
class CategoryForm(Form):
|
|
parent = False
|
|
parent = False
|
|
name = forms.CharField(max_length=255)
|
|
name = forms.CharField(max_length=255)
|
|
description = forms.CharField(widget=forms.Textarea,required=False)
|
|
description = forms.CharField(widget=forms.Textarea,required=False)
|
|
|
|
+ closed = forms.BooleanField(widget=YesNoSwitch,required=False)
|
|
|
|
+ style = forms.CharField(max_length=255,required=False)
|
|
template = forms.ChoiceField(choices=(
|
|
template = forms.ChoiceField(choices=(
|
|
('rows', _('One forum per row')),
|
|
('rows', _('One forum per row')),
|
|
('fifty', _('Two forums per row')),
|
|
('fifty', _('Two forums per row')),
|
|
@@ -16,11 +18,18 @@ class CategoryForm(Form):
|
|
|
|
|
|
layout = (
|
|
layout = (
|
|
(
|
|
(
|
|
- _("Category Options"),
|
|
|
|
|
|
+ _("Basic Options"),
|
|
(
|
|
(
|
|
('parent', {'label': _("Category Parent")}),
|
|
('parent', {'label': _("Category Parent")}),
|
|
('name', {'label': _("Category Name")}),
|
|
('name', {'label': _("Category Name")}),
|
|
('description', {'label': _("Category Description")}),
|
|
('description', {'label': _("Category Description")}),
|
|
|
|
+ ('closed', {'label': _("Closed Category")}),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ (
|
|
|
|
+ _("Display Options"),
|
|
|
|
+ (
|
|
|
|
+ ('style', {'label': _("Category Style"), 'help_text': _('You can add custom CSS classess to this category, to change way it looks on board index.')}),
|
|
('template', {'label': _("Category Layout")}),
|
|
('template', {'label': _("Category Layout")}),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
@@ -35,6 +44,8 @@ class ForumForm(Form):
|
|
parent = False
|
|
parent = False
|
|
name = forms.CharField(max_length=255)
|
|
name = forms.CharField(max_length=255)
|
|
description = forms.CharField(widget=forms.Textarea,required=False)
|
|
description = forms.CharField(widget=forms.Textarea,required=False)
|
|
|
|
+ closed = forms.BooleanField(widget=YesNoSwitch,required=False)
|
|
|
|
+ style = forms.CharField(max_length=255,required=False)
|
|
template = forms.ChoiceField(choices=(
|
|
template = forms.ChoiceField(choices=(
|
|
('rows', _('One forum per row')),
|
|
('rows', _('One forum per row')),
|
|
('fifty', _('Two forums per row')),
|
|
('fifty', _('Two forums per row')),
|
|
@@ -45,12 +56,12 @@ class ForumForm(Form):
|
|
|
|
|
|
layout = (
|
|
layout = (
|
|
(
|
|
(
|
|
- _("Forum Options"),
|
|
|
|
|
|
+ _("Basic Options"),
|
|
(
|
|
(
|
|
('parent', {'label': _("Forum Parent")}),
|
|
('parent', {'label': _("Forum Parent")}),
|
|
('name', {'label': _("Forum Name")}),
|
|
('name', {'label': _("Forum Name")}),
|
|
('description', {'label': _("Forum Description")}),
|
|
('description', {'label': _("Forum Description")}),
|
|
- ('template', {'label': _("Subforums Layout")}),
|
|
|
|
|
|
+ ('closed', {'label': _("Closed Forum")}),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
(
|
|
(
|
|
@@ -60,6 +71,13 @@ class ForumForm(Form):
|
|
('prune_last', {'label': _("Delete threads with last post older than"), 'help_text': _('Enter number of days since since last reply in topic after which topic will be deleted or zero to don\'t delete topics.')}),
|
|
('prune_last', {'label': _("Delete threads with last post older than"), 'help_text': _('Enter number of days since since last reply in topic after which topic will be deleted or zero to don\'t delete topics.')}),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
+ (
|
|
|
|
+ _("Display Options"),
|
|
|
|
+ (
|
|
|
|
+ ('style', {'label': _("Forum Style"), 'help_text': _('You can add custom CSS classess to this forum to change way it looks on forums lists.')}),
|
|
|
|
+ ('template', {'label': _("Subforums List Layout")}),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
)
|
|
)
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|
|
@@ -72,10 +90,11 @@ class RedirectForm(Form):
|
|
name = forms.CharField(max_length=255)
|
|
name = forms.CharField(max_length=255)
|
|
description = forms.CharField(widget=forms.Textarea,required=False)
|
|
description = forms.CharField(widget=forms.Textarea,required=False)
|
|
redirect = forms.URLField(max_length=255)
|
|
redirect = forms.URLField(max_length=255)
|
|
|
|
+ style = forms.CharField(max_length=255,required=False)
|
|
|
|
|
|
layout = (
|
|
layout = (
|
|
(
|
|
(
|
|
- _("Redirect Options"),
|
|
|
|
|
|
+ _("Basic Options"),
|
|
(
|
|
(
|
|
('parent', {'label': _("Redirect Parent")}),
|
|
('parent', {'label': _("Redirect Parent")}),
|
|
('name', {'label': _("Redirect Name")}),
|
|
('name', {'label': _("Redirect Name")}),
|
|
@@ -83,6 +102,12 @@ class RedirectForm(Form):
|
|
('description', {'label': _("Redirect Description")}),
|
|
('description', {'label': _("Redirect Description")}),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
+ (
|
|
|
|
+ _("Display Options"),
|
|
|
|
+ (
|
|
|
|
+ ('style', {'label': _("Redirect Style"), 'help_text': _('You can add custom CSS classess to this redirect to change way it looks on forums lists.')}),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
)
|
|
)
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|