-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* `number.html` for form fields that require a number value * `file_size.html` to display resource sizes in a human friendly way
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
ckanext/scheming/templates/scheming/display_snippets/file_size.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
16
ckanext/scheming/templates/scheming/form_snippets/number.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |