Skip to content

Commit

Permalink
Merge pull request #412 from ckan/add-snippets
Browse files Browse the repository at this point in the history
Add two new snippets
  • Loading branch information
wardi authored Jun 17, 2024
2 parents 9a33dcd + 6424829 commit 83a66ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ h.localised_filesize(data[field.field_name]) }}
16 changes: 16 additions & 0 deletions ckanext/scheming/templates/scheming/form_snippets/number.html
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit 83a66ca

Please sign in to comment.