From 23baa7e27f24877d66a18829074d71d090bb5b92 Mon Sep 17 00:00:00 2001 From: "Toavina A." Date: Thu, 19 Sep 2024 11:43:08 +0300 Subject: [PATCH] ZaRR dataset read page to look like WHO-AFRO (#30) * draft * Refactored in fjelltopp-theme --- ckanext/zarr/assets/css/zarr.css | 4 - ckanext/zarr/assets/css/zarr_palette.css | 3 + .../zarr/templates/package/resource_read.html | 13 --- .../package/snippets/additional_info.html | 82 ------------------- 4 files changed, 3 insertions(+), 99 deletions(-) delete mode 100644 ckanext/zarr/templates/package/resource_read.html delete mode 100644 ckanext/zarr/templates/package/snippets/additional_info.html diff --git a/ckanext/zarr/assets/css/zarr.css b/ckanext/zarr/assets/css/zarr.css index 6a4df17..049905f 100644 --- a/ckanext/zarr/assets/css/zarr.css +++ b/ckanext/zarr/assets/css/zarr.css @@ -256,10 +256,6 @@ margin-top: 36px; } -.package-read .module-content { - margin-top: 36px; -} - @media only screen and (max-width: 1199px) { .desc-wide { display: none; diff --git a/ckanext/zarr/assets/css/zarr_palette.css b/ckanext/zarr/assets/css/zarr_palette.css index 86c8649..8daa678 100644 --- a/ckanext/zarr/assets/css/zarr_palette.css +++ b/ckanext/zarr/assets/css/zarr_palette.css @@ -3,6 +3,9 @@ --theme: 'zarr'; /* palette */ --primary: #13240F; + --primary-rgb-red: 0; + --primary-rgb-green: 41; + --primary-rgb-blue: 32; --secondary: #198A00; --background: #DFF0DB; --tag: #EF7D00; diff --git a/ckanext/zarr/templates/package/resource_read.html b/ckanext/zarr/templates/package/resource_read.html deleted file mode 100644 index ea385c3..0000000 --- a/ckanext/zarr/templates/package/resource_read.html +++ /dev/null @@ -1,13 +0,0 @@ -{% ckan_extends %} - -{% block secondary_content %} - - {% block resources_list %} - {% snippet "package/snippets/resources.html", pkg=pkg, active=res.id, action='read' %} - {% endblock %} - - - -

{{ _('License') }}{% snippet "snippets/resource_license.html", pkg_dict=pkg, text_only=True %}

- -{% endblock %} diff --git a/ckanext/zarr/templates/package/snippets/additional_info.html b/ckanext/zarr/templates/package/snippets/additional_info.html deleted file mode 100644 index 5d91e6b..0000000 --- a/ckanext/zarr/templates/package/snippets/additional_info.html +++ /dev/null @@ -1,82 +0,0 @@ -{% macro get_pkg_value(pkg_dict, field_name) %} - {% if field_name in pkg_dict %} - {{ pkg_dict[field_name] }} - {% else %} - {% for extra in pkg_dict.extras %} - {% if extra.key == field_name %} - {{ extra.value }} - {% endif %} - {% endfor %} - {% endif %} -{% endmacro %} - - -
-

{{ _('Metadata') }}

- {% block package_additional_info_for_zarr %} - - {% set groups = {} %} - {% for field in schema.dataset_fields %} - {% if field.display_group %} - {% if field.display_group not in groups %} - {% do groups.update({field.display_group: []}) %} - {% endif %} - {% do groups[field.display_group].append(field) %} - {% endif %} - {% endfor %} - - {% for group, fields in groups.items() %} - {% set ns = namespace(show_group=false, value='') %} - {% for field in fields %} - {% set value = get_pkg_value(pkg_dict, field.field_name) | trim %} - {% if value != '' and value != '[]' %} - {% set ns.show_group = true %} - {% endif %} - {% endfor %} - - {% if ns.show_group %} -

{{ _(group) }}

- - - {% for field in fields %} - {% set ns.value = get_pkg_value(pkg_dict, field.field_name) | trim %} - {% if ns.value != '' and ns.value != '[]' %} - {% if field.field_name not in exclude_fields and field.display_snippet is not none %} - - - - - {% endif %} - {% endif %} - {% endfor %} - {% if group == 'Overview' %} - - - - - {% endif %} - -
{{ h.scheming_language_text(field.label) }}{%- snippet 'scheming/snippets/display_field.html', field=field, data=pkg_dict, schema=schema -%} -
{{ _("Visibility") }} - {% if pkg_dict.private %} - {{ _("Private") }} - {% else %} - {{ _("Public") }} - {% endif %} -
- {% endif %} - {% endfor %} - {% if h.check_access('package_update',{'id':pkg_dict.id}) %} -

{{ _("Dataset Status") }}

- - - - - - - -
{{ _("State") }}{{ _(pkg_dict.state) }}
- {% endif %} - - {% endblock %} -
\ No newline at end of file