Skip to content

Commit

Permalink
Merge pull request #354 from ckan/package_id_in_resource_fields
Browse files Browse the repository at this point in the history
Pass dataset name to resource fields snippets
  • Loading branch information
wardi authored Jan 11, 2023
2 parents d410f83 + 6d80db8 commit 658fc3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@
{% do data.__setitem__(field.field_name, field.default) %}
{% endif %}
{% endif -%}
{# We pass pkg_name as the package_id because that's the only
variable available in this snippet #}
{%- snippet 'scheming/snippets/form_field.html',
field=field,
data=data,
errors=errors,
licenses=c.licenses,
entity_type='dataset',
object_type=dataset_type
object_type=dataset_type,
package_id=pkg_name
-%}
{%- endif -%}
{%- endfor -%}
Expand Down
3 changes: 2 additions & 1 deletion ckanext/scheming/templates/scheming/snippets/form_field.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
errors=errors,
licenses=licenses,
entity_type=entity_type,
object_type=object_type
object_type=object_type,
package_id=package_id
-%}

0 comments on commit 658fc3f

Please sign in to comment.