From 7659e2da9c2a7c91560ff3b2d6b291687e7c2312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Josemar=C3=ADa?= Date: Sat, 20 Apr 2019 16:27:25 -0500 Subject: [PATCH] Styled file field with materializecss template filter --- templates/materializecssform/field.html | 67 +++++++++++++++++++++---- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/templates/materializecssform/field.html b/templates/materializecssform/field.html index 2c01f0cd490..1695498a3a7 100644 --- a/templates/materializecssform/field.html +++ b/templates/materializecssform/field.html @@ -171,19 +171,66 @@ {% endif %} {% elif field|is_file %} -
+
+ {% if field.auto_id %}

- {% if field.auto_id %} -

+ {% endif %} + + {% with field.field.widget as widget %} + {% if field.value %} +

+ {{ widget.initial_text }}: + + {{ field.value }} + + {% if not widget.required %} + + {% endif %} - -
+

{% endif %} - {{ field }} -

+ {% endwith %} + +
+

+

+ + {% trans "File" %} + + +
+
+ +
+

+ {% for error in field.errors %} +

+ {{ error }} +

+ {% endfor %} + {% if field.help_text %} +

+ {{ field.help_text|safe }} +

+ {% endif %} +
{% elif field|is_versatile_image_ppoi_click_widget %}