-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: do not bump version, fix render_fields.html formatting
- Loading branch information
Showing
2 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
48 changes: 24 additions & 24 deletions
48
ckanext/scheming/templates/scheming/snippets/render_fields.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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
{#} | ||
fields - a list of scheming field dictionaries | ||
data - form data fields | ||
errors - A dict of errors for the fields | ||
entity_type - entity type | ||
object_type - object type | ||
set_fields_defaults - flag to set the default field values | ||
{# | ||
fields - a list of scheming field dictionaries | ||
data - form data fields | ||
errors - A dict of errors for the fields | ||
entity_type - entity type | ||
object_type - object type | ||
set_fields_defaults - flag to set the default field values | ||
{#} | ||
|
||
{% for field in fields if field.form_snippet is not none %} | ||
{% if field.field_name not in data and set_fields_defaults %} | ||
{# Set the field default value before rendering but only if | ||
it doesn't already exist in data which would mean the form | ||
has been submitted. #} | ||
{% if field.default_jinja2 %} | ||
{% do data.__setitem__(field.field_name, h.scheming_render_from_string(field.default_jinja2)) %} | ||
{% elif field.default %} | ||
{% do data.__setitem__(field.field_name, field.default) %} | ||
{% endif %} | ||
{% if field.field_name not in data and set_fields_defaults %} | ||
{# Set the field default value before rendering but only if | ||
it doesn't already exist in data which would mean the form | ||
has been submitted. #} | ||
{% if field.default_jinja2 %} | ||
{% do data.__setitem__(field.field_name, h.scheming_render_from_string(field.default_jinja2)) %} | ||
{% elif field.default %} | ||
{% do data.__setitem__(field.field_name, field.default) %} | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% snippet 'scheming/snippets/form_field.html', | ||
field=field, | ||
data=data, | ||
errors=errors, | ||
licenses=licenses, | ||
entity_type=entity_type, | ||
object_type=object_type | ||
%} | ||
{% snippet 'scheming/snippets/form_field.html', | ||
field=field, | ||
data=data, | ||
errors=errors, | ||
licenses=licenses, | ||
entity_type=entity_type, | ||
object_type=object_type | ||
%} | ||
{% endfor %} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from setuptools import setup, find_packages | ||
|
||
version = '3.0.1' | ||
version = '3.0.0' | ||
|
||
setup( | ||
name='ckanext-scheming', | ||
|