diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 40a6427171dea70fc53d977519710d1823c734f1..2ee20198e28dbb00f0bc48a200dfe4da6620f703 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -351,6 +351,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm 'get_body_mail':helpers_odsh.get_body_mail, 'odsh_load_mdk_sample_dataset': helpers_odsh.odsh_load_mdk_sample_dataset, 'odsh_load_raw_mdk_sample_dataset': helpers_odsh.odsh_load_raw_mdk_sample_dataset, + 'format_resource_format': helpers_odsh.format_resource_format, } diff --git a/ckanext/odsh/templates/snippets/package_item.html b/ckanext/odsh/templates/snippets/package_item.html index af56d32b0412be195455e800a548512e5bb22d32..f38bbe026cf8ab289d93e0c3a5b915da5a6b1483 100644 --- a/ckanext/odsh/templates/snippets/package_item.html +++ b/ckanext/odsh/templates/snippets/package_item.html @@ -128,7 +128,7 @@ Example: {% for resource in h.dict_list_reduce(package.resources, 'format') %} <li> <a href="{{ h.url_for(package.type ~ '.read', id=package.name) }}" class="badge badge-default dataformat-label" - data-format="{{ resource.lower().replace('_srvc','') }}"> + data-format="{{ h.format_resource_format(resource).lower() }}"> {{ h.format_resource_format(resource) }} </a> </li>