From cf8dad57634e42b6a1c6b442a9fe658a830646e7 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Wed, 17 Mar 2021 22:37:13 -0700 Subject: [PATCH] fix object journal styles --- netbox/extras/forms.py | 6 ++++ netbox/templates/extras/object_journal.html | 32 ++++++++++----------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/netbox/extras/forms.py b/netbox/extras/forms.py index b12ecc11d..7720905d7 100644 --- a/netbox/extras/forms.py +++ b/netbox/extras/forms.py @@ -377,6 +377,12 @@ class ImageAttachmentForm(BootstrapMixin, forms.ModelForm): class JournalEntryForm(BootstrapMixin, forms.ModelForm): + kind = forms.ChoiceField( + choices=add_blank_choice(JournalEntryKindChoices), + required=False, + widget=StaticSelect2() + ) + class Meta: model = JournalEntry fields = ['assigned_object_type', 'assigned_object_id', 'kind', 'comments'] diff --git a/netbox/templates/extras/object_journal.html b/netbox/templates/extras/object_journal.html index 6c50ca547..8417dd380 100644 --- a/netbox/templates/extras/object_journal.html +++ b/netbox/templates/extras/object_journal.html @@ -3,30 +3,30 @@ {% block title %}{{ block.super }} - Journal{% endblock %} +{% render_errors form %} + {% block content %} {% if perms.extras.add_journalentry %} -
-
- New Journal Entry -
-
+
+
+

New Journal Entry

+ {% csrf_token %} {% for field in form.hidden_fields %} {{ field }} {% endfor %} -
-
- {% render_field form.kind %} - {% render_field form.comments %} -
-
- - Cancel -
-
+ {% render_field form.kind %} + {% render_field form.comments %}
+
+ Cancel + +
+
{% endif %} - {% include 'panel_table.html' %} +
+ {% include 'panel_table.html' %} +
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %} {% endblock %}