diff --git a/ckanext/canada/i18n/fr/LC_MESSAGES/canada.po b/ckanext/canada/i18n/fr/LC_MESSAGES/canada.po index 6f907a293..89770d1ef 100644 --- a/ckanext/canada/i18n/fr/LC_MESSAGES/canada.po +++ b/ckanext/canada/i18n/fr/LC_MESSAGES/canada.po @@ -1487,6 +1487,9 @@ msgstr "Catégorie thématique" msgid "Format" msgstr "Format" +msgid "Type" +msgstr "Type" + msgid "Resource Type" msgstr "Type de ressource" diff --git a/ckanext/canada/schemas/presets.yaml b/ckanext/canada/schemas/presets.yaml index 0ece55a5a..93fc2dcc2 100644 --- a/ckanext/canada/schemas/presets.yaml +++ b/ckanext/canada/schemas/presets.yaml @@ -3423,6 +3423,7 @@ presets: fr: Taille [estimative] d’une distribution en octets form_panel: resource validators: ignore_missing int_validator + display_snippet: size.html # Field = Character Set. # {This is the character set of the dataset} diff --git a/ckanext/canada/templates/public/package/snippets/resource_item.html b/ckanext/canada/templates/public/package/snippets/resource_item.html index 9980d69a3..55c43d45c 100644 --- a/ckanext/canada/templates/public/package/snippets/resource_item.html +++ b/ckanext/canada/templates/public/package/snippets/resource_item.html @@ -10,6 +10,7 @@ {% set type_field = h.scheming_field_by_name(schema.resource_fields, 'resource_type') %} {% set format_field = h.scheming_field_by_name(schema.resource_fields, 'format') %} {% set lang_field = h.scheming_field_by_name(schema.resource_fields, 'language') %} +{% set size_field = h.scheming_field_by_name(schema.resource_fields, 'size') %} {# FIXME: using tables for formatting #} @@ -36,6 +37,10 @@ {% snippet 'scheming/snippets/display_field.html', field=lang_field, data=res, entity_type='dataset', object_type=pkg.type %} + + {% snippet 'scheming/snippets/display_field.html', + field=size_field, data=res, entity_type='dataset', object_type=pkg.type %} + {{ _('Access') }} diff --git a/ckanext/canada/templates/public/package/snippets/resources_list.html b/ckanext/canada/templates/public/package/snippets/resources_list.html index 87469c9f3..c3d4b67de 100644 --- a/ckanext/canada/templates/public/package/snippets/resources_list.html +++ b/ckanext/canada/templates/public/package/snippets/resources_list.html @@ -7,15 +7,17 @@

{% block resource_list_title %}{{ _('Resources') }}{% endblock %}

{% if pkg.resources %} {% block resource_list_inner %} +
+ "columnDefs": [ { "orderable": false, "targets": [4,5] }]}'> - - + + + @@ -26,6 +28,7 @@

{% block resource_list_title %}{{ _('Resources') }}{% endblock %}

{% endfor %}
{{ _('Resource Name') }}{{ _('Resource Type') }}{{ _('Name') }}{{ _('Type') }} {{ _('Format') }} {{ _('Language') }}{{ _('File Size') }} {{ _('Links') }}
+
{% endblock %} {% endif %} {% else %} diff --git a/ckanext/canada/templates/public/scheming/display_snippets/size.html b/ckanext/canada/templates/public/scheming/display_snippets/size.html new file mode 100644 index 000000000..2337ce004 --- /dev/null +++ b/ckanext/canada/templates/public/scheming/display_snippets/size.html @@ -0,0 +1 @@ +{{ h.localised_filesize(data[field.field_name] | int) if data[field.field_name] }}