# HG changeset patch # User neko259 # Date 2013-12-03 16:24:29 # Node ID abb0b1c99c1d64804a3864b9a08dc0d2a0ce66e2 # Parent f54bae307aca09ea8d2c523101e1ba56681cb5ee Basic support for the generic forms. Still need to fix some things in the form rendering, also need to implement a new widget for the text with formatting panel. diff --git a/boards/forms.py b/boards/forms.py --- a/boards/forms.py +++ b/boards/forms.py @@ -27,6 +27,7 @@ class NeboardForm(forms.Form): def as_p(self): "Returns this form rendered as HTML

s." return self._html_output( + # TODO Do not show hidden rows in the list here normal_row='

' '
' '%(label)s' @@ -36,12 +37,11 @@ class NeboardForm(forms.Form): '
' '%(help_text)s' '
', - error_row='
%s
', + error_row='
%s
', row_ender='

', help_text_html=' %s', errors_on_separate_row=True) - class PostForm(NeboardForm): title = forms.CharField(max_length=TITLE_MAX_LENGTH, required=False, diff --git a/boards/templates/boards/posting_general.html b/boards/templates/boards/posting_general.html --- a/boards/templates/boards/posting_general.html +++ b/boards/templates/boards/posting_general.html @@ -201,65 +201,23 @@ {% else %}
{% trans 'No threads exist. Create the first one!' %}
- {% endif %} + {% endif %} -
{% csrf_token %}
- -
{% trans "Create new thread" %}
-
-
{% trans 'Title' %}
-
{{ form.title }}
-
{{ form.title.errors }}
-
-
-
{% trans 'Formatting' %}
-
- >{% trans 'quote' %} - {% trans 'italic' %} - {% trans 'bold' %} - {% trans 'spoiler' %} - // {% trans 'comment' %} -
-
-
-
{% trans 'Text' %}
-
{{ form.text }}
-
{{ form.text.errors }}
+
{% trans "Create new thread" %}
+ {% csrf_token %} + {{ form.as_p }} +
+
+
+ + {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
-
-
{% trans 'Image' %}
-
{{ form.image }}
-
{{ form.image.errors }}
-
-
-
{% trans 'Tags' %}
-
{{ form.tags }}
-
{{ form.tags.errors }}
-
- -
- {{ form.captcha }} -
{{ form.captcha.errors }}
-
-
-
{{ form.other.errors }}
-
+
-
-
-
- {% trans 'Tags must be delimited by spaces. Text or image is required.' %} -
-
- {% trans 'Text syntax' %}
- {% endblock %} diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html --- a/boards/templates/boards/thread.html +++ b/boards/templates/boards/thread.html @@ -93,56 +93,20 @@
{% endcache %} -
{% csrf_token %} -
-
{% trans "Reply to thread" %} #{{ thread.get_opening_post.id }}
-
-
-
{% trans 'Title' %}
-
{{ form.title }}
-
{{ form.title.errors }}
-
-
-
{% trans 'Formatting' %}
-
- >{% trans 'quote' %} - {% trans 'italic' %} - {% trans 'bold' %} - {% trans 'spoiler' %} - // {% trans 'comment' %} -
-
-
-
{% trans 'Text' %}
-
{{ form.text }}
-
{{ form.text.errors }}
-
-
-
{% trans 'Image' %}
-
{{ form.image }}
-
{{ form.image.errors }}
-
- -
- {{ form.captcha }} -
{{ form.captcha.errors }}
-
-
-
{{ form.other.errors }}
-
+
+
{% trans "Reply to thread" %} #{{ thread.get_opening_post.id }}
+
+ {% csrf_token %} + {{ form.as_p }} +
+
- -
- + +
- +
{% endspaceless %} {% endblock %}