summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-03-24 10:31:52 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-08 09:58:50 +0200
commitc814bd19a943dcc71ec435caafa7cc9569137e20 (patch)
tree74f205d9d8e4c22e479fba867e8983879d477a51 /ishtar_common/templates
parentc4326466ffed98aea0cb65f0adedb64c24bfe3d1 (diff)
downloadIshtar-c814bd19a943dcc71ec435caafa7cc9569137e20.tar.bz2
Ishtar-c814bd19a943dcc71ec435caafa7cc9569137e20.zip
Improve file widget with bootstrap
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/widgets/clearable_file_input.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/ishtar_common/templates/widgets/clearable_file_input.html b/ishtar_common/templates/widgets/clearable_file_input.html
new file mode 100644
index 000000000..f2721fbfd
--- /dev/null
+++ b/ishtar_common/templates/widgets/clearable_file_input.html
@@ -0,0 +1,8 @@
+{% load i18n %}{% if widget.is_initial %}
+<p class="file-upload w-100 mb-1">{{ widget.initial_text }}{% trans ":" %} <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
+&nbsp; <span class="clearable-file-input">
+<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
+<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label></span>{% endif %}
+</p>
+<p class="w-100 m-0">{{ widget.input_text }}{% trans ":" %}</p>{% endif %}
+<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>