Skip to content

Commit a4a6f83

Browse files
committed
Remove custom form used to add comment
1 parent 670d8d4 commit a4a6f83

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

flashtux/common/forms.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,6 @@ class Html5EmailInput(forms.widgets.Input):
9494
input_type = 'email'
9595

9696

97-
class Form(forms.Form):
98-
"""Customized form, using Bootstrap."""
99-
100-
def as_div(self):
101-
"Return this form rendered as HTML <div>s."
102-
return self._html_output(
103-
normal_row=('<div%(html_class_attr)s class="form-group row">'
104-
'%(label)s'
105-
'<div class="col-12 col-md-9 col-lg-10">'
106-
'%(field)s%(help_text)s'
107-
'</div>'
108-
'</div>'),
109-
error_row='%s',
110-
row_ender='</p>',
111-
help_text_html=' <span class="helptext">%s</span>',
112-
errors_on_separate_row=True)
113-
114-
11597
def getxmlline(key, value):
11698
"""Get a XML line for a key/value."""
11799
strvalue = f'{value}'.replace('<', '&lt;').replace('>', '&gt;')

flashtux/news/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from flashtux.common.forms import (
3131
CharField,
3232
EmailField,
33-
Form,
3433
Html5EmailInput,
3534
TestField,
3635
)
@@ -131,7 +130,7 @@ class Meta:
131130
ordering = ['-date']
132131

133132

134-
class CommentFormAdd(Form):
133+
class CommentFormAdd(forms.Form):
135134
"""Form to add a script."""
136135
required_css_class = 'required'
137136
title = CharField(

flashtux/templates/news/info.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h4>{% trans "New comment" %}</h4>
4848
<div class="col-12 col-md-8">
4949
<form action="." method="post" enctype="multipart/form-data">
5050
{% csrf_token %}
51-
{{ form.as_div }}
51+
{{ form.as_p }}
5252
<button type="submit" class="btn btn-success mt-3 me-3 px-5">{% trans "Submit" %}</button>
5353
<a href="{% url 'info' section=section info_id=info.id %}" class="btn btn-danger mt-3 px-5" role="button">{% trans "Cancel" %}</a>
5454
</form>

0 commit comments

Comments
 (0)