File tree 4 files changed +13
-13
lines changed
image_uploader_widget/templates/admin
image_uploader_widget_demo
4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 33
33
{% endfor %}
34
34
< div class ="iuw-add-image-btn ">
35
35
{% if inline_admin_formset.formset.add_icon %}
36
- {{ inline_admin_formset.formset.add_icon }}
36
+ {{ inline_admin_formset.formset.add_icon|safe }}
37
37
{% else %}
38
38
< svg class ="add-icon " xmlns ="http://www.w3.org/2000/svg " viewBox ="0 0 24 24 " xmlns:xlink ="http://www.w3.org/1999/xlink " xml:space ="preserve " width ="100% " height ="100% "> < path xmlns ="http://www.w3.org/2000/svg " d ="M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z "> </ path > </ svg >
39
39
{% endif %}
47
47
</ div >
48
48
< div class ="iuw-empty ">
49
49
{% if inline_admin_formset.formset.empty_icon %}
50
- {{ inline_admin_formset.formset.empty_icon }}
50
+ {{ inline_admin_formset.formset.empty_icon|safe }}
51
51
{% else %}
52
52
< svg xmlns ="http://www.w3.org/2000/svg " fill ="currentColor " class ="bi bi-cloud-upload " viewBox ="0 0 16 16 " xmlns:xlink ="http://www.w3.org/1999/xlink " xml:space ="preserve " width ="100% " height ="100% "> < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z "> </ path > < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M7.646 4.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V14.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3z "> </ path > </ svg >
53
53
{% endif %}
61
61
</ div >
62
62
< div class ="iuw-drop-label ">
63
63
{% if inline_admin_formset.formset.drop_icon %}
64
- {{ inline_admin_formset.formset.drop_icon }}
64
+ {{ inline_admin_formset.formset.drop_icon|safe }}
65
65
{% else %}
66
66
< svg xmlns ="http://www.w3.org/2000/svg " fill ="currentColor " class ="bi bi-cloud-upload " viewBox ="0 0 16 16 " xmlns:xlink ="http://www.w3.org/1999/xlink " xml:space ="preserve " width ="100% " height ="100% "> < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z "> </ path > < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M7.646 4.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V14.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3z "> </ path > </ svg >
67
67
{% endif %}
Original file line number Diff line number Diff line change 5
5
6
6
< div class ="iuw-drop-label ">
7
7
{% if custom.drop_icon %}
8
- {{ custom.drop_icon }}
8
+ {{ custom.drop_icon|safe }}
9
9
{% else %}
10
10
< svg xmlns ="http://www.w3.org/2000/svg " fill ="currentColor " class ="bi bi-cloud-upload " viewBox ="0 0 16 16 " xmlns:xlink ="http://www.w3.org/1999/xlink " xml:space ="preserve " width ="100% " height ="100% "> < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z "> </ path > < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M7.646 4.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V14.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3z "> </ path > </ svg >
11
11
{% endif %}
19
19
</ div >
20
20
< div class ="iuw-empty ">
21
21
{% if custom.empty_icon %}
22
- {{ custom.empty_icon }}
22
+ {{ custom.empty_icon|safe }}
23
23
{% else %}
24
24
< svg xmlns ="http://www.w3.org/2000/svg " fill ="currentColor " class ="bi bi-cloud-upload " viewBox ="0 0 16 16 " xmlns:xlink ="http://www.w3.org/1999/xlink " xml:space ="preserve " width ="100% " height ="100% "> < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z "> </ path > < path xmlns ="http://www.w3.org/2000/svg " fill-rule ="evenodd " d ="M7.646 4.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V14.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3z "> </ path > </ svg >
25
25
{% endif %}
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ class Meta:
14
14
model = CustomWidget
15
15
widgets = {
16
16
'image' : ImageUploaderWidget (
17
- drop_icon = "< drop_icon> " ,
18
- drop_text = "< drop_text> " ,
19
- empty_icon = "< empty_icon> " ,
20
- empty_text = "< empty_text> " ,
17
+ drop_icon = "@ drop_icon@ " ,
18
+ drop_text = "@ drop_text@ " ,
19
+ empty_icon = "@ empty_icon@ " ,
20
+ empty_text = "@ empty_text@ " ,
21
21
),
22
22
}
23
23
fields = '__all__'
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def test_render_custom_icons_and_texts(self):
6
6
form = TestCustomForm ()
7
7
text = form .as_p ()
8
8
9
- self .assertTrue ("< drop_icon> " in text )
10
- self .assertTrue ("< drop_text> " in text )
11
- self .assertTrue ("< empty_icon> " in text )
12
- self .assertTrue ("< empty_text> " in text )
9
+ self .assertTrue ("@ drop_icon@ " in text )
10
+ self .assertTrue ("@ drop_text@ " in text )
11
+ self .assertTrue ("@ empty_icon@ " in text )
12
+ self .assertTrue ("@ empty_text@ " in text )
You can’t perform that action at this time.
0 commit comments