summaryrefslogtreecommitdiff
path: root/ishtar_common/widgets.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-01-16 18:51:38 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-01-16 18:51:38 +0100
commit60422080838102e4c78e930126e98711734ed0e1 (patch)
tree3464fa1d2937ca936eedf02cfb253da1aeff4fef /ishtar_common/widgets.py
parenta6530a965b088699005bd0d7438afd42e128d527 (diff)
downloadIshtar-60422080838102e4c78e930126e98711734ed0e1.tar.bz2
Ishtar-60422080838102e4c78e930126e98711734ed0e1.zip
UI: improve parcel form
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r--ishtar_common/widgets.py12
1 files changed, 7 insertions, 5 deletions
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 = ['<tr class="delete"><td colspan="2">']
- output.append(u"<button%s>%s</button>" % (final_attrs, _("Delete")))
- output.append('</td></tr>')
- return mark_safe('\n'.join(output))
+ self.build_attrs(
+ attrs, {"name": name, "value": '1',
+ 'class': "btn btn-danger"})
+ )
+ output = u"<button%s>%s</button>" % (final_attrs, _("Delete"))
+
+ return mark_safe(output)
class ImageFileInput(ClearableFileInput):