diff --git a/src/fellchensammlung/forms.py b/src/fellchensammlung/forms.py index 70ecb92..9901fb2 100644 --- a/src/fellchensammlung/forms.py +++ b/src/fellchensammlung/forms.py @@ -40,7 +40,6 @@ class AdoptionNoticeForm(forms.ModelForm): fields = ['name', "group_only", "further_information", "description", "searching_since"] - class ImageForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -59,11 +58,19 @@ class ReportForm(forms.ModelForm): model = Report fields = ('reported_broken_rules', 'comment') + 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(Submit('submit', _('Kommentieren'))) + class Meta: model = Comment fields = ('text',) + class ModerationActionForm(forms.ModelForm): class Meta: model = ModerationAction diff --git a/src/fellchensammlung/static/fellchensammlung/css/styles.css b/src/fellchensammlung/static/fellchensammlung/css/styles.css index bcbed39..2be60f7 100644 --- a/src/fellchensammlung/static/fellchensammlung/css/styles.css +++ b/src/fellchensammlung/static/fellchensammlung/css/styles.css @@ -84,7 +84,7 @@ h1, h2 { border-radius: 4px; } -.header a, form { +.header a, .header form { float: left; padding: 5px 12px 5px 12px; line-height: 25px; @@ -383,12 +383,10 @@ h1, h2 { padding: 5px; } -form { - padding: 20px; -} - -.form-group { - margin: 30px; +#form-adoption-notice { + .form-group { + margin: 30px; + } } .detail-adoption-notice-header h1 { @@ -427,4 +425,21 @@ form { padding: 5px; background: var(--background-three); color: var(--text-two); +} + +.container-comment-form { + width: 80%; + color: var(--text-one); +} + +textarea { + border-radius: 10px; + width: 100%; + margin: 5px; +} + +.form-comments { + .btn { + margin: 5px; + } } \ No newline at end of file diff --git a/src/fellchensammlung/templates/fellchensammlung/forms/form-comment.html b/src/fellchensammlung/templates/fellchensammlung/forms/form-comment.html index 7c06780..2b4ab33 100644 --- a/src/fellchensammlung/templates/fellchensammlung/forms/form-comment.html +++ b/src/fellchensammlung/templates/fellchensammlung/forms/form-comment.html @@ -1,7 +1,13 @@ {% load i18n %} +{% load crispy_forms_tags %} +
+ + {% blocktrans %} + Als {{ user }} kommentieren + {% endblocktrans %} + -
\ No newline at end of file + {% crispy comment_form %} + +