diff --git a/ckanext/scheming/templates/scheming/display_snippets/file_size.html b/ckanext/scheming/templates/scheming/display_snippets/file_size.html new file mode 100644 index 00000000..ca7e5057 --- /dev/null +++ b/ckanext/scheming/templates/scheming/display_snippets/file_size.html @@ -0,0 +1 @@ +{{ h.localised_filesize(data[field.field_name]) }} diff --git a/ckanext/scheming/templates/scheming/form_snippets/number.html b/ckanext/scheming/templates/scheming/form_snippets/number.html new file mode 100644 index 00000000..bed99336 --- /dev/null +++ b/ckanext/scheming/templates/scheming/form_snippets/number.html @@ -0,0 +1,16 @@ +{% import 'macros/form.html' as form %} +{% call form.input( + field.field_name, + id='field-' + field.field_name, + label=h.scheming_language_text(field.label), + placeholder=h.scheming_language_text(field.form_placeholder), + type='number', + value=data.get(field.field_name), + error=errors[field.field_name], + classes=field.classes if 'classes' in field else ['control-medium'], + attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))), + is_required=h.scheming_field_required(field) + ) +%} + {%- snippet 'scheming/form_snippets/help_text.html', field=field -%} +{% endcall %}