diff --git a/ckanext/scheming/templates/scheming/form_snippets/upload.html b/ckanext/scheming/templates/scheming/form_snippets/upload.html index d4798eaf..f57932cf 100644 --- a/ckanext/scheming/templates/scheming/form_snippets/upload.html +++ b/ckanext/scheming/templates/scheming/form_snippets/upload.html @@ -1,7 +1,8 @@ {% import 'macros/form.html' as form %} {%- set is_upload = (data.url_type == 'upload') -%} -{{ form.image_upload( + +{% call form.image_upload( data, errors, field_url=field.field_name, @@ -12,8 +13,10 @@ is_upload=is_upload, upload_label=h.scheming_language_text(field.upload_label), url_label=h.scheming_language_text(field.label), + classes=field.classes if 'classes' in field else ['control-medium'], + attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))), placeholder=field.form_placeholder - ) -}} -{# image_upload macro doesn't support call #} -{%- snippet 'scheming/form_snippets/help_text.html', field=field -%} + ) +%} + {%- snippet 'scheming/form_snippets/help_text.html', field=field -%} +{% endcall %} \ No newline at end of file