From 1d5f8b93ad4a93bbd93ac75c0d9d1afe1cf3e8fa Mon Sep 17 00:00:00 2001 From: long2ice Date: Thu, 6 May 2021 22:58:49 +0800 Subject: [PATCH] update image input --- fastapi_admin/templates/widgets/inputs/image.html | 13 +++++++++++++ fastapi_admin/widgets/inputs.py | 1 + 2 files changed, 14 insertions(+) create mode 100644 fastapi_admin/templates/widgets/inputs/image.html diff --git a/fastapi_admin/templates/widgets/inputs/image.html b/fastapi_admin/templates/widgets/inputs/image.html new file mode 100644 index 0000000..44f2b10 --- /dev/null +++ b/fastapi_admin/templates/widgets/inputs/image.html @@ -0,0 +1,13 @@ +
+ + {% if value %} +
+ {% endif %} + + {% if help_text %} + + {{ help_text }} + + {% endif %} +
\ No newline at end of file diff --git a/fastapi_admin/widgets/inputs.py b/fastapi_admin/widgets/inputs.py index 0f9ea64..988a3d9 100644 --- a/fastapi_admin/widgets/inputs.py +++ b/fastapi_admin/widgets/inputs.py @@ -234,6 +234,7 @@ class File(Input): class Image(File): + template = "widgets/inputs/image.html" input_type = "file"