From 4f1275bdde1b4565a62cf64ea1343911e5fbb55b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jan 2018 18:51:38 +0100 Subject: UI: improve parcel form --- ishtar_common/widgets.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 59a034c00..84a58c98c 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -251,11 +251,13 @@ class Select2MultipleField(forms.MultipleChoiceField): class DeleteWidget(forms.CheckboxInput): def render(self, name, value, attrs=None, renderer=None): final_attrs = flatatt( - self.build_attrs(attrs, {"name": name, "value": '1'})) - output = [''] - output.append(u"%s" % (final_attrs, _("Delete"))) - output.append('') - return mark_safe('\n'.join(output)) + self.build_attrs( + attrs, {"name": name, "value": '1', + 'class': "btn btn-danger"}) + ) + output = u"%s" % (final_attrs, _("Delete")) + + return mark_safe(output) class ImageFileInput(ClearableFileInput): -- cgit v1.2.3