diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.css b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.css index dd726e8555..39bd7a0429 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.css +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.css @@ -82,22 +82,27 @@ } /* END Style Resources List*/ /* Style Additional Info */ -.additional-info table tr { - height: 38px; - font-family: 'Source Sans Pro', sans-serif; +.additional-info .additional-info-content .dataset-label { + color: #1F2937; + font-family: 'Gotham-Bold', sans-serif; + font-size: 12px; font-weight: 400; - font-size: 14px; + line-height: 14.4px; + text-transform: uppercase; } -.additional-info td { - text-align: justify; - word-break: break-word; +.additional-info .additional-info-content .dataset-details { + color: #000; + font-family: 'Source Sans Pro', sans-serif; + font-size: 14px; + line-height: 18px; + margin-top: 0.25rem; } -.additional-info td.dataset-details pre { - text-wrap: wrap; +.additional-info .additional-info-content .dataset-details .tag-wrapper { + float: none; + display: inline-block; } -.additional-info th { - max-width: 200px; - width: 190px; +.additional-info .additional-info-content .quick-edit .dataset-details { + padding-right: 0; } /* END Style Additional Info */ /* Resource grouping */ @@ -118,9 +123,16 @@ font-size: 24px; margin-left: 5px; } +.wrapper-secondary.col-4 { + border-right: 0; +} .wrapper-secondary .form-check .form-check-input { box-shadow: none; } +.wrapper-primary.col-8 { + border-left: 0; + margin-left: 0; +} .notification-platform-opt-in-action-menu { cursor: pointer; background-color: #007CE1; diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.js b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.js index e7caccff1b..ff6c85d00d 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.js +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/dataset.js @@ -15,12 +15,18 @@ $(document).ready(function() { } ); - $('#show-more-dates, #hide-more-dates').on('click', function(e) { + $('#show-extra-dates, #hide-extra-dates').on('click', function(e) { e.preventDefault(); - $('#show-more-dates, #hide-more-dates').toggleClass('d-none'); + $('#show-extra-dates, #hide-extra-dates').toggleClass('d-none'); $('.more-dates').toggleClass('d-none'); }); + $('#show-extra-fields, #hide-extra-fields').on('click', function(e) { + e.preventDefault(); + $('#show-extra-fields, #hide-extra-fields').toggleClass('d-none'); + $('.additional-info-extra-fields').toggleClass('d-none'); + }); + $('#showDatasetActivity').on('change', function() { $('.dataset-activity-wrapper').toggleClass('d-none'); }); diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/stats-chart.js b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/stats-chart.js index 8a1d3de8ef..24cc013d8a 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/stats-chart.js +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/datasets/stats-chart.js @@ -128,7 +128,7 @@ $(document).ready(function(){ if (chartData.length > 0){ setupDatasetDownloads(datasetDwdId, "#dataset-downloads-chart"); } else { - $("#dataset-downloads-chart-no-data").show(); + $("#dataset-downloads-chart-no-data").removeClass('d-none'); } } }); diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset-light.css b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset-light.css index 083dcf0ffd..d2a771b96d 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset-light.css +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset-light.css @@ -82,22 +82,27 @@ } /* END Style Resources List*/ /* Style Additional Info */ -.additional-info table tr { - height: 38px; - font-family: 'Source Sans Pro', sans-serif; +.additional-info .additional-info-content .dataset-label { + color: #1F2937; + font-family: 'Gotham-Bold', sans-serif; + font-size: 12px; font-weight: 400; - font-size: 14px; + line-height: 14.4px; + text-transform: uppercase; } -.additional-info td { - text-align: justify; - word-break: break-word; +.additional-info .additional-info-content .dataset-details { + color: #000; + font-family: 'Source Sans Pro', sans-serif; + font-size: 14px; + line-height: 18px; + margin-top: 0.25rem; } -.additional-info td.dataset-details pre { - text-wrap: wrap; +.additional-info .additional-info-content .dataset-details .tag-wrapper { + float: none; + display: inline-block; } -.additional-info th { - max-width: 200px; - width: 190px; +.additional-info .additional-info-content .quick-edit .dataset-details { + padding-right: 0; } /* END Style Additional Info */ /* Resource grouping */ @@ -118,9 +123,16 @@ font-size: 24px; margin-left: 5px; } +.wrapper-secondary.col-4 { + border-right: 0; +} .wrapper-secondary .form-check .form-check-input { box-shadow: none; } +.wrapper-primary.col-8 { + border-left: 0; + margin-left: 0; +} .notification-platform-opt-in-action-menu { cursor: pointer; background-color: #007CE1; diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset.js b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset.js index 735172e0f1..d1cd746c70 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset.js +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/light/dataset/dataset.js @@ -20,9 +20,15 @@ $(document).ready(function() { } }); - $('#show-more-dates, #hide-more-dates').on('click', function(e) { + $('#show-extra-dates, #hide-extra-dates').on('click', function(e) { e.preventDefault(); - $('#show-more-dates, #hide-more-dates').toggleClass('d-none'); + $('#show-extra-dates, #hide-extra-dates').toggleClass('d-none'); $('.more-dates').toggleClass('d-none'); }); + + $('#show-extra-fields, #hide-extra-fields').on('click', function(e) { + e.preventDefault(); + $('#show-extra-fields, #hide-extra-fields').toggleClass('d-none'); + $('.additional-info-extra-fields').toggleClass('d-none'); + }); }); diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/search_/search.js b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/search_/search.js index f101e1e160..188edbf757 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/search_/search.js +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/search_/search.js @@ -145,10 +145,10 @@ $('document').ready(function(){ $results.hide(); }); - $('.show-more-dates, .hide-more-dates').on('click', function(e) { + $('.show-extra-dates, .hide-extra-dates').on('click', function(e) { e.preventDefault(); var parent = $(this).closest('.dataset-dates'); - $('.show-more-dates, .hide-more-dates', parent).toggleClass('d-none'); + $('.show-extra-dates, .hide-extra-dates', parent).toggleClass('d-none'); $('.more-dates', parent).toggleClass('d-none'); }); }); diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml index 15e6be0fb6..120aeacba0 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml @@ -654,6 +654,7 @@ dataset-light-scripts: - hdx_theme/dataset-light-styles contents: - light/dataset/dataset.js + - select2/select2.js dataset-light-styles: <<: *common-css diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/hdx-styles/src/common/less/datasets/dataset.less b/ckanext-hdx_theme/ckanext/hdx_theme/hdx-styles/src/common/less/datasets/dataset.less index 7c1dad96ca..b46cecacb3 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/hdx-styles/src/common/less/datasets/dataset.less +++ b/ckanext-hdx_theme/ckanext/hdx_theme/hdx-styles/src/common/less/datasets/dataset.less @@ -1,5 +1,6 @@ @import "../base/variables"; @import "../base/mixins"; +@import "../bem.blocks/bem_variables"; /** OLD Dataset CSS **/ @@ -96,26 +97,34 @@ /* Style Additional Info */ .additional-info { - table tr { - height: 38px; - font-family: 'Source Sans Pro', sans-serif; - font-weight: 400; - font-size: 14px; - } + .additional-info-content { + .dataset-label { + color: @blue-medium-dark-color; + font-family: @gothamBoldFont; + font-size: 12px; + font-weight: 400; + line-height: 14.4px; + text-transform: uppercase; + } - td { - text-align: justify; - word-break: break-word; - &.dataset-details { - pre { - text-wrap: wrap; + .dataset-details { + color: @black-color; + font-family: 'Source Sans Pro', sans-serif; + font-size: 14px; + line-height: 18px; + margin-top: .25rem; + + .tag-wrapper { + float: none; + display: inline-block; } } - } - th { - max-width: 200px; - width: 190px; + .quick-edit { + .dataset-details { + padding-right: 0; + } + } } } /* END Style Additional Info */ @@ -145,12 +154,21 @@ } .wrapper-secondary { + &.col-4 { + border-right: 0; + } .form-check { .form-check-input { box-shadow: none; } } } +.wrapper-primary { + &.col-8 { + border-left: 0; + margin-left: 0; + } +} .notification-platform-opt-in-action-menu { cursor: pointer; diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/light/dataset/additional_info.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/light/dataset/additional_info.html deleted file mode 100644 index cbd5aa2eb4..0000000000 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/light/dataset/additional_info.html +++ /dev/null @@ -1,183 +0,0 @@ -
{{ _('Source') }} | -{{ pkg_dict.dataset_source }} | -
---|---|
{{ _('Contributor') }} | -- {% if pkg_dict.owner_org %} - {% set org_id = pkg_dict.owner_org or pkg_dict.organization.name %} - - {{ pkg_dict.organization.title }} - - {% endif %} - | -
{{_('Time Period of the Dataset')}} [?] | -{{ h.render_date_from_concat_str(pkg_dict.dataset_date) }} ... {{ _('More') }} | -
{{_('Modified')}} [?] | -- {{ h.render_datetime(modified_time) }} - | -
{{_('Confirmed')}} [?] | -- {{ h.render_datetime(confirmed_time) }} - | -
{{_('Dataset Added on HDX')}} [?] | -- {{ h.render_datetime(hdx_added_time) }} {{ _('Less') }} - | -
{{ _('Expected Update Frequency') }} | -{{ h.hdx_get_frequency_by_value(pkg_dict.data_update_frequency) }} | -
{{ _('Location') }} | -- | - -
{{ _('Visibility') }} | -
- {% if pkg_dict.private %}
-
- {{ _('Private') }} -
- {{ _('make it public') }}
-
- {% else %}
-
- {{ _('Public') }} -
- {{ _('make it private') }}
-
- {% endif %}
- |
-
{{ _('Visibility') }} | -
- {% if pkg_dict.private %}
- {{ _('Private') }}
- {% else %}
- {{ _('Public') }}
- {% endif %}
- |
-
{{ _('License') }} | -- {% if pkg_dict.license_id %} - {{ h.hdx_find_license_name(pkg_dict.license_id, pkg_dict.license_title) }} - {% if pkg_dict.license_id == 'hdx-other' and pkg_dict.license_other %} - : - {% endif %} - {% endif %} - | -
{{ _('Field Names') }} | -{{ pkg_dict.field_names | replace(",", ", ") }} | -
{{ _('File Types') }} | -{{ pkg_dict.file_types | replace(",", ", ") }} | -
{{ _('Number of Rows') }} | -{{ pkg_dict.num_of_rows }} | -
{{ _('Methodology') }} | - {% set methodology, methodology_other = h.methodology_bk_compat(pkg_dict.methodology, pkg_dict.methodology_other) %} -- | - -
{{ _('Caveats / Comments') }} | -- |
{{ _('Tags') }} | -
-
-
-
- {% for tag in pkg_dict.tags %}
-
-
- {% if tag.vocabulary_id %}
- {{ tag.display_name }}
- {% else %}
- {{ tag.display_name }}
- {% endif %}
-
- {% endfor %}
- |
-
{{ _('File Format') }} | -
-
-
-
-
-
|
-
{{ _('Source') }} | -{{ pkg_dict.dataset_source }} | -
---|---|
{{ _('Contributor') }} | -- {% if pkg_dict.owner_org %} - {% set org_id = pkg_dict.owner_org or pkg_dict.organization.name %} - - {{ pkg_dict.organization.title }} - - {% endif %} - | -
{{_('Time Period of the Dataset')}} [?] | -{{ h.render_date_from_concat_str(pkg_dict.dataset_date) }} ... {{ _('More') }} | -
{{_('Modified')}} [?] | -- {{ h.render_datetime(modified_time) }} - | -
{{_('Confirmed')}} [?] | -- {{ h.render_datetime(confirmed_time) }} - | -
{{_('Dataset Added on HDX')}} [?] | -- {{ h.render_datetime(hdx_added_time) }} {{ _('Less') }} - | -
{{ _('Expected Update Frequency') }} | -{{ h.hdx_get_frequency_by_value(pkg_dict.data_update_frequency) }} | -
{{ _('Location') }} | -
+
+
+ {% set modified_time = pkg_dict.last_modified %}
+ {% set confirmed_time = pkg_dict.review_date %}
+ {% set hdx_added_time = pkg_dict.metadata_created %}
+ {{ _('Time Period of the Dataset') }} [?]
+ {{ h.render_date_from_concat_str(pkg_dict.dataset_date) }} ... {{ _('More') }}
+
+
+
+ {% if confirmed_time and confirmed_time > modified_time %}
+ {{ _('Modified') }} [?]
+
+ {{ h.render_datetime(modified_time) }}
+
+
+
+ {% endif %}
+ {{ _('Confirmed') }} [?]
+
+ {{ h.render_datetime(confirmed_time) }}
+
+
+
+ {{ _('Dataset Added on HDX') }} [?]
+
+ {{ h.render_datetime(hdx_added_time) }} {{ _('Less') }}
+
+
+
+ {{ _('Expected Update Frequency') }}
+ {{ h.hdx_get_frequency_by_value(pkg_dict.data_update_frequency) }}
+
+ {{ _('Location') }}
+ |
-
{{ _('Visibility') }} | -
- {% if pkg_dict.private %}
- {{ _('Private') }} -
- {{ _('make it public') }}
- {% else %}
- {{ _('Public') }} -
- {{ _('make it private') }}
- {% endif %}
- |
-
{{ _('Visibility') }} | -
- {% if pkg_dict.private %}
- {{ _('Private') }}
- {% else %}
- {{ _('Public') }}
- {% endif %}
- |
-
{{ _('License') }} | -
- {% if pkg_dict.license_id %}
- {{ h.hdx_find_license_name(pkg_dict.license_id, pkg_dict.license_title) }}
- {% if pkg_dict.license_id == 'hdx-other' and pkg_dict.license_other %}
- :
- {% endif %}
-
- {# link and open-data logo will be removed according to https://github.com/OCHA-DAP/hdx-ckan/issues/294
- {% if 'license_url' in pkg_dict %}
- {{ pkg_dict.license_title }}
- {% else %}
- {{ pkg_dict.license_title }}
- {% endif %}
- {% if pkg_dict.isopen %}
-
-
-
- {% endif %}
- #}
+ {{ grp['title'] or grp['name'] }}
+ {% if not loop.last %}, {% endif %}
+ {% endfor %}
+ + + - {% endif %} - |
-
{{ _('Field Names') }} | -{{ pkg_dict.field_names | replace(",", ", ") }} | -
{{ _('File Types') }} | -{{ pkg_dict.file_types | replace(",", ", ") }} | -
{{ _('Number of Rows') }} | -{{ pkg_dict.num_of_rows }} | -
{{ _('Methodology') }} | - {% set methodology, methodology_other = h.methodology_bk_compat(pkg_dict.methodology, pkg_dict.methodology_other) %} -- |
{{ _('Caveats / Comments') }} | -- |
{{ _('Tags') }} | -
- {% for tag in pkg_dict.tags %}
-
- {% if tag.vocabulary_id %}
- {{ tag.display_name }}
- {% else %}
- {{ tag.display_name }}
+
+
+
+
+ {{ _('Source') }}
+ {{ pkg_dict.dataset_source }}
+
+
+
+ {{ _('Contributor') }}
+
- {% endfor %}
- |
-
{{ _('File Format') }} | -
-
|
-
{{ _(key) }} | -{{ value }} | -
+