refactor: change comment form to bulma

This commit is contained in:
2025-06-20 18:41:49 +02:00
parent f83851b694
commit 6f5e75a1b3
2 changed files with 6 additions and 9 deletions

View File

@@ -106,13 +106,6 @@ class ReportCommentForm(forms.ModelForm):
class CommentForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_class = 'form-comments'
self.helper.add_input(Hidden('action', 'comment'))
self.helper.add_input(Submit('submit', _('Kommentieren'), css_class="button is-primary"))
class Meta:
model = Comment
fields = ('text',)

View File

@@ -1,5 +1,4 @@
{% load i18n %}
{% load crispy_forms_tags %}
<div class="card">
<div class="card-header">
@@ -10,6 +9,11 @@
</div>
</div>
<div class="card-content">
{% crispy comment_form %}
<form method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="comment">
{{ comment_form }}
<input type="submit" class="button is-primary" value="{% trans 'Kommentieren' %}">
</form>
</div>
</div>